This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
gdb and binutils branch master updated. 389b98f7d880c8551bec64f9e7fb0b05fa941de6
- From: qiyao at sourceware dot org
- To: gdb-cvs at sourceware dot org
- Date: 17 Apr 2014 02:38:42 -0000
- Subject: gdb and binutils branch master updated. 389b98f7d880c8551bec64f9e7fb0b05fa941de6
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".
The branch, master has been updated
via 389b98f7d880c8551bec64f9e7fb0b05fa941de6 (commit)
from 71e50e8314af251f153207192194eaffdf638f5e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=389b98f7d880c8551bec64f9e7fb0b05fa941de6
commit 389b98f7d880c8551bec64f9e7fb0b05fa941de6
Author: Yao Qi <yao@codesourcery.com>
Date: Mon Mar 24 11:26:06 2014 +0800
[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.
-----------------------------------------------------------------------
Summary of changes:
gdb/testsuite/ChangeLog | 10 +
gdb/testsuite/gdb.base/printcmds.exp | 715 +++++++++++++++++-----------------
gdb/testsuite/gdb.base/setvar.exp | 21 +-
gdb/testsuite/lib/gdb.exp | 33 ++
4 files changed, 423 insertions(+), 356 deletions(-)
hooks/post-receive
--
gdb and binutils