[PATCH 5/57][Arm][GAS] Add support for MVE instructions: vmull{b,t}
[binutils-gdb.git] / gdb / testsuite / gdb.multi / watchpoint-multi-exit.exp
blobd8855df9e5bc2282d57de1ca62ebcf9c15d6175a
1 # Copyright 2016-2019 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 # Make sure that if an inferior exits or is detached/killed, its
17 # watchpoints don't end up with stale locations, preventing resumption
18 # of other inferiors.
20 standard_testfile
22 if {[build_executable "failed to build" $testfile $srcfile {debug}]} {
23     return -1
26 # The test proper.  DISPOSE indicates how to dispose of the fork
27 # child.  Can be either "kill", "detach", or "exit" (to continue it to
28 # normal exit).
29 proc do_test {dispose} {
30     global binfile
32     clean_restart $binfile
34     gdb_test_no_output "set follow-fork child"
35     gdb_test_no_output "set detach-on-fork off"
37     if ![runto "child_function"] {
38         fail "can't run to child_function"
39         return
40     }
42     gdb_test "watch globalvar" "atchpoint \[0-9\]+: globalvar" \
43         "set watchpoint on inferior 2"
45     # Dispose of the inferior.  This should get rid of this inferior's
46     # watchpoint locations.
47     if {$dispose == "kill"} {
48         gdb_test "kill" "" "kill inferior 2" \
49             "Kill the program being debugged.*y or n. $" "y"
50     } elseif {$dispose == "detach"} {
51         gdb_test "detach" ".*" "detach inferior 2"
52     } elseif {$dispose == "exit"} {
53         gdb_test "continue" ".*exited normally.*" "run to exit inferior 2"
54     } else {
55         perror "unhandled dispose: $dispose"
56     }
58     gdb_test "inferior 1" "witching to inferior 1 .*" \
59         "switch back to inferior 1"
61     if {$dispose == "kill"} {
62         gdb_test "print expect_signaled = 1" " = 1"
63     }
65     gdb_breakpoint "marker"
67     # Now continue inferior 1.  Before GDB was fixed, watchpoints for
68     # inferior 2 managed to be left behind.  When GDB realized that
69     # they hadn't been inserted, the continue command was aborted:
70     #
71     #  (gdb) continue
72     #  Continuing.
73     #  Warning:
74     #  Could not insert hardware watchpoint 2.
75     #  Could not insert hardware breakpoints:
76     #  You may have requested too many hardware breakpoints/watchpoints.
77     #
78     #  Command aborted.
79     #  (gdb)
80     #
81     gdb_test "continue" "Breakpoint \[0-9\]+, marker .*" \
82         "continue in inferior 1"
85 foreach_with_prefix dispose {"kill" "detach" "exit"} {
86     do_test $dispose