2012-02-21 Pedro Alves <palves@redhat.com>
* gdb.base/return-nodebug.exp (do_test): Use with_test_prefix.
This commit is contained in:
parent
e89877ab98
commit
78afebb483
|
@ -1,3 +1,7 @@
|
||||||
|
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>
|
2012-02-21 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
* gdb.trace/unavailable.exp (gdb_collect_globals_test): Use
|
* gdb.trace/unavailable.exp (gdb_collect_globals_test): Use
|
||||||
|
|
|
@ -16,32 +16,29 @@
|
||||||
proc do_test {type} {
|
proc do_test {type} {
|
||||||
set typenospace [string map {{ } -} $type]
|
set typenospace [string map {{ } -} $type]
|
||||||
|
|
||||||
global pf_prefix
|
with_test_prefix "$typenospace" {
|
||||||
set old_prefix $pf_prefix
|
if {[runto "func"]} {
|
||||||
append pf_prefix " $typenospace:"
|
# 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'.
|
||||||
|
|
||||||
if {[runto "func"]} {
|
gdb_test "return -1" \
|
||||||
# Verify that we do not crash when using "return" from a function with
|
"Return value type not available for selected stack frame\\.\r\nPlease use an explicit cast of the value to return\\." \
|
||||||
# no debugging info. Such function has no `struct symbol'. It may
|
"return from function with no debug info without a cast"
|
||||||
# still have an associated `struct minimal_symbol'.
|
|
||||||
|
|
||||||
gdb_test "return -1" \
|
# Cast of the result to the proper width must be done explicitely.
|
||||||
"Return value type not available for selected stack frame\\.\r\nPlease use an explicit cast of the value to return\\." \
|
gdb_test "return ($type) -1" "#0 .* main \\(.*" \
|
||||||
"return from function with no debug info without a cast"
|
"return from function with no debug info with a cast" \
|
||||||
|
"Make selected stack frame return now\\? \\(y or n\\) " "y"
|
||||||
|
|
||||||
# Cast of the result to the proper width must be done explicitely.
|
gdb_test "advance marker" "marker \\(.*" \
|
||||||
gdb_test "return ($type) -1" "#0 .* main \\(.*" \
|
"advance to marker"
|
||||||
"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 \\(.*" \
|
# And if it returned the full width of the result.
|
||||||
"advance to marker"
|
gdb_test "print /d t" " = -1" "full width of the returned result"
|
||||||
|
}
|
||||||
# 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}} {
|
foreach type {{signed char} {short} {int} {long} {long long}} {
|
||||||
|
|
Loading…
Reference in New Issue