This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Printing of strings with special characters
- From: Tom Tromey <tromey at redhat dot com>
- To: Anton Kunze <ak at technosis dot de>
- Cc: gdb at sourceware dot org
- Date: Thu, 04 Mar 2010 11:09:43 -0700
- Subject: Re: Printing of strings with special characters
- References: <4B8F9FE9.2040401@technosis.de>
- Reply-to: tromey at redhat dot com
>>>>> "Anton" == Anton Kunze <ak@technosis.de> writes:
Anton> i'am using gdb 7.0.1 with python and pretty printing on suse linux. If I
Anton> try to print string with german special characters I get only strings as
Anton> '\nnn'.
Anton> My gdbinit file contains following:
Anton> set charset ISO-8859-1
Anton> set target-wide-charset ISO-8859-1
This is almost certainly wrong. You probably want `set
target-wide-charset UTF-32' -- which is the default on Linux. At least,
that will be what you want if your code is using wchar_t.
Also, I recommend against using "set charset"; use target-charset
instead. 'set charset' sets the host charset in addition to the target
charset, but on systems with a decent locale implementation, you
basically will always want to use the result reported by the locale.
Anton> sys.path.insert(0, '/home/anton/projects/debug/printers')
Without the source to this we can't be completely sure about the
problem.
Anton> Within my debug session I use the following commonds on gdb console:
Anton> set print sevenbit-strings off
Anton> print qsHtml
Anton> $4 = "h\366h\366h\366"
What type is a qsHtml? Specifically, what is the underlying character
type it uses?
Tom