From: Hui Li Date: Thu, 30 Oct 2025 02:51:56 +0000 (+0800) Subject: gdb: LoongArch: Change default char data type to signed X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=73ab559062690e487ac10a7b5a7a90bf62bec608;p=thirdparty%2Fbinutils-gdb.git gdb: LoongArch: Change default char data type to signed According to "Procedure Call Standard for the LoongArch Architecture" [1], for all base ABI types of LoongArch, the char data type in C is signed by default, so change the char data type to signed in gdb/loongarch-tdep.c. Before this patch: make check-gdb TESTS="gdb.base/sizeof.exp" === gdb Summary === # of expected passes 75 # of unexpected failures 1 make check-gdb TESTS="gdb.base/charset.exp" === gdb Summary === # of expected passes 277 # of unexpected failures 6 # of unsupported tests 1 After this patch: make check-gdb TESTS="gdb.base/sizeof.exp" === gdb Summary === # of expected passes 76 make check-gdb TESTS="gdb.base/charset.exp" === gdb Summary === # of expected passes 283 # of unsupported tests 1 [1] https://github.com/loongson/la-abi-specs/blob/release/lapcs.adoc#appendix-c-data-types-and-machine-data-types Signed-off-by: Hui Li Signed-off-by: Tiezhu Yang --- diff --git a/gdb/loongarch-tdep.c b/gdb/loongarch-tdep.c index 5e09125e400..21a3e537793 100644 --- a/gdb/loongarch-tdep.c +++ b/gdb/loongarch-tdep.c @@ -2176,7 +2176,7 @@ loongarch_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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); + set_gdbarch_char_signed (gdbarch, 1); info.target_desc = tdesc; info.tdesc_data = tdesc_data.get ();