From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/2] gdb: LoongArch: fix failed testcases in gdb.base/align-c.exp
Date: Tue, 8 Mar 2022 20:00:59 +0800 [thread overview]
Message-ID: <1646740859-28698-3-git-send-email-yangtiezhu@loongson.cn> (raw)
In-Reply-To: <1646740859-28698-1-git-send-email-yangtiezhu@loongson.cn>
When execute the following command on LoongArch:
make check-gdb TESTS="gdb.base/align-c.exp"
there exists 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>
---
gdb/loongarch-tdep.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gdb/loongarch-tdep.c b/gdb/loongarch-tdep.c
index ffcff03..88a8382 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_ieee_quad);
set_gdbarch_ptr_bit (gdbarch, info.bfd_arch_info->bits_per_address);
set_gdbarch_char_signed (gdbarch, 0);
--
2.1.0
next prev parent reply other threads:[~2022-03-08 12:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-08 12:00 [PATCH 0/2] gdb: rename floatformats_ia64_quad and fix failed testcases Tiezhu Yang
2022-03-08 12:00 ` [PATCH 1/2] gdb: rename floatformats_ia64_quad to floatformats_ieee_quad Tiezhu Yang
2022-03-09 14:24 ` Luis Machado
2022-03-11 14:49 ` Tom Tromey
2022-03-08 12:00 ` Tiezhu Yang [this message]
2022-03-11 14:51 ` [PATCH 2/2] gdb: LoongArch: fix failed testcases in gdb.base/align-c.exp Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1646740859-28698-3-git-send-email-yangtiezhu@loongson.cn \
--to=yangtiezhu@loongson.cn \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).