aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorTiezhu Yang <yangtiezhu@loongson.cn>2022-01-13 11:11:39 +0800
committerTiezhu Yang <yangtiezhu@loongson.cn>2022-01-13 11:12:55 +0800
commite31cf164b4c78246f59922a9122585dc4e23e860 (patch)
treee15848ba3577d87a677e628688f3067841f73ce6 /bfd/elflink.c
parentcf6059a6ace2ac14fdaf6dbec0235f87476f7842 (diff)
downloadbinutils-e31cf164b4c78246f59922a9122585dc4e23e860.zip
binutils-e31cf164b4c78246f59922a9122585dc4e23e860.tar.gz
binutils-e31cf164b4c78246f59922a9122585dc4e23e860.tar.bz2
gdb: testsuite: make string[] type as char in gdb.base/charset.c
This reverts the commit ff656e2e1cb1 ("gdb: testsuite: fix failed testcases in gdb.base/charset.exp"). The original test code has no problem. On an architecture where char is signed, then both 'A' and ebcdic_us_string[7] will yield -63, which makes the equality true. On an architecture where char is unsigned, then both 'A' and ebcdic_us_string[7] will yield 193, which also makes the equality true. The test cases only failed on LoongArch. The default type of char is signed char on LoongArch, like x86-64. But when use gdb print command on LoongArch, the default type of char is unsigned char, this is wrong, I will look into it later, sorry for that. On LoongArch: $ cat test_char.c #include <stdio.h> int main() { char c1 = 193; unsigned char c2 = 193; printf("%d\n", c1); printf("%d\n", c1 == c2); return 0; } $ gcc test_char.c -o test_char $ ./test_char -63 0 (gdb) set target-charset EBCDIC-US (gdb) print 'A' $1 = 193 'A' (gdb) print /c 'A' $2 = 193 'A' (gdb) print /u 'A' $3 = 193 (gdb) print /d 'A' $4 = -63 (gdb) print /x 'A' $5 = 0xc1 Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Diffstat (limited to 'bfd/elflink.c')
0 files changed, 0 insertions, 0 deletions