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.arch | |
parent | f37f681c2bb884e74cd33340617a6d1a408d1a75 (diff) | |
download | gdb-fa43b1d7ca8d9699a253b1f227e91c406a043a0b.zip gdb-fa43b1d7ca8d9699a253b1f227e91c406a043a0b.tar.gz gdb-fa43b1d7ca8d9699a253b1f227e91c406a043a0b.tar.bz2 |
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.arch')
-rw-r--r-- | gdb/testsuite/gdb.arch/gdb1558.exp | 13 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/i386-size-overlap.exp | 13 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/i386-size.exp | 13 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/i386-unwind.exp | 13 |
4 files changed, 7 insertions, 45 deletions
diff --git a/gdb/testsuite/gdb.arch/gdb1558.exp b/gdb/testsuite/gdb.arch/gdb1558.exp index 42bb277..3f07a64 100644 --- a/gdb/testsuite/gdb.arch/gdb1558.exp +++ b/gdb/testsuite/gdb.arch/gdb1558.exp @@ -50,17 +50,12 @@ gdb_test "b sub2" "Breakpoint 3.*" "set breakpoint at sub2" gdb_run_cmd -gdb_expect 30 { +set test "Hits breakpoint at main after function called from main" +gdb_test_multiple "" $test { -re "Breakpoint 1.*main .*$gdb_prompt $" { - pass "Hits breakpoint at main after function called from main" + pass $test } -re "Breakpoint 2.*sub1 .*$gdb_prompt $" { - kfail "gdb/1558" "Hits breakpoint at main after function called from main" - } - -re "$gdb_prompt $" { - fail "Hits breakpoint at main after function called from main" - } - timeout { - fail "Hits breakpoint at main after function called from main (timeout)" + kfail "gdb/1558" $test } } diff --git a/gdb/testsuite/gdb.arch/i386-size-overlap.exp b/gdb/testsuite/gdb.arch/i386-size-overlap.exp index 0f9ba75..3b130c2 100644 --- a/gdb/testsuite/gdb.arch/i386-size-overlap.exp +++ b/gdb/testsuite/gdb.arch/i386-size-overlap.exp @@ -41,18 +41,7 @@ gdb_load ${binfile} # We use gdb_run_cmd so this stands a chance to work for remote # targets too. gdb_run_cmd - -gdb_expect { - -re "Program received signal SIGTRAP.*$gdb_prompt $" { - pass "run past main" - } - -re ".*$gdb_prompt $" { - fail "run past main" - } - timeout { - fail "run past main (timeout)" - } -} +gdb_test "" "Program received signal SIGTRAP.*" "run past main" set message "backtrace shows the outer function" gdb_test_multiple "backtrace 10" $message { diff --git a/gdb/testsuite/gdb.arch/i386-size.exp b/gdb/testsuite/gdb.arch/i386-size.exp index 6d63976..39e5b50 100644 --- a/gdb/testsuite/gdb.arch/i386-size.exp +++ b/gdb/testsuite/gdb.arch/i386-size.exp @@ -46,18 +46,7 @@ gdb_load ${binfile} # We use gdb_run_cmd so this stands a chance to work for remote # targets too. gdb_run_cmd - -gdb_expect { - -re "Program received signal SIGTRAP.*$gdb_prompt $" { - pass "run past main" - } - -re ".*$gdb_prompt $" { - fail "run past main" - } - timeout { - fail "run past main (timeout)" - } -} +gdb_test "" "Program received signal SIGTRAP.*" "run past main" set message "backtrace shows no function" gdb_test_multiple "backtrace 10" $message { diff --git a/gdb/testsuite/gdb.arch/i386-unwind.exp b/gdb/testsuite/gdb.arch/i386-unwind.exp index c329dd6..69f802a 100644 --- a/gdb/testsuite/gdb.arch/i386-unwind.exp +++ b/gdb/testsuite/gdb.arch/i386-unwind.exp @@ -46,18 +46,7 @@ gdb_load ${binfile} # We use gdb_run_cmd so this stands a chance to work for remote # targets too. gdb_run_cmd - -gdb_expect { - -re "Program received signal SIGTRAP.*$gdb_prompt $" { - pass "run past gdb1435" - } - -re ".*$gdb_prompt $" { - fail "run past gdb1435" - } - timeout { - fail "run past gdb1435 (timeout)" - } -} +gdb_test "" "Program received signal SIGTRAP.*" "run past gdb1435" gdb_test "backtrace 10" \ "#1\[ \t]*$hex in gdb1435.*\r\n#2\[ \t\]*$hex in main.*" \ |