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: [RFC 5/6] Handle "set print sevenbit-strings on" in print_wchar


On 10/01/2013 06:23 AM, Pierre Muller wrote:
ChangeLog entry:

2013-10-01  Pierre Muller  <muller@sourceware.org>

	* valprint.c (print_wchar): Print all char above seven-bit
  	as octal or hexadecimal if SEVENBIT_STRINGS is non-zero.

testsuite ChangeLog:

2013-10-01  Pierre Muller  <muller@sourceware.org>
	gdb.base/charset.exp: Add test to print char \242 in charset CP1252
	with or without "set print sevenbit-strings on".

Thank you for the test. This is exactly the kind of thing that is needed.

There is one little problem with this, though. As is, the first test, "print \"\\242\"" will fail on linux (at least it does for me). This is because gdb_init (in testsuite/lib/gdb.exp) overrides the environment's locale settings. So we should probably force en_US.UTF-8 and restart gdb before running your new tests:

setenv LANG en_US.UTF-8
setenv LC_ALL en_US.UTF-8
setenv LC_TYPE en_US.UTF-8

clean_restart $testfile

gdb_test "set charset CP1252" ...

With this, the test will pass.

Keith


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