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]

Re: [PATCH] Fix display of tabulation character for mingw hosts.


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)


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