* gdb.base/break.exp: Test backtrace and finish from called

function on all platforms, not just HP-UX.
This commit is contained in:
Nicholas Duffek 2000-11-17 16:24:48 +00:00
parent e346e481c2
commit 30e87cd372
2 changed files with 24 additions and 15 deletions

View File

@ -1,3 +1,8 @@
2000-11-17 Nick Duffek <nsd@redhat.com>
* gdb.base/break.exp: Test backtrace and finish from called
function on all platforms, not just HP-UX.
2000-11-03 Michael Snyder <msnyder@cleaver.cygnus.com> 2000-11-03 Michael Snyder <msnyder@cleaver.cygnus.com>
* config/monitor.exp (gdb_target_cmd): Abstracts some of the * config/monitor.exp (gdb_target_cmd): Abstracts some of the

View File

@ -577,31 +577,35 @@ gdb_expect {
# As long as we're stopped (breakpointed) in a called function, # As long as we're stopped (breakpointed) in a called function,
# verify that we can successfully backtrace & such from here. # verify that we can successfully backtrace & such from here.
# #
# In this and the following test, the _sr4export check apparently is needed
if [istarget "hppa*-*-hpux*"] then { # for hppa*-*-hpux.
send_gdb "bt\n" #
gdb_expect { send_gdb "bt\n"
-re "#0\[ \t\]*$hex in marker2.*:4\[49\]\r\n#1.*_sr4export.*$gdb_prompt $"\ gdb_expect {
{pass "backtrace while in called function"} -re "#0\[ \t\]*$hex in marker2.*:4\[49\]\r\n#1.*_sr4export.*$gdb_prompt $"\
-re "#0\[ \t\]*$hex in marker2.*:4\[49\]\r\n#1.*function called from gdb.*$gdb_prompt $"\
{pass "backtrace while in called function"} {pass "backtrace while in called function"}
-re "#0\[ \t\]*($hex in )?marker2.*:4\[49\]\r\n#1.*function called from gdb.*$gdb_prompt $"\
{pass "backtrace while in called function"}
-re "$gdb_prompt $"\ -re "$gdb_prompt $"\
{fail "backtrace while in called function"} {fail "backtrace while in called function"}
timeout {fail "(timeout) backtrace while in called function"} timeout {fail "(timeout) backtrace while in called function"}
} }
send_gdb "finish\n"
gdb_expect { # Return from the called function. For remote targets, it's important to do
-re "Run till exit from .*marker2.* at .*4\[49\]\r\n.* in _sr4export.*$gdb_prompt $"\ # this before runto_main, which otherwise may silently stop on the dummy
# breakpoint inserted by GDB at the program's entry point.
#
send_gdb "finish\n"
gdb_expect {
-re "Run till exit from .*marker2.* at .*4\[49\]\r\n.* in _sr4export.*$gdb_prompt $"\
{pass "finish from called function"} {pass "finish from called function"}
-re "Run till exit from .*marker2.* at .*4\[49\]\r\n.*function called from gdb.*$gdb_prompt $"\ -re "Run till exit from .*marker2.* at .*4\[49\]\r\n.*function called from gdb.*$gdb_prompt $"\
{pass "finish from called function"} {pass "finish from called function"}
-re "Run till exit from .*marker2.* at .*4\[49\]\r\n.*Value returned.*$gdb_prompt $"\ -re "Run till exit from .*marker2.* at .*4\[49\]\r\n.*Value returned.*$gdb_prompt $"\
{pass "finish from called function"} {pass "finish from called function"}
-re "$gdb_prompt $"\ -re "$gdb_prompt $"\
{fail "finish from called function"} {fail "finish from called function"}
timeout {fail "(timeout) finish from called function"} timeout {fail "(timeout) finish from called function"}
}
} }
# Verify that GDB responds gracefully to a "finish" command with # Verify that GDB responds gracefully to a "finish" command with