aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTiezhu Yang <yangtiezhu@loongson.cn>2022-01-12 08:31:02 +0800
committerTiezhu Yang <yangtiezhu@loongson.cn>2022-01-12 08:31:02 +0800
commitff656e2e1cb1592617a0bb4b21538d3cea17c24f (patch)
tree424a98771925f86407c10504ad52f40aa5dbf7f9 /gdb
parente66b7536b7ffbbe1eb77c6679d558114cd3f5893 (diff)
downloadfsf-binutils-gdb-ff656e2e1cb1592617a0bb4b21538d3cea17c24f.zip
fsf-binutils-gdb-ff656e2e1cb1592617a0bb4b21538d3cea17c24f.tar.gz
fsf-binutils-gdb-ff656e2e1cb1592617a0bb4b21538d3cea17c24f.tar.bz2
gdb: testsuite: fix failed testcases in gdb.base/charset.exp
In gdb/testsuite/gdb.base/charset.c, the last argument is greater than 127 when call fill_run() in EBCDIC-US and IBM1047, but the type of string[] is char, this will change the value due to sign extension. For example, ebcdic_us_string[7] will be -63 instead of the original 193 in EBCDIC-US. Make the type of string[] as unsigned char to fix the following six failed testcases: $ grep FAIL gdb/testsuite/gdb.sum FAIL: gdb.base/charset.exp: check value of parsed character literal in EBCDIC-US FAIL: gdb.base/charset.exp: check value of parsed string literal in EBCDIC-US FAIL: gdb.base/charset.exp: check value of escape that doesn't exist in EBCDIC-US FAIL: gdb.base/charset.exp: check value of parsed character literal in IBM1047 FAIL: gdb.base/charset.exp: check value of parsed string literal in IBM1047 FAIL: gdb.base/charset.exp: check value of escape that doesn't exist in IBM1047 Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/gdb.base/charset.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/testsuite/gdb.base/charset.c b/gdb/testsuite/gdb.base/charset.c
index ed9387b..98aa100 100644
--- a/gdb/testsuite/gdb.base/charset.c
+++ b/gdb/testsuite/gdb.base/charset.c
@@ -44,10 +44,10 @@
#define NUM_CHARS (71)
-char ascii_string[NUM_CHARS];
-char iso_8859_1_string[NUM_CHARS];
-char ebcdic_us_string[NUM_CHARS];
-char ibm1047_string[NUM_CHARS];
+unsigned char ascii_string[NUM_CHARS];
+unsigned char iso_8859_1_string[NUM_CHARS];
+unsigned char ebcdic_us_string[NUM_CHARS];
+unsigned char ibm1047_string[NUM_CHARS];
#ifndef __cplusplus
@@ -86,7 +86,7 @@ long long_array[3];
explicit casts or warnings. */
void
-init_string (char string[],
+init_string (unsigned char string[],
unsigned char x,
unsigned char alert,
unsigned char backspace,
@@ -115,7 +115,7 @@ init_string (char string[],
void
-fill_run (char string[], int start, int len, int first)
+fill_run (unsigned char string[], int start, int len, int first)
{
int i;