Handle CRLF when reading XML on Windows
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.multi / multi-arch.exp
index b114a2ff74d4185c3c91c2f26a16763b87e3120c..4d70ad5bd623d3678e48d3a92f05ce1b65378372 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2009-2016 Free Software Foundation, Inc.
+# Copyright 2009-2019 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
 set testfile "multi-arch"
 
 # The plain remote target can't do multiple inferiors.
-if [target_info exists use_gdb_stub] {
+if [use_gdb_stub] {
     return
 }
 
@@ -52,7 +52,7 @@ if [istarget "s390*-*-*"] {
     set march2 "-m32"
 }
 
-if { [prepare_for_testing ${testfile}.exp ${exec1} "${srcfile1}" \
+if { [prepare_for_testing "failed to prepare" ${exec1} "${srcfile1}" \
          [list debug additional_flags=${march1}]] } {
     return -1
 }
@@ -70,7 +70,7 @@ if [istarget "aarch64*-*-*"] {
     lappend options "additional_flags=${march2}"
 }
 
-if { [prepare_for_testing ${testfile}.exp ${exec2} "${srcfile2}" \
+if { [prepare_for_testing "failed to prepare" ${exec2} "${srcfile2}" \
         $options]} {
     return -1
 }
@@ -96,3 +96,27 @@ if ![runto_main] then {
 
 gdb_test "info inferiors" \
     "Executable.*${exec1}.*${exec2}.*"
+
+# Now select inferior 2, and trigger an event in inferior 1.  This
+# tries to check that GDB doesn't incorrectly uses the architecture of
+# inferior 2 when parsing the expedited registers in a stop reply for
+# inferior 1 (when remote debugging).
+
+gdb_test_no_output "set schedule-multiple on"
+
+with_test_prefix "inf1 event with inf2 selected" {
+    gdb_test "inferior 2" "Switching to inferior 2.*thread 2\.1.*main.*${srcfile2}.*"
+    gdb_test "b hello_loop" "Breakpoint .* at .*${srcfile1}.*"
+    gdb_test "c" " hello_loop.*" "continue to hello_loop"
+}
+
+delete_breakpoints
+
+# Same, but the other way around: select inferior 1 and trigger an
+# event in inferior 2.
+
+with_test_prefix "inf2 event with inf1 selected" {
+    gdb_test "inferior 1" "Switching to inferior 1.*thread 1\.1.*hello_loop.*${srcfile1}.*"
+    gdb_test "b hangout_loop" "Breakpoint .* at .*${srcfile2}.*"
+    gdb_test "c" " hangout_loop.*" "continue to hangout_loop"
+}
This page took 0.024445 seconds and 4 git commands to generate.