diff options
Diffstat (limited to 'gdb/testsuite/gdb.base/break.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/break.exp | 81 |
1 files changed, 24 insertions, 57 deletions
diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp index aba80ed..16d05b7 100644 --- a/gdb/testsuite/gdb.base/break.exp +++ b/gdb/testsuite/gdb.base/break.exp @@ -202,27 +202,16 @@ if [istarget "mips-idt-*"] then { # # run until the breakpoint at main is hit. For non-stubs-using targets. # -if ![target_info exists use_gdb_stub] { - if [istarget "*-*-vxworks*"] then { - send_gdb "run vxmain \"2\"\n" - set timeout 120 - verbose "Timeout is now $timeout seconds" 2 - } else { - send_gdb "run\n" - } - gdb_expect { - -re "The program .* has been started already.*y or n. $" { - send_gdb "y\n" - exp_continue +gdb_run_cmd +gdb_expect { + -re "Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.* \{.*$gdb_prompt $" { + pass "run until function breakpoint" } - -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.* \{.*$gdb_prompt $"\ - { pass "run until function breakpoint" } - -re ".*$gdb_prompt $" { fail "run until function breakpoint" } - timeout { fail "run until function breakpoint (timeout)" } - } -} else { - if ![target_info exists gdb_stub] { - gdb_test continue ".*Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.*\{.*" "stub continue" + -re "$gdb_prompt $" { + fail "run until function breakpoint" + } + timeout { + fail "run until function breakpoint (timeout)" } } @@ -773,26 +762,14 @@ proc test_next_with_recursion {} { global decimal global binfile - if [target_info exists use_gdb_stub] { - # Reload the program. - delete_breakpoints - gdb_load ${binfile}; - } else { - # FIXME: should be using runto - gdb_test "kill" "" "kill program" "Kill the program being debugged.*y or n. $" "y" - - delete_breakpoints - } + gdb_test "kill" "" "kill program" "Kill the program being debugged.*y or n. $" "y" + delete_breakpoints gdb_test "break factorial" "Breakpoint $decimal at .*" "break at factorial" # Run until we call factorial with 6 - if [istarget "*-*-vxworks*"] then { - send_gdb "run vxmain \"6\"\n" - } else { - gdb_run_cmd - } + gdb_run_cmd gdb_expect { -re "Break.* factorial .value=6. .*$gdb_prompt $" {} -re ".*$gdb_prompt $" { @@ -916,29 +893,19 @@ gdb_test "break marker4" \ # # run until the breakpoint at main is hit. For non-stubs-using targets. # -if ![target_info exists use_gdb_stub] { - if [istarget "*-*-vxworks*"] then { - send_gdb "run vxmain \"2\"\n" - set timeout 120 - verbose "Timeout is now $timeout seconds" 2 - } else { - send_gdb "run\n" - } - gdb_expect { - -re "The program .* has been started already.*y or n. $" { - send_gdb "y\n" - exp_continue +gdb_run_cmd +gdb_expect { + -re "Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.* \{.*$gdb_prompt $" { + pass "run until function breakpoint, optimized file" } - -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.* \{.*$gdb_prompt $"\ - { pass "run until function breakpoint, optimized file" } - -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$gdb_prompt $"\ - { pass "run until function breakpoint, optimized file (code motion)" } - -re ".*$gdb_prompt $" { fail "run until function breakpoint, optimized file" } - timeout { fail "run until function breakpoint, optimized file (timeout)" } - } -} else { - if ![target_info exists gdb_stub] { - gdb_test continue ".*Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.*\{.*" "stub continue, optimized file" + -re "Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$gdb_prompt $" { + pass "run until function breakpoint, optimized file (code motion)" + } + -re "$gdb_prompt $" { + fail "run until function breakpoint, optimized file" + } + timeout { + fail "run until function breakpoint, optimized file (timeout)" } } |