public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: LoongArch: fix failed testcases in gdb.base/align-c.exp
@ 2022-03-15  1:24 Tiezhu Yang
  0 siblings, 0 replies; only message in thread
From: Tiezhu Yang @ 2022-03-15  1:24 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e34f44e1bf02c91825da11d47b3fadebc5bef451

commit e34f44e1bf02c91825da11d47b3fadebc5bef451
Author: Tiezhu Yang <yangtiezhu@loongson.cn>
Date:   Tue Mar 15 08:53:27 2022 +0800

    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 <yangtiezhu@loongson.cn>

Diff:
---
 gdb/loongarch-tdep.c | 4 ++++
 1 file changed, 4 insertions(+)

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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-15  1:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-15  1:24 [binutils-gdb] gdb: LoongArch: fix failed testcases in gdb.base/align-c.exp Tiezhu Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).