From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix display of tabulation character for mingw hosts.
Date: Mon, 05 May 2014 09:40:00 -0000 [thread overview]
Message-ID: <53675BFB.2020702@codesourcery.com> (raw)
In-Reply-To: <1399282018-8921-1-git-send-email-yao@codesourcery.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)
next prev parent reply other threads:[~2014-05-05 9:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-05 9:29 Yao Qi
2014-05-05 9:40 ` Yao Qi [this message]
2014-05-13 9:22 ` ping: " Yao Qi
2014-05-15 17:31 ` Tom Tromey
2014-05-16 12:22 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53675BFB.2020702@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).