Fix display of tabulation character for mingw hosts.
Commit Message
To make the patch more readable, here is the diff generated with
'git diff -b'.
@@ -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)