• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisión1022c627dbd9d7f7f67ac68f16de05474de7a75a (tree)
Tiempo2019-08-10 03:27:03
AutorAndreas Arnez <arnez@linu...>
CommiterAndreas Arnez

Log Message

s390: Implement 'type_align' gdbarch method

The align.exp test case yields many FAILs on s390x, since GDB's _Alignoff
doesn't always agree with the compiler's. On s390x, the maximum alignment
is 8, but GDB returns an alignment of 16 for 16-byte data types such as
"long double".

This is fixed by implementing the type_align gdbarch method. The new
method returns an alignment of 8 for all integer, floating-point, and
vector types larger than 8 bytes. With this change, all align.exp tests
pass.

gdb/ChangeLog:

* s390-tdep.c (s390_type_align): New function.
(s390_gdbarch_init): Set it as type_align gdbarch method.

Cambiar Resumen

Diferencia incremental

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
1+2019-08-09 Andreas Arnez <arnez@linux.ibm.com>
2+
3+ * s390-tdep.c (s390_type_align): New function.
4+ (s390_gdbarch_init): Set it as type_align gdbarch method.
5+
16 2019-08-09 Tom de Vries <tdevries@suse.de>
27
38 PR gdb/24591
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -52,6 +52,37 @@ constexpr gdb_byte s390_break_insn[] = { 0x0, 0x1 };
5252
5353 typedef BP_MANIPULATION (s390_break_insn) s390_breakpoint;
5454
55+/* Types. */
56+
57+/* Implement the gdbarch type alignment method. */
58+
59+static ULONGEST
60+s390_type_align (gdbarch *gdbarch, struct type *t)
61+{
62+ t = check_typedef (t);
63+
64+ if (TYPE_LENGTH (t) > 8)
65+ {
66+ switch (TYPE_CODE (t))
67+ {
68+ case TYPE_CODE_INT:
69+ case TYPE_CODE_RANGE:
70+ case TYPE_CODE_FLT:
71+ case TYPE_CODE_ENUM:
72+ case TYPE_CODE_CHAR:
73+ case TYPE_CODE_BOOL:
74+ case TYPE_CODE_DECFLOAT:
75+ return 8;
76+
77+ case TYPE_CODE_ARRAY:
78+ if (TYPE_VECTOR (t))
79+ return 8;
80+ break;
81+ }
82+ }
83+ return 0;
84+}
85+
5586 /* Decoding S/390 instructions. */
5687
5788 /* Read a single instruction from address AT. */
@@ -6944,6 +6975,8 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
69446975 set_gdbarch_long_double_bit (gdbarch, 128);
69456976 set_gdbarch_long_double_format (gdbarch, floatformats_ia64_quad);
69466977
6978+ set_gdbarch_type_align (gdbarch, s390_type_align);
6979+
69476980 /* Breakpoints. */
69486981 /* Amount PC must be decremented by after a breakpoint. This is
69496982 often the number of bytes returned by gdbarch_breakpoint_from_pc but not