mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-21 18:39:34 +08:00
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>
This commit is contained in:
@ -44,10 +44,10 @@
|
|||||||
|
|
||||||
#define NUM_CHARS (71)
|
#define NUM_CHARS (71)
|
||||||
|
|
||||||
char ascii_string[NUM_CHARS];
|
unsigned char ascii_string[NUM_CHARS];
|
||||||
char iso_8859_1_string[NUM_CHARS];
|
unsigned char iso_8859_1_string[NUM_CHARS];
|
||||||
char ebcdic_us_string[NUM_CHARS];
|
unsigned char ebcdic_us_string[NUM_CHARS];
|
||||||
char ibm1047_string[NUM_CHARS];
|
unsigned char ibm1047_string[NUM_CHARS];
|
||||||
|
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ long long_array[3];
|
|||||||
explicit casts or warnings. */
|
explicit casts or warnings. */
|
||||||
|
|
||||||
void
|
void
|
||||||
init_string (char string[],
|
init_string (unsigned char string[],
|
||||||
unsigned char x,
|
unsigned char x,
|
||||||
unsigned char alert,
|
unsigned char alert,
|
||||||
unsigned char backspace,
|
unsigned char backspace,
|
||||||
@ -115,7 +115,7 @@ init_string (char string[],
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
fill_run (char string[], int start, int len, int first)
|
fill_run (unsigned char string[], int start, int len, int first)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user