From: Andrew <ke@alum.bu.edu>
To: gdb-patches@sourceware.org
Subject: iconv returning byte order marks for Solaris 2.9
Date: Wed, 15 Jul 2009 18:28:00 -0000 [thread overview]
Message-ID: <71415.13770.qm@web33803.mail.mud.yahoo.com> (raw)
[-- 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.~
next reply other threads:[~2009-07-15 17:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-15 18:28 Andrew [this message]
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
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=71415.13770.qm@web33803.mail.mud.yahoo.com \
--to=ke@alum.bu.edu \
--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