diff options
author | Daniel Jacobowitz <drow@false.org> | 2007-09-05 00:51:49 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2007-09-05 00:51:49 +0000 |
commit | ea37ba09261f349ac2748da0d4f8f513184776f9 (patch) | |
tree | e809a75cbee45334e9521254235524a6394f406c /gdb/testsuite | |
parent | fcd776e5474bde02e7555b33ef57905eae0f7d3e (diff) | |
download | gdb-ea37ba09261f349ac2748da0d4f8f513184776f9.zip gdb-ea37ba09261f349ac2748da0d4f8f513184776f9.tar.gz gdb-ea37ba09261f349ac2748da0d4f8f513184776f9.tar.bz2 |
* NEWS: Update description of string changes. Mention print/s.
* c-valprint.c (textual_element_type): New.
(c_val_print): Use it. Do not skip address printing for pointers
with a string format.
(c_value_print): Doc update.
* dwarf2read.c (read_array_type): Use make_vector_type.
* gdbtypes.c (make_vector_type): New.
(init_vector_type): Use it.
(gdbtypes_post_init): Initialize builtin_true_unsigned_char.
(_initialize_gdbtypes): Mark int8_t and uint8_t as TYPE_FLAG_NOTTEXT.
* gdbtypes.h (struct builtin_type): Add builtin_true_unsigned_char.
(TYPE_FLAG_NOTTEXT, TYPE_NOTTEXT): New.
(make_vector_type): New.
* printcmd.c (print_formatted): Only handle 's' and 'i' for examine.
Call the language print routine for string format.
(print_scalar_formatted): Call val_print for string format. Handle
unsigned original types for char format.
(validate_format): Do not reject string format.
* stabsread.c (read_type): Use make_vector_type.
* xml-tdesc.c (tdesc_start_vector): Use init_vector_type.
* gdb.texinfo (Output Formats): Update 'c' description. Describe 's'.
(Examining Memory): Update mentions of the 's' format.
(Automatic Display): Likewise.
* gdb.arch/i386-sse.exp: Do not expect character constants.
* gdb.base/charsign.c, gdb.base/charsign.exp: Delete.
* gdb.base/display.exp: Allow print/s.
* gdb.base/printcmds.exp, gdb.base/setvar.exp: Revert signed
and unsigned char array changes.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/i386-sse.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/display.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/printcmds.exp | 12 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/setvar.exp | 8 |
5 files changed, 21 insertions, 12 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index c453ab2..14d731d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,4 +1,13 @@ 2007-09-04 Daniel Jacobowitz <dan@codesourcery.com> + Jim Blandy <jimb@codesourcery.com> + + * gdb.arch/i386-sse.exp: Do not expect character constants. + * gdb.base/charsign.c, gdb.base/charsign.exp: Delete. + * gdb.base/display.exp: Allow print/s. + * gdb.base/printcmds.exp, gdb.base/setvar.exp: Revert signed + and unsigned char array changes. + +2007-09-04 Daniel Jacobowitz <dan@codesourcery.com> * gdb.base/display.exp: Add tests for printf %p. diff --git a/gdb/testsuite/gdb.arch/i386-sse.exp b/gdb/testsuite/gdb.arch/i386-sse.exp index b31b07a..259eb86 100644 --- a/gdb/testsuite/gdb.arch/i386-sse.exp +++ b/gdb/testsuite/gdb.arch/i386-sse.exp @@ -84,7 +84,7 @@ foreach r {0 1 2 3 4 5 6 7} { ".. = \\{$r, $r.25, $r.5, $r.75\\}.*" \ "check float contents of %xmm$r" gdb_test "print \$xmm$r.v16_int8" \ - ".. = \\{(-?\[0-9\]+ '.*', ){15}-?\[0-9\]+ '.*'\\}.*" \ + ".. = \\{(-?\[0-9\]+, ){15}-?\[0-9\]+\\}.*" \ "check int8 contents of %xmm$r" } diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp index 254c431..6ff3920 100644 --- a/gdb/testsuite/gdb.base/display.exp +++ b/gdb/testsuite/gdb.base/display.exp @@ -197,7 +197,7 @@ if [istarget "hppa*-hp-hpux*"] { gdb_test "x/rx j" ".*(Cannot access|Error accessing) memory.*|.*0xa:\[ \t\]*\[0-9\]+.*" } gdb_test "print/0 j" ".*Item count other than 1 is meaningless.*" "print/0 j" -gdb_test "print/s sum" ".*Format letter.*is meaningless.*" " no s" +gdb_test "print/s sum" " = 1000" "ignored s" gdb_test "print/i sum" ".*Format letter.*is meaningless.*.*" "no i" gdb_test "print/a &sum" ".*= $hex.*<sum>.*" # If the constant below is larger than the length of main, then diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp index 3768d67..a44db01 100644 --- a/gdb/testsuite/gdb.base/printcmds.exp +++ b/gdb/testsuite/gdb.base/printcmds.exp @@ -589,18 +589,18 @@ proc test_print_char_arrays {} { gdb_test "set print address on" "" gdb_test "p arrays" \ - " = \\{array1 = \\{97 'a', 98 'b', 99 'c', 0 '\\\\0'\\}, array2 = \\{100 'd'\\}, array3 = \\{101 'e'\\}, array4 = \\{102 'f', 103 'g'\\}, array5 = \\{104 'h', 105 'i', 106 'j', 0 '\\\\0'\\}\\}" + " = {array1 = \"abc\", array2 = \"d\", array3 = \"e\", array4 = \"fg\", array5 = \"hij\"}" gdb_test "p parrays" " = \\(struct some_arrays \\*\\) $hex" - gdb_test "p parrays->array1" " = \\{97 'a', 98 'b', 99 'c', 0 '\\\\0'\\}" + gdb_test "p parrays->array1" " = \"abc\"" gdb_test "p &parrays->array1" " = \\(unsigned char \\(\\*\\)\\\[4\\\]\\) $hex" - gdb_test "p parrays->array2" " = \\{100 'd'\\}" + gdb_test "p parrays->array2" " = \"d\"" gdb_test "p &parrays->array2" " = \\(unsigned char \\(\\*\\)\\\[1\\\]\\) $hex" - gdb_test "p parrays->array3" " = \\{101 'e'\\}" + gdb_test "p parrays->array3" " = \"e\"" gdb_test "p &parrays->array3" " = \\(unsigned char \\(\\*\\)\\\[1\\\]\\) $hex" - gdb_test "p parrays->array4" " = \\{102 'f', 103 'g'\\}" + gdb_test "p parrays->array4" " = \"fg\"" gdb_test "p &parrays->array4" " = \\(unsigned char \\(\\*\\)\\\[2\\\]\\) $hex" - gdb_test "p parrays->array5" " = \\{104 'h', 105 'i', 106 'j', 0 '\\\\0'\\}" + gdb_test "p parrays->array5" " = \"hij\"" gdb_test "p &parrays->array5" " = \\(unsigned char \\(\\*\\)\\\[4\\\]\\) $hex" gdb_test "set print address off" "" diff --git a/gdb/testsuite/gdb.base/setvar.exp b/gdb/testsuite/gdb.base/setvar.exp index dd047c1..5310506 100644 --- a/gdb/testsuite/gdb.base/setvar.exp +++ b/gdb/testsuite/gdb.base/setvar.exp @@ -232,11 +232,11 @@ test_set "set variable v_char_array\[0\]='h'" "set variable v_char_array\[1\]='i # # test "set variable" for "signed char array[2]" # -test_set "set variable v_signed_char_array\[0\]='h'" "set variable v_signed_char_array\[1\]='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\\{104 'h', 105 'i'\\}" "set variable signed char array=\"hi\" (string)" +test_set "set variable v_signed_char_array\[0\]='h'" "set variable v_signed_char_array\[1\]='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\"" "set variable signed char array=\"hi\" (string)" # # test "set variable" for "unsigned char array[2]" # -test_set "set variable v_unsigned_char_array\[0\]='h'" "set variable v_unsigned_char_array\[1\]='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\\{104 'h', 105 'i'\\}" "set variable unsigned char array=\"hi\" (string)" +test_set "set variable v_unsigned_char_array\[0\]='h'" "set variable v_unsigned_char_array\[1\]='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\"" "set variable unsigned char array=\"hi\" (string)" # # test "set variable" for "short array[2]" # @@ -288,11 +288,11 @@ test_set "set v_char_pointer=v_char_array" "set variable *(v_char_pointer)='h'" # # test "set variable" for type "signed char *" # -test_set "set v_signed_char_pointer=v_signed_char_array" "set variable *(v_signed_char_pointer)='h'" "set variable *(v_signed_char_pointer+1)='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\\{104 'h', 105 'i'\\}" "print *(v_signed_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'" "set variable signed char pointer=\"hi\" (string)" +test_set "set v_signed_char_pointer=v_signed_char_array" "set variable *(v_signed_char_pointer)='h'" "set variable *(v_signed_char_pointer+1)='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\"" "print *(v_signed_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'" "set variable signed char pointer=\"hi\" (string)" # # test "set variable" for type "unsigned char *" # -test_set "set v_unsigned_char_pointer=v_unsigned_char_array" "set variable *(v_unsigned_char_pointer)='h'" "set variable *(v_unsigned_char_pointer+1)='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\\{104 'h', 105 'i'\\}" "print *(v_unsigned_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'" "set variable unsigned char pointer=\"hi\" (string)" +test_set "set v_unsigned_char_pointer=v_unsigned_char_array" "set variable *(v_unsigned_char_pointer)='h'" "set variable *(v_unsigned_char_pointer+1)='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\"" "print *(v_unsigned_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'" "set variable unsigned char pointer=\"hi\" (string)" # # test "set variable" for type "short *" # |