aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-09-05 17:40:44 +0200
committerSimon Marchi <simon.marchi@ericsson.com>2017-09-05 17:42:04 +0200
commitae780a21f25455e4ca4b2fa7e350e7f994e0f198 (patch)
tree43c5fab2052ce4ee0e3c34563fa6a57d39488ee6 /gdb/testsuite
parentbf93d7ba99319c4ff5f23f35d9645dc9c3d391c2 (diff)
downloadgdb-ae780a21f25455e4ca4b2fa7e350e7f994e0f198.zip
gdb-ae780a21f25455e4ca4b2fa7e350e7f994e0f198.tar.gz
gdb-ae780a21f25455e4ca4b2fa7e350e7f994e0f198.tar.bz2
Test different follow-exec-mode settings in gdb.multi/multi-arch-exec.exp
Using follow-exec-mode "new" takes a different code path than "same", so it's interesting to test this path in combination with a change in architecture of the inferior. This test fails if you remove the previous patch. gdb/testsuite/ChangeLog: * gdb.multi/multi-arch-exec.exp: Test with different "follow-exec-mode" settings. (do_test): New procedure.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.multi/multi-arch-exec.exp24
2 files changed, 23 insertions, 7 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e531922..dfb63a3 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-05 Simon Marchi <simon.marchi@ericsson.com>
+
+ * gdb.multi/multi-arch-exec.exp: Test with different
+ "follow-exec-mode" settings.
+ (do_test): New procedure.
+
2017-09-04 Pedro Alves <palves@redhat.com>
* gdb.base/func-static.c (S::method const, S::method volatile)
diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.exp b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
index ed98532..27a0d60 100644
--- a/gdb/testsuite/gdb.multi/multi-arch-exec.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
@@ -76,12 +76,22 @@ if { [prepare_for_testing "failed to prepare" ${exec2} "${srcfile2}" \
return -1
}
-clean_restart ${exec1}
-if ![runto_main] then {
- fail "couldn't run to main"
- return -1
+proc do_test { mode } {
+ global exec1
+
+ clean_restart ${exec1}
+ if ![runto_main] then {
+ fail "couldn't run to main"
+ return -1
+ }
+
+ gdb_test_no_output "set follow-exec-mode $mode"
+
+ # Test that GDB updates the target description / arch successfuly
+ # after the exec.
+ gdb_test "continue" "Breakpoint 1, main.*" "continue across exec that changes architecture"
}
-# Test that GDB updates the target description / arch successfuly
-# after the exec.
-gdb_test "continue" "Breakpoint 1, main.*" "continue across exec that changes architecture"
+foreach follow_exec_mode {"same" "new"} {
+ do_test $follow_exec_mode
+}