diff options
author | Pierre Muller <muller@sourceware.org> | 2010-04-21 23:21:04 +0000 |
---|---|---|
committer | Pierre Muller <muller@sourceware.org> | 2010-04-21 23:21:04 +0000 |
commit | 9a22f0d0aeec70f4ee1908008f3a2defaad6f7dd (patch) | |
tree | a36134950efba04d0c0104c79b7714b47e7e5d49 /gdb/testsuite | |
parent | 32d7376d07d6b1ae69b5e15d6b546a07f9fee446 (diff) | |
download | gdb-9a22f0d0aeec70f4ee1908008f3a2defaad6f7dd.zip gdb-9a22f0d0aeec70f4ee1908008f3a2defaad6f7dd.tar.gz gdb-9a22f0d0aeec70f4ee1908008f3a2defaad6f7dd.tar.bz2 |
gdb ChangeLog
* gdbtypes.h (builtin_type): Add builtin_char16 and builtin_char32
fields.
* gdbtypes.c (gdbtypes_post_init): Set builtin_char16 and
builtin_char32 fields.
* printcmd.c (decode_format): Set char size to '\0'
for strings unless explicit size is given.
(print_formatted): Correct calculation of NEXT_ADDRESS
for 16 or 32 bit strings.
(do_examine): Do not force byte size for strings.
Use builtin_char16 and builtin_char32 types to display
16 or 32 bit-wide strings.
(x_command): Set LAST_SIZE to 'b' for string type.
gdb/doc ChangeLog
* gdb.texinfo (Examining memory): Update for
change in string display with explicit size.
gdb/testsuite ChangeLog
* gdb.base/charset.c (Strin16, String32): New variables.
* gdb.base/charset.exp (gdb_test): Test correct display
of 16 or 32 bit strings.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/charset.c | 3 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/charset.exp | 17 |
3 files changed, 27 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a096256..5bba197 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,4 +1,10 @@ -Wed Apr 21 12:47:26 2010 Chris Moller <cmoller@redhat.com> +2010-04-22 Pierre Muller <muller@ics.u-strasbg.fr> + + * gdb.base/charset.c (Strin16, String32): New variables. + * gdb.base/charset.exp (gdb_test): Test correct display + of 16 or 32 bit strings. + +2010-04-21 Chris Moller <cmoller@redhat.com> PR 9167 * gdb.cp/Makefile.in (EXECUTABLES): Added pr9167. diff --git a/gdb/testsuite/gdb.base/charset.c b/gdb/testsuite/gdb.base/charset.c index 6cd01f7..d7ed865 100644 --- a/gdb/testsuite/gdb.base/charset.c +++ b/gdb/testsuite/gdb.base/charset.c @@ -65,6 +65,9 @@ typedef unsigned int char32_t; char16_t uvar; char32_t Uvar; +char16_t *String16; +char32_t *String32; + /* A typedef to a typedef should also work. */ typedef wchar_t my_wchar_t; my_wchar_t myvar; diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp index 9820632..8d1d6543 100644 --- a/gdb/testsuite/gdb.base/charset.exp +++ b/gdb/testsuite/gdb.base/charset.exp @@ -616,4 +616,21 @@ gdb_test "print 'a' == 'a' || 'b' == 'b'" \ ".* = 1" \ "EVAL_SKIP cleanup handling regression test" + +proc string_display { var_name set_prefix x_size x_type} { + gdb_test "set ${var_name} = ${set_prefix}\"Test String\\0with zeroes\"" "" "Assign ${var_name} with prefix ${set_prefix}" + gdb_test "x /2${x_size}s ${var_name}" ".* ${x_type}\"Test String\"\[\r\n\]+.* ${x_type}\"with zeroes\"" "Display String ${var_name} with x/${x_size}s" +} + +string_display String16 u h u +if {$wchar_size == 2} { + string_display String16 L h u +} + +string_display String32 U w U +if {$wchar_size == 4} { + string_display String32 L w U +} + + gdb_exit |