This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix display of tabulation character for mingw hosts.
- From: Yao Qi <yao at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Mon, 5 May 2014 17:38:03 +0800
- Subject: Re: [PATCH] Fix display of tabulation character for mingw hosts.
- Authentication-results: sourceware.org; auth=none
- References: <1399282018-8921-1-git-send-email-yao at codesourcery dot com>
To make the patch more readable, here is the diff generated with
'git diff -b'.
--
Yao (éå)
diff --git a/gdb/valprint.c b/gdb/valprint.c
index fe23530..f55b5db 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -1949,18 +1949,10 @@ print_wchar (gdb_wint_t w, const gdb_byte *orig,
int need_escape = *need_escapep;
*need_escapep = 0;
- 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
- {
+ /* iswprint implementation on Windows returns 1 for tab character.
+ In order to avoid different printout on this host, we explicitly
+ use wchar_printable function. */
switch (w)
{
case LCST ('\a'):
@@ -1986,6 +1978,18 @@ print_wchar (gdb_wint_t w, const gdb_byte *orig,
break;
default:
{
+ if (wchar_printable (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
+ {
int i;
for (i = 0; i + width <= orig_len; i += width)