Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* iconv returning byte order marks for Solaris 2.9
@ 2009-07-15 18:28 Andrew
  2009-07-15 18:57 ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew @ 2009-07-15 18:28 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]

Hi

I found a problem printing strings for gdb 6.8 weekly snapshot 
(2009 07 07) on Solaris 2.9. 

I eventually found that changing INTERMEDIATE_ENCODING 
in gdb_wchar.h to "UCS-4" and applying the following
patch worked. Any comments?

I'm not sure how to handle the INTERMEDIATE_ENCODING 
change, since it's probably system dependent. 

Andrew



      

[-- Attachment #2: patch_charset.txt --]
[-- Type: text/plain, Size: 671 bytes --]

diff -rau src.original/gdb/charset.c src/gdb/charset.c
--- src.original/gdb/charset.c	2009-07-15 13:05:42.000896000 -0400
+++ src/gdb/charset.c	2009-07-15 13:09:23.000013000 -0400
@@ -646,6 +646,20 @@
       *out_chars = iter->out;
       *ptr = orig_inptr;
       *len = orig_in - iter->bytes;
+
+      if (num > 1) {
+	if ( (iter->out[0] == (gdb_wchar_t) 0xfffe) ||
+	     (iter->out[0] == (gdb_wchar_t) 0xfeff) ) {
+
+	  /* iconv returned byte order marks, skip those */
+	  int mov;
+	  for (mov = 0; mov < (num - 1); mov ++) 
+	    iter->out[mov] = iter->out[mov + 1];
+	  
+	  num -= 1;
+	}
+      }
+
       return num;
     }
 
Only in src/gdb: charset.c.~1.24.~

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-08-14 19:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-15 18:28 iconv returning byte order marks for Solaris 2.9 Andrew
2009-07-15 18:57 ` Tom Tromey
2009-07-16  2:29   ` Andrew
2009-07-17 19:19     ` Tom Tromey
2009-07-21 20:18       ` Andrew
2009-07-24 21:58         ` Tom Tromey
2009-08-14 20:13         ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox