From: Tiezhu Yang Date: Tue, 15 Mar 2022 00:53:27 +0000 (+0800) Subject: gdb: LoongArch: fix failed testcases in gdb.base/align-c.exp X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e34f44e1bf02c91825da11d47b3fadebc5bef451;p=binutils-gdb.git gdb: LoongArch: fix failed testcases in gdb.base/align-c.exp When execute the following command on LoongArch: make check-gdb TESTS="gdb.base/align-c.exp" there exist some failed testcases: ... FAIL: gdb.base/align-c.exp: print _Alignof(struct align_pair_long_double_x_float) FAIL: gdb.base/align-c.exp: print _Alignof(struct align_pair_long_double_x_double) FAIL: gdb.base/align-c.exp: print _Alignof(struct align_pair_long_double_x_long_double) ... According to LoongArch ELF ABI specification [1], set the target data types of floating-point to fix the above failed testcases. [1] https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html Signed-off-by: Tiezhu Yang --- diff --git a/gdb/loongarch-tdep.c b/gdb/loongarch-tdep.c index ffcff03109a..0eda1636561 100644 --- a/gdb/loongarch-tdep.c +++ b/gdb/loongarch-tdep.c @@ -268,6 +268,10 @@ loongarch_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_int_bit (gdbarch, 32); set_gdbarch_long_bit (gdbarch, info.bfd_arch_info->bits_per_address); set_gdbarch_long_long_bit (gdbarch, 64); + set_gdbarch_float_bit (gdbarch, 32); + set_gdbarch_double_bit (gdbarch, 64); + set_gdbarch_long_double_bit (gdbarch, 128); + set_gdbarch_long_double_format (gdbarch, floatformats_ia64_quad); set_gdbarch_ptr_bit (gdbarch, info.bfd_arch_info->bits_per_address); set_gdbarch_char_signed (gdbarch, 0);