Test different follow-exec-mode settings in gdb.multi/multi-arch-exec.exp
authorSimon Marchi <simon.marchi@ericsson.com>
Tue, 5 Sep 2017 15:40:44 +0000 (17:40 +0200)
committerSimon Marchi <simon.marchi@ericsson.com>
Tue, 5 Sep 2017 15:42:04 +0000 (17:42 +0200)
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.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.multi/multi-arch-exec.exp

index e53192283eaa515c3f25f7027e8f3f64dbc253cd..dfb63a3fa04ca81f91e98dbe24dc9bb426b7c65e 100644 (file)
@@ -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)
index ed985320b8c071a4811e605741b15cccd3be932a..27a0d602a124d50c145c34b33e135dbe32cad736 100644 (file)
@@ -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
+}