This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFC 5/6] Handle "set print sevenbit-strings on" in print_wchar
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'gdb-patches'" <gdb-patches at sourceware dot org>
- Date: Thu, 26 Sep 2013 22:03:45 +0200
- Subject: [RFC 5/6] Handle "set print sevenbit-strings on" in print_wchar
- Authentication-results: sourceware.org; auth=none
- References: <002901cebaf2$35ec65a0$a1c530e0$ at muller@ics-cnrs.unistra.fr>
When "set print sevenbit-strings on"
is used, all characters above 127 should be displayed as
escapes.
This patch does just that.
Pierre Muller
GDB pascal language maintainer
2013-09-26 Pierre Muller <muller@sourceware.org>
valprint.c (print_wchar): Honor sevenbit_strings value.
---
gdb/valprint.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 0f6d65e..912352c 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -1926,9 +1926,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'))))
+ if (gdb_iswprint (w)
+ && (!sevenbit_strings || (w > 0 && w < 0x7f))
+ && (!need_escape || (!gdb_iswdigit (w)
+ && w != LCST ('8') && w != LCST ('9'))))
{
gdb_wchar_t wchar = w;
--
1.7.9