aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-linux-nat.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2014-03-24 11:26:06 +0800
committerYao Qi <yao@codesourcery.com>2014-04-17 10:33:19 +0800
commit389b98f7d880c8551bec64f9e7fb0b05fa941de6 (patch)
tree92ef4e6322d91e59ae90f31b98b3ef7dd2340e4f /gdb/i386-linux-nat.c
parent71e50e8314af251f153207192194eaffdf638f5e (diff)
downloadbinutils-389b98f7d880c8551bec64f9e7fb0b05fa941de6.zip
binutils-389b98f7d880c8551bec64f9e7fb0b05fa941de6.tar.gz
binutils-389b98f7d880c8551bec64f9e7fb0b05fa941de6.tar.bz2
[testsuite] Set target-charset to ascii
Hi, We find gdb.base/printcmds.exp fails a lot on windows host, like this, p ctable1[163] $204 = 163 '£' (gdb) FAIL: gdb.base/printcmds.exp: p ctable1[163] however, on linux host, p ctable1[163] $205 = 163 '\243' (gdb) PASS: gdb.base/printcmds.exp: p ctable1[163] The printing related code is in valprint.c:print_wchar, if (gdb_iswprint (w) && (!need_escape || (!gdb_iswdigit (w) && w != LCST ('8') && w != LCST ('9')))) { gdb_wchar_t wchar = w; if (w == gdb_btowc (quoter) || w == LCST ('\\')) obstack_grow_wstr (output, LCST ("\\")); obstack_grow (output, &wchar, sizeof (gdb_wchar_t)); } else { // print W in hex or octal digits } When I debug gdb on different hosts, I find on windows host, gdb_iswprint (iswprint) returns true if 'w' is 163. However, on linux host, iswprint returns false if 'w' is 163. Looks this difference is caused by the charset. On Linux host, the target-charset is ANSI_X3.4-1968, while on windows host, the target-charset is CP1252. We can see how target-charset affects the output. On linux host, (gdb) set target-charset ASCII (gdb) p ctable1[163] $1 = 163 '\243' (gdb) set target-charset CP1252 (gdb) p ctable1[163] $2 = 163 '£' we can print the pound sign too, and it shows target-charset does affect the output. This patch is to set target-charset temporarily to ASCII for some charset-sensitive tests. Tested on arm-none-eabi and powerpc-linux-gnu on mingw32 host. More than one hundred fails are fixed. gdb/testsuite: 2014-04-17 Yao Qi <yao@codesourcery.com> * lib/gdb.exp (with_target_charset): New proc. * gdb.base/printcmds.exp (test_print_all_chars): Wrap tests with with_target_charset. (test_print_strings): Likewise. (test_repeat_bytes): Likewise. * gdb.base/setvar.exp: Set target-charset to ASCII temporarily for some tests.
Diffstat (limited to 'gdb/i386-linux-nat.c')
0 files changed, 0 insertions, 0 deletions