This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC 5/6] Handle "set print sevenbit-strings on" in print_wchar


  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]