diff options
author | Pedro Alves <palves@redhat.com> | 2012-02-22 00:04:58 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2012-02-22 00:04:58 +0000 |
commit | 78afebb4837ad8c2de95f3d35cb620b05d95707d (patch) | |
tree | a8ebcd23607da8a3eececa376e2226829d7c4eaa | |
parent | e89877ab9835ecbe3b2da54cf4a05faae01a9b35 (diff) | |
download | gdb-78afebb4837ad8c2de95f3d35cb620b05d95707d.zip gdb-78afebb4837ad8c2de95f3d35cb620b05d95707d.tar.gz gdb-78afebb4837ad8c2de95f3d35cb620b05d95707d.tar.bz2 |
2012-02-21 Pedro Alves <palves@redhat.com>
* gdb.base/return-nodebug.exp (do_test): Use with_test_prefix.
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/return-nodebug.exp | 47 |
2 files changed, 26 insertions, 25 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index cea203b..3ca049d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2012-02-21 Pedro Alves <palves@redhat.com> + * gdb.base/return-nodebug.exp (do_test): Use with_test_prefix. + +2012-02-21 Pedro Alves <palves@redhat.com> + * gdb.trace/unavailable.exp (gdb_collect_globals_test): Use with_test_prefix. diff --git a/gdb/testsuite/gdb.base/return-nodebug.exp b/gdb/testsuite/gdb.base/return-nodebug.exp index 44b415b..aa9389f 100644 --- a/gdb/testsuite/gdb.base/return-nodebug.exp +++ b/gdb/testsuite/gdb.base/return-nodebug.exp @@ -16,32 +16,29 @@ proc do_test {type} { set typenospace [string map {{ } -} $type] - global pf_prefix - set old_prefix $pf_prefix - append pf_prefix " $typenospace:" - - if {[runto "func"]} { - # Verify that we do not crash when using "return" from a function with - # no debugging info. Such function has no `struct symbol'. It may - # still have an associated `struct minimal_symbol'. - - gdb_test "return -1" \ - "Return value type not available for selected stack frame\\.\r\nPlease use an explicit cast of the value to return\\." \ - "return from function with no debug info without a cast" - - # Cast of the result to the proper width must be done explicitely. - gdb_test "return ($type) -1" "#0 .* main \\(.*" \ - "return from function with no debug info with a cast" \ - "Make selected stack frame return now\\? \\(y or n\\) " "y" - - gdb_test "advance marker" "marker \\(.*" \ - "advance to marker" - - # And if it returned the full width of the result. - gdb_test "print /d t" " = -1" "full width of the returned result" + with_test_prefix "$typenospace" { + if {[runto "func"]} { + # Verify that we do not crash when using "return" from a + # function with no debugging info. Such function has no + # `struct symbol'. It may still have an associated + # `struct minimal_symbol'. + + gdb_test "return -1" \ + "Return value type not available for selected stack frame\\.\r\nPlease use an explicit cast of the value to return\\." \ + "return from function with no debug info without a cast" + + # Cast of the result to the proper width must be done explicitely. + gdb_test "return ($type) -1" "#0 .* main \\(.*" \ + "return from function with no debug info with a cast" \ + "Make selected stack frame return now\\? \\(y or n\\) " "y" + + gdb_test "advance marker" "marker \\(.*" \ + "advance to marker" + + # And if it returned the full width of the result. + gdb_test "print /d t" " = -1" "full width of the returned result" + } } - - set pf_prefix $old_prefix } foreach type {{signed char} {short} {int} {long} {long long}} { |