diff options
author | Pedro Alves <palves@redhat.com> | 2014-09-12 22:16:31 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2014-09-12 22:16:31 +0100 |
commit | fa43b1d7ca8d9699a253b1f227e91c406a043a0b (patch) | |
tree | cde814e330d7e2657020cf31199edbddc47934fe /gdb/testsuite/gdb.base/break.exp | |
parent | [IRIX] eliminate deprecated_insert_raw_breakpoint uses (diff) | |
download | binutils-gdb-fa43b1d7ca8d9699a253b1f227e91c406a043a0b.tar.gz binutils-gdb-fa43b1d7ca8d9699a253b1f227e91c406a043a0b.tar.bz2 binutils-gdb-fa43b1d7ca8d9699a253b1f227e91c406a043a0b.zip |
after gdb_run_cmd, gdb_expect -> gdb_test_multiple/gdb_test
See:
https://sourceware.org/ml/gdb-patches/2014-09/msg00404.html
We have a number of places that do gdb_run_cmd followed by gdb_expect,
when it would be better to use gdb_test_multiple or gdb_test.
This converts all that "grep gdb_run_cmd -A 2 | grep gdb_expect"
found.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/testsuite/
2014-09-12 Pedro Alves <palves@redhat.com>
* gdb.arch/gdb1558.exp: Replace uses of gdb_expect after
gdb_run_cmd with gdb_test_multiple or gdb_test throughout.
* gdb.arch/i386-size-overlap.exp: Likewise.
* gdb.arch/i386-size.exp: Likewise.
* gdb.arch/i386-unwind.exp: Likewise.
* gdb.base/a2-run.exp: Likewise.
* gdb.base/break.exp: Likewise.
* gdb.base/charset.exp: Likewise.
* gdb.base/chng-syms.exp: Likewise.
* gdb.base/commands.exp: Likewise.
* gdb.base/dbx.exp: Likewise.
* gdb.base/find.exp: Likewise.
* gdb.base/funcargs.exp: Likewise.
* gdb.base/jit-simple.exp: Likewise.
* gdb.base/reread.exp: Likewise.
* gdb.base/sepdebug.exp: Likewise.
* gdb.base/step-bt.exp: Likewise.
* gdb.cp/mb-inline.exp: Likewise.
* gdb.cp/mb-templates.exp: Likewise.
* gdb.objc/basicclass.exp: Likewise.
* gdb.threads/killed.exp: Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.base/break.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/break.exp | 48 |
1 files changed, 14 insertions, 34 deletions
diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp index beab99a41d1..1870ad563bc 100644 --- a/gdb/testsuite/gdb.base/break.exp +++ b/gdb/testsuite/gdb.base/break.exp @@ -358,17 +358,9 @@ gdb_test "disable \$1foo" \ # run until the breakpoint at main is hit. For non-stubs-using targets. # 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 "$gdb_prompt $" { - fail "run until function breakpoint" - } - timeout { - fail "run until function breakpoint (timeout)" - } -} +gdb_test "" \ + "Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.* \{.*" \ + "run until function breakpoint" # Test the 'list' commands sets current file for the 'break LINENO' command. set bp_marker1 [gdb_get_line_number "set breakpoint 16 here" ${srcfile1}] @@ -773,14 +765,7 @@ proc test_next_with_recursion {} { # Run until we call factorial with 6 gdb_run_cmd - gdb_expect { - -re "Break.* factorial .value=6. .*$gdb_prompt $" {} - -re ".*$gdb_prompt $" { - fail "run to factorial(6)" - gdb_suppress_tests - } - timeout { fail "run to factorial(6) (timeout)" ; gdb_suppress_tests } - } + gdb_test "" "Break.* factorial .value=6. .*" "run to factorial(6)" # Continue until we call factorial recursively with 5. @@ -871,18 +856,14 @@ gdb_test "break marker4" \ # run until the breakpoint at main is hit. For non-stubs-using targets. # gdb_run_cmd -gdb_expect { + +set test "run until function breakpoint, optimized file" +gdb_test_multiple "" $test { -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" + pass $test } -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)" + pass "$test (code motion)" } } @@ -945,15 +926,14 @@ gdb_test "rbreak main" \ # Run to a breakpoint. Fail if we see "Junk at end of arguments". gdb_run_cmd -gdb_expect { + +set test "rbreak junk" +gdb_test_multiple "" $test { -re "Junk at end of arguments" { - fail "rbreak junk" + fail $test } -re ".*Breakpoint \[0-9\]+,.*$gdb_prompt $" { - pass "rbreak junk" - } - timeout { - fail "rbreak junk (timeout)" + pass $test } } |