diff options
author | Tom Tromey <tromey@redhat.com> | 2012-05-18 15:31:42 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-05-18 15:31:42 +0000 |
commit | 9cb709b6ba0111234528d4ead138d5b54fed6095 (patch) | |
tree | a7f5ace4300361d3c46c18e28cf185fc50e8db98 /gdb/testsuite | |
parent | b012acddd87cb89dc4b357adf458511232c58bfe (diff) | |
download | gdb-9cb709b6ba0111234528d4ead138d5b54fed6095.zip gdb-9cb709b6ba0111234528d4ead138d5b54fed6095.tar.gz gdb-9cb709b6ba0111234528d4ead138d5b54fed6095.tar.bz2 |
PR exp/13907:
* valprint.h (struct value_print_options) <symbol_print>: New
field.
* valprint.c (user_print_options): Add default for symbol_print.
(show_symbol_print): New function.
(generic_val_print): Respect symbol_print.
(_initialize_valprint): Add "print symbol" setting.
* f-valprint.c (f_val_print): Respect symbol_print.
* c-valprint.c (c_val_print): Respect symbol_print.
* NEWS: Update.
* printcmd.c (print_address_symbolic): Return int. Ignore some
zero-size symbols.
(print_address_demangle): Return int.
* defs.h: (print_address_symbolic): Return int.
* value.h (print_address_demangle): Return int.
doc
* gdb.texinfo (Print Settings): Document 'set print symbol'.
testsuite
* gdb.mi/mi-var-cmd.exp: Update.
* gdb.objc/basicclass.exp (do_objc_tests): Update.
* gdb.cp/virtbase.exp: Update.
* gdb.cp/classes.exp (test_static_members): Update.
* gdb.cp/casts.exp: Update.
* gdb.base/pointers.exp: Update.
* gdb.base/funcargs.exp (pointer_args): Update.
(structs_by_reference): Update.
* gdb.base/find.exp: Update.
* gdb.base/call-strs.exp: Send "set print symbol off".
* gdb.base/call-ar-st.exp: Update.
* gdb.ada/fun_addr.exp: Update.
* gdb.base/printcmds.exp (test_print_symbol): New proc.
Call it.
(test_print_repeats_10, test_print_strings)
(test_print_char_arrays): Update.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 19 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/fun_addr.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/call-ar-st.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/call-strs.exp | 1 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/find.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/funcargs.exp | 10 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/pointers.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/printcmds.exp | 97 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/casts.exp | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/classes.exp | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/virtbase.exp | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-cmd.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.objc/basicclass.exp | 2 |
13 files changed, 93 insertions, 62 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 9ef5587..bc92a84 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,24 @@ 2012-05-18 Tom Tromey <tromey@redhat.com> + * gdb.mi/mi-var-cmd.exp: Update. + * gdb.objc/basicclass.exp (do_objc_tests): Update. + * gdb.cp/virtbase.exp: Update. + * gdb.cp/classes.exp (test_static_members): Update. + * gdb.cp/casts.exp: Update. + * gdb.base/pointers.exp: Update. + * gdb.base/funcargs.exp (pointer_args): Update. + (structs_by_reference): Update. + * gdb.base/find.exp: Update. + * gdb.base/call-strs.exp: Send "set print symbol off". + * gdb.base/call-ar-st.exp: Update. + * gdb.ada/fun_addr.exp: Update. + * gdb.base/printcmds.exp (test_print_symbol): New proc. + Call it. + (test_print_repeats_10, test_print_strings) + (test_print_char_arrays): Update. + +2012-05-18 Tom Tromey <tromey@redhat.com> + * gdb.base/charset.exp (string_display): Update. 2012-05-18 Tom Tromey <tromey@redhat.com> diff --git a/gdb/testsuite/gdb.ada/fun_addr.exp b/gdb/testsuite/gdb.ada/fun_addr.exp index 6dabf34..9924995 100644 --- a/gdb/testsuite/gdb.ada/fun_addr.exp +++ b/gdb/testsuite/gdb.ada/fun_addr.exp @@ -31,7 +31,7 @@ clean_restart ${testfile} # the inferior is *not* running (no frame). gdb_test "print foo'address" \ - "= .* 0x\[0-9a-zA-Z\]+" \ + "= .* 0x\[0-9a-zA-Z\]+ <foo>" \ "print foo'address" diff --git a/gdb/testsuite/gdb.base/call-ar-st.exp b/gdb/testsuite/gdb.base/call-ar-st.exp index 50ca37c..81501c2 100644 --- a/gdb/testsuite/gdb.base/call-ar-st.exp +++ b/gdb/testsuite/gdb.base/call-ar-st.exp @@ -161,7 +161,7 @@ if {![gdb_skip_float_test "continuing to breakpoint 1220"] && \ #step gdb_test "step" \ - "print_all_arrays \\(array_i=, array_c=.ZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZa., array_f=, array_d=\\) at .*call-ar-st.c:306\[ \t\r\n\]+306.*print_int_array\\(array_i\\);.*" \ + "print_all_arrays \\(array_i=<integer_array.*>, array_c=<char_array.*> .ZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZa., array_f=<float_array.*>, array_d=<double_array.*>\\) at .*call-ar-st.c:306\[ \t\r\n\]+306.*print_int_array\\(array_i\\);.*" \ "step inside print_all_arrays" #step -over diff --git a/gdb/testsuite/gdb.base/call-strs.exp b/gdb/testsuite/gdb.base/call-strs.exp index 43d7ef6..7c5c46e 100644 --- a/gdb/testsuite/gdb.base/call-strs.exp +++ b/gdb/testsuite/gdb.base/call-strs.exp @@ -56,6 +56,7 @@ gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} gdb_test_no_output "set print sevenbit-strings" gdb_test_no_output "set print address off" +gdb_test_no_output "set print symbol off" gdb_test_no_output "set width 0" if ![runto_main] then { diff --git a/gdb/testsuite/gdb.base/find.exp b/gdb/testsuite/gdb.base/find.exp index 664481c..ad54d65 100644 --- a/gdb/testsuite/gdb.base/find.exp +++ b/gdb/testsuite/gdb.base/find.exp @@ -83,7 +83,7 @@ gdb_test "find /1 &int8_search_buf\[0\], +sizeof(int8_search_buf), 'a', 'a', 'a' "max-count" gdb_test "print \$_" \ - "${history_prefix}.*${hex_number}" \ + "${history_prefix}.*${hex_number} <int8_search_buf\\+10>" \ "\$_" gdb_test "print \$numfound" \ diff --git a/gdb/testsuite/gdb.base/funcargs.exp b/gdb/testsuite/gdb.base/funcargs.exp index 8998caa..edc14e8 100644 --- a/gdb/testsuite/gdb.base/funcargs.exp +++ b/gdb/testsuite/gdb.base/funcargs.exp @@ -332,7 +332,7 @@ proc pointer_args {} { gdb_run_cmd gdb_expect { - -re ".* call3a \\(cp=$hex \"a.*\", sp=$hex, ip=$hex, lp=$hex\\) .*$gdb_prompt $" { pass "run to call3a" } + -re ".* call3a \\(cp=$hex <c> \"a.*\", sp=$hex <s>, ip=$hex <i>, lp=$hex <l>\\) .*$gdb_prompt $" { pass "run to call3a" } -re "$gdb_prompt $" { fail "run to call3a" ; gdb_suppress_tests; } timeout { fail "(timeout) run to call3a" ; gdb_suppress_tests; } } @@ -344,7 +344,7 @@ proc pointer_args {} { # Continue; should stop at call3b and print actual arguments. # Try dereferencing the arguments. - if [gdb_test "cont" ".* call3b \\(ucp=$hex \"b.*\", usp=$hex, uip=$hex, ulp=$hex\\) .*" "continue to call3b"] { + if [gdb_test "cont" ".* call3b \\(ucp=$hex <uc> \"b.*\", usp=$hex <us>, uip=$hex <ui>, ulp=$hex <ul>\\) .*" "continue to call3b"] { gdb_suppress_tests; } @@ -355,7 +355,7 @@ proc pointer_args {} { # Continue; should stop at call3c and print actual arguments. # Try dereferencing the arguments. - if [gdb_test "cont" ".* call3c \\(fp=$hex, dp=$hex\\) .*" "continue to call3c"] { + if [gdb_test "cont" ".* call3c \\(fp=$hex <f>, dp=$hex <d>\\) .*" "continue to call3c"] { gdb_suppress_tests; } @@ -388,7 +388,7 @@ proc structs_by_reference {} { gdb_run_cmd gdb_expect { - -re ".* call4a \\(stp=$hex\\) .*$gdb_prompt $" { + -re ".* call4a \\(stp=$hex <st>\\) .*$gdb_prompt $" { pass "run to call4a" } -re "$gdb_prompt $" { fail "run to call4a" ; gdb_suppress_tests; } @@ -399,7 +399,7 @@ proc structs_by_reference {} { # Continue; should stop at call4b and print actual arguments. - gdb_test "cont" ".* call4b \\(unp=$hex\\) .*" "continue to call4b" + gdb_test "cont" ".* call4b \\(unp=$hex <un>\\) .*" "continue to call4b" # Try dereferencing the arguments. if { $target_sizeof_long == $target_sizeof_int } { diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp index bd29581..1090134 100644 --- a/gdb/testsuite/gdb.base/pointers.exp +++ b/gdb/testsuite/gdb.base/pointers.exp @@ -281,4 +281,4 @@ gdb_test "ptype ppppppC" "type = char \\*\\*\\*\\*\\*\\*" "ptype ppppppC" # Regression test for a crash. gdb_test "p instance.array_variable + 0" \ - " = \\(long (int )?\\*\\) 0x\[0-9a-f\]*" + " = \\(long (int )?\\*\\) 0x\[0-9a-f\]* <instance>" diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp index 08a54b0..0f35ba8 100644 --- a/gdb/testsuite/gdb.base/printcmds.exp +++ b/gdb/testsuite/gdb.base/printcmds.exp @@ -422,7 +422,7 @@ proc test_print_all_chars {} { # repeat count, set to the default of 10. proc test_print_repeats_10 {} { - global gdb_prompt + global gdb_prompt decimal for { set x 1; } { $x <= 16 } { incr x; } { gdb_test_no_output "set print elements $x" @@ -464,7 +464,7 @@ proc test_print_repeats_10 {} { if { $aval < 16 } { set xstr "${xstr}\[.\]\[.\]\[.\]" } - set string " = \[(\]unsigned char \[*\]\[)\] ${a}${xstr}"; + set string " = \[(\]unsigned char \[*\]\[)\] <ctable2(\\+$decimal)?> ${a}${xstr}"; gdb_test "$command" "$string" "$command with print elements set to $x"; } } @@ -483,7 +483,7 @@ proc test_print_repeats_embedded_array {} { } proc test_print_strings {} { - global gdb_prompt + global gdb_prompt decimal # We accept "(unsigned char *) " before the string. char vs. unsigned char # is already tested elsewhere. @@ -509,71 +509,71 @@ proc test_print_strings {} { gdb_test_no_output "set print elements 8" gdb_test "p &ctable1\[0\]" \ - " = \\(unsigned char \\*\\) \"\"" + " = \\(unsigned char \\*\\) <ctable1> \"\"" gdb_test "p &ctable1\[1\]" \ - " = \\(unsigned char \\*\\) \"\\\\001\\\\002\\\\003\\\\004\\\\005\\\\006\\\\a\\\\b\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\001\\\\002\\\\003\\\\004\\\\005\\\\006\\\\a\\\\b\"..." gdb_test "p &ctable1\[1*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\b\\\\t\\\\n\\\\v\\\\f\\\\r\\\\016\\\\017\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\b\\\\t\\\\n\\\\v\\\\f\\\\r\\\\016\\\\017\"..." gdb_test "p &ctable1\[2*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\020\\\\021\\\\022\\\\023\\\\024\\\\025\\\\026\\\\027\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\020\\\\021\\\\022\\\\023\\\\024\\\\025\\\\026\\\\027\"..." gdb_test "p &ctable1\[3*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\030\\\\031\\\\032\\\\033\\\\034\\\\035\\\\036\\\\037\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\030\\\\031\\\\032\\\\033\\\\034\\\\035\\\\036\\\\037\"..." gdb_test "p &ctable1\[4*8\]" \ - " = \\(unsigned char \\*\\) \" !\\\\\"#\\\$%&'\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \" !\\\\\"#\\\$%&'\"..." gdb_test "p &ctable1\[5*8\]" \ - " = \\(unsigned char \\*\\) \"\\(\\)\\*\\+,-./\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\(\\)\\*\\+,-./\"..." gdb_test "p &ctable1\[6*8\]" \ - " = \\(unsigned char \\*\\) \"01234567\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"01234567\"..." gdb_test "p &ctable1\[7*8\]" \ - " = \\(unsigned char \\*\\) \"89:;<=>\\?\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"89:;<=>\\?\"..." gdb_test "p &ctable1\[8*8\]" \ - " = \\(unsigned char \\*\\) \"@ABCDEFG\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"@ABCDEFG\"..." gdb_test "p &ctable1\[9*8\]" \ - " = \\(unsigned char \\*\\) \"HIJKLMNO\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"HIJKLMNO\"..." gdb_test "p &ctable1\[10*8\]" \ - " = \\(unsigned char \\*\\) \"PQRSTUVW\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"PQRSTUVW\"..." gdb_test "p &ctable1\[11*8\]" \ - " = \\(unsigned char \\*\\) \"XYZ\\\[\\\\\\\\\\\]\\^_\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"XYZ\\\[\\\\\\\\\\\]\\^_\"..." gdb_test "p &ctable1\[12*8\]" \ - " = \\(unsigned char \\*\\) \"`abcdefg\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"`abcdefg\"..." gdb_test "p &ctable1\[13*8\]" \ - " = \\(unsigned char \\*\\) \"hijklmno\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"hijklmno\"..." gdb_test "p &ctable1\[14*8\]" \ - " = \\(unsigned char \\*\\) \"pqrstuvw\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"pqrstuvw\"..." gdb_test "p &ctable1\[15*8\]" \ - " = \\(unsigned char \\*\\) \"xyz\[{|}\]+\\~\\\\177\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"xyz\[{|}\]+\\~\\\\177\"..." gdb_test "p &ctable1\[16*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\200\\\\201\\\\202\\\\203\\\\204\\\\205\\\\206\\\\207\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\200\\\\201\\\\202\\\\203\\\\204\\\\205\\\\206\\\\207\"..." gdb_test "p &ctable1\[17*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\210\\\\211\\\\212\\\\213\\\\214\\\\215\\\\216\\\\217\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\210\\\\211\\\\212\\\\213\\\\214\\\\215\\\\216\\\\217\"..." gdb_test "p &ctable1\[18*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\220\\\\221\\\\222\\\\223\\\\224\\\\225\\\\226\\\\227\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\220\\\\221\\\\222\\\\223\\\\224\\\\225\\\\226\\\\227\"..." gdb_test "p &ctable1\[19*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\230\\\\231\\\\232\\\\233\\\\234\\\\235\\\\236\\\\237\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\230\\\\231\\\\232\\\\233\\\\234\\\\235\\\\236\\\\237\"..." gdb_test "p &ctable1\[20*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\240\\\\241\\\\242\\\\243\\\\244\\\\245\\\\246\\\\247\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\240\\\\241\\\\242\\\\243\\\\244\\\\245\\\\246\\\\247\"..." gdb_test "p &ctable1\[21*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\250\\\\251\\\\252\\\\253\\\\254\\\\255\\\\256\\\\257\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\250\\\\251\\\\252\\\\253\\\\254\\\\255\\\\256\\\\257\"..." gdb_test "p &ctable1\[22*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\260\\\\261\\\\262\\\\263\\\\264\\\\265\\\\266\\\\267\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\260\\\\261\\\\262\\\\263\\\\264\\\\265\\\\266\\\\267\"..." gdb_test "p &ctable1\[23*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\270\\\\271\\\\272\\\\273\\\\274\\\\275\\\\276\\\\277\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\270\\\\271\\\\272\\\\273\\\\274\\\\275\\\\276\\\\277\"..." gdb_test "p &ctable1\[24*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\300\\\\301\\\\302\\\\303\\\\304\\\\305\\\\306\\\\307\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\300\\\\301\\\\302\\\\303\\\\304\\\\305\\\\306\\\\307\"..." gdb_test "p &ctable1\[25*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\310\\\\311\\\\312\\\\313\\\\314\\\\315\\\\316\\\\317\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\310\\\\311\\\\312\\\\313\\\\314\\\\315\\\\316\\\\317\"..." gdb_test "p &ctable1\[26*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\320\\\\321\\\\322\\\\323\\\\324\\\\325\\\\326\\\\327\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\320\\\\321\\\\322\\\\323\\\\324\\\\325\\\\326\\\\327\"..." gdb_test "p &ctable1\[27*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\330\\\\331\\\\332\\\\333\\\\334\\\\335\\\\336\\\\337\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\330\\\\331\\\\332\\\\333\\\\334\\\\335\\\\336\\\\337\"..." gdb_test "p &ctable1\[28*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\340\\\\341\\\\342\\\\343\\\\344\\\\345\\\\346\\\\347\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\340\\\\341\\\\342\\\\343\\\\344\\\\345\\\\346\\\\347\"..." gdb_test "p &ctable1\[29*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\350\\\\351\\\\352\\\\353\\\\354\\\\355\\\\356\\\\357\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\350\\\\351\\\\352\\\\353\\\\354\\\\355\\\\356\\\\357\"..." gdb_test "p &ctable1\[30*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\360\\\\361\\\\362\\\\363\\\\364\\\\365\\\\366\\\\367\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\360\\\\361\\\\362\\\\363\\\\364\\\\365\\\\366\\\\367\"..." gdb_test "p &ctable1\[31*8\]" \ - " = \\(unsigned char \\*\\) \"\\\\370\\\\371\\\\372\\\\373\\\\374\\\\375\\\\376\\\\377\"..." + " = \\(unsigned char \\*\\) <ctable1\\+$decimal> \"\\\\370\\\\371\\\\372\\\\373\\\\374\\\\375\\\\376\\\\377\"..." } proc test_print_int_arrays {} { @@ -624,7 +624,7 @@ proc test_artificial_arrays {} { proc test_print_char_arrays {} { global gdb_prompt - global hex + global hex decimal gdb_test_no_output "set print elements 24" gdb_test_no_output "set print address on" @@ -632,17 +632,17 @@ proc test_print_char_arrays {} { gdb_test "p arrays" \ " = {array1 = \"abc\", array2 = \"d\", array3 = \"e\", array4 = \"fg\", array5 = \"hij\"}" - gdb_test "p parrays" " = \\(struct some_arrays \\*\\) $hex" + gdb_test "p parrays" " = \\(struct some_arrays \\*\\) $hex <arrays>" gdb_test "p parrays->array1" " = \"abc\"" - gdb_test "p &parrays->array1" " = \\(unsigned char \\(\\*\\)\\\[4\\\]\\) $hex" + gdb_test "p &parrays->array1" " = \\(unsigned char \\(\\*\\)\\\[4\\\]\\) $hex <arrays>" gdb_test "p parrays->array2" " = \"d\"" - gdb_test "p &parrays->array2" " = \\(unsigned char \\(\\*\\)\\\[1\\\]\\) $hex" + gdb_test "p &parrays->array2" " = \\(unsigned char \\(\\*\\)\\\[1\\\]\\) $hex <arrays\\+$decimal>" gdb_test "p parrays->array3" " = \"e\"" - gdb_test "p &parrays->array3" " = \\(unsigned char \\(\\*\\)\\\[1\\\]\\) $hex" + gdb_test "p &parrays->array3" " = \\(unsigned char \\(\\*\\)\\\[1\\\]\\) $hex <arrays\\+$decimal>" gdb_test "p parrays->array4" " = \"fg\"" - gdb_test "p &parrays->array4" " = \\(unsigned char \\(\\*\\)\\\[2\\\]\\) $hex" + gdb_test "p &parrays->array4" " = \\(unsigned char \\(\\*\\)\\\[2\\\]\\) $hex <arrays\\+$decimal>" gdb_test "p parrays->array5" " = \"hij\"" - gdb_test "p &parrays->array5" " = \\(unsigned char \\(\\*\\)\\\[4\\\]\\) $hex" + gdb_test "p &parrays->array5" " = \\(unsigned char \\(\\*\\)\\\[4\\\]\\) $hex <arrays\\+$decimal>" gdb_test_no_output "set print address off" } @@ -773,6 +773,16 @@ proc test_printf_with_dfp {} { gdb_test "printf \"%DDf\\n\",1.2E6144dl" "1.200000000000000000000000000000000E\\+6144" } +proc test_print_symbol {} { + gdb_test_no_output "set print symbol on" + + gdb_test "print &three" " = .* <three>" + gdb_test "print parrays" " = .* <arrays>" + + # In case somebody adds tests after this. + gdb_test_no_output "set print symbol off" +} + # Escape a left curly brace to prevent it from being interpreted as # the beginning of a bound proc gdb_test_escape_braces { args } { @@ -840,3 +850,4 @@ test_print_array_constants test_print_enums test_printf test_printf_with_dfp +test_print_symbol diff --git a/gdb/testsuite/gdb.cp/casts.exp b/gdb/testsuite/gdb.cp/casts.exp index 7272a29..ee499d7 100644 --- a/gdb/testsuite/gdb.cp/casts.exp +++ b/gdb/testsuite/gdb.cp/casts.exp @@ -141,7 +141,7 @@ gdb_test "print dynamic_cast<Alpha &> (derived)" \ "dynamic_cast simple upcast to reference" gdb_test "print dynamic_cast<Derived *> (ad)" \ - " = \\(Derived \\*\\) $nonzero_hex" \ + " = \\(Derived \\*\\) ${nonzero_hex}( <vtable for Derived.*>)?" \ "dynamic_cast simple downcast" gdb_test "print dynamic_cast<VirtuallyDerived *> (add)" \ @@ -157,7 +157,7 @@ gdb_test "print dynamic_cast<VirtuallyDerived &> (*ad)" \ "dynamic_cast to reference to non-existing base" gdb_test "print dynamic_cast<DoublyDerived *> (add)" \ - " = \\(DoublyDerived \\*\\) $nonzero_hex" \ + " = \\(DoublyDerived \\*\\) ${nonzero_hex}( <vtable for DoublyDerived.*>)?" \ "dynamic_cast unique downcast" gdb_test "print dynamic_cast<Gamma *> (add)" \ diff --git a/gdb/testsuite/gdb.cp/classes.exp b/gdb/testsuite/gdb.cp/classes.exp index ae43630..36304b4 100644 --- a/gdb/testsuite/gdb.cp/classes.exp +++ b/gdb/testsuite/gdb.cp/classes.exp @@ -519,8 +519,8 @@ proc test_static_members {} { gdb_test "print Foo::st" "\\$\[0-9\]+ = 100" gdb_test_no_output "set foo.st = 200" "" gdb_test "print bar.st" "\\$\[0-9\]+ = 200" - gdb_test "print &foo.st" "\\$\[0-9\]+ = \\(int ?\\*\\) $hex" - gdb_test "print &Bar::st" "\\$\[0-9\]+ = \\(int ?\\*\\) $hex" + gdb_test "print &foo.st" "\\$\[0-9\]+ = \\(int ?\\*\\) $hex <Foo::st>" + gdb_test "print &Bar::st" "\\$\[0-9\]+ = \\(int ?\\*\\) $hex <Foo::st>" gdb_test "print *\$" "\\$\[0-9\]+ = 200" gdb_test_no_output "set print static-members off" diff --git a/gdb/testsuite/gdb.cp/virtbase.exp b/gdb/testsuite/gdb.cp/virtbase.exp index 6bc0076..939830f 100644 --- a/gdb/testsuite/gdb.cp/virtbase.exp +++ b/gdb/testsuite/gdb.cp/virtbase.exp @@ -72,10 +72,10 @@ gdb_test "print rtti_data" " = .*, data = 1\}" # value history to check the pointer value is not changed. If it had # been changed, then we'd not be able to find the real type anymore. gdb_test "print virtual_middle_b" \ - " = \\(Virtual \\*\\) $hex" \ + " = \\(Virtual \\*\\) $hex <virtual_o>" \ "print pointer to virtual base at non-zero offset of larger object" gdb_test "print $" \ - " = \\(Virtual \\*\\) $hex" \ + " = \\(Virtual \\*\\) $hex <virtual_o>" \ "print same pointer from history value" gdb_test "print *$$" \ " = \\(Virtual\\) {<VirtualMiddleA> = {<VirtualBase> = {_vptr.VirtualBase = ${hex}( <vtable for Virtual.*>)?, x = 0}, _vptr.VirtualMiddleA = ${hex}( <vtable for Virtual.*>)?, y = \\{0 <repeats 300 times>\\}}, <VirtualMiddleB> = {_vptr.VirtualMiddleB = ${hex}( <vtable for Virtual.*>)?, y = 0}, _vptr.Virtual = ${hex}( <vtable for Virtual.*>)?, z = 0}" \ diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp index f3ee77a..cadff9f 100644 --- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp +++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp @@ -377,11 +377,11 @@ mi_gdb_test "-var-update *" \ "assign same value to func (update)" mi_gdb_test "-var-create array_ptr * array_ptr" \ - "\\^done,name=\"array_ptr\",numchild=\"1\",value=\"$hex\",type=\"int \\*\",has_more=\"0\"" \ + "\\^done,name=\"array_ptr\",numchild=\"1\",value=\"$hex <array>\",type=\"int \\*\",has_more=\"0\"" \ "create global variable array_ptr" mi_gdb_test "-var-assign array_ptr array2" \ - "\\^done,value=\"$hex\"" \ + "\\^done,value=\"$hex <array2>\"" \ "assign array to pointer" mi_gdb_test "-var-update *" \ @@ -389,7 +389,7 @@ mi_gdb_test "-var-update *" \ "assign array to pointer (update)" mi_gdb_test "-var-assign array_ptr array2" \ - "\\^done,value=\"$hex\"" \ + "\\^done,value=\"$hex <array2>\"" \ "assign same array to pointer" mi_gdb_test "-var-update *" \ diff --git a/gdb/testsuite/gdb.objc/basicclass.exp b/gdb/testsuite/gdb.objc/basicclass.exp index c1892ca..6ebffb0 100644 --- a/gdb/testsuite/gdb.objc/basicclass.exp +++ b/gdb/testsuite/gdb.objc/basicclass.exp @@ -148,7 +148,7 @@ gdb_test "print self" \ " print self" gdb_test "print \*self" \ - "\\$\[0-9\] = \{{?isa = 0x\[0-9a-f\]+}?, object = 0x0\}" \ + "\\$\[0-9\] = \{{?isa = 0x\[0-9a-f\]+( <.*>)?}?, object = 0x0\}" \ " print contents of self" # |