[PATCH 16/57][Arm][GAS] Add support for MVE instructions: vdup, vddup, vdwdup, vidup...
[binutils-gdb.git] / gdb / testsuite / gdb.mi / mi-nsthrexec.exp
blobcc193b4d18ecefcbd0dae79aa40d1e68c1dc7a34
1 # Copyright 2009-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 # Test that when a thread other than the main thread execs, and the
17 # main thread was stopped due to user request, the new incarnation of
18 # the main thread doesn't just silently stop at the first internal
19 # breakpoint (usually the _dl_debug_state breakpoint).
21 if { ![support_displaced_stepping] } { 
22     unsupported "displaced stepping"
23     return -1
26 load_lib mi-support.exp
27 set MIFLAGS "-i=mi"
29 gdb_exit
30 if {[mi_gdb_start]} {
31     continue
35 # Start here
37 standard_testfile nsthrexec.c
39 set options [list debug]
40 if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
41     return -1
44 mi_gdb_reinitialize_dir $srcdir/$subdir
45 mi_gdb_load $binfile
47 mi_gdb_test "-gdb-set non-stop 1" ".*"
48 mi_gdb_test "-gdb-set mi-async 1" ".*"
49 mi_detect_async
51 if { [mi_run_to_main] < 0 } {
52     continue
55 mi_create_breakpoint thread_execler \
56     "breakpoint at thread_execler" \
57     -number 2 -function thread_execler
59 # All threads should stop, except the main thread.
60 mi_send_resuming_command "exec-continue --all" "resume all"
61 mi_expect_stop "breakpoint-hit" "thread_execler" "\[^\n\]*" "$srcfile" \
62     "\[0-9\]*" {"" "disp=\"keep\""} "stop at thread_execler"
64 mi_check_thread_states \
65     {"running" "stopped"} \
66     "thread state, execler stopped, main running"
68 mi_gdb_test "200-exec-interrupt --thread 1" "200\\^done" "interrupt main thread"
69 mi_expect_interrupt "main thread interrupted"
71 mi_check_thread_states {"stopped" "stopped"} "thread state, all stopped"
73 # now that we know about all the threads, we can get rid of the breakpoints
74 mi_delete_breakpoints
76 mi_create_breakpoint main \
77     "breakpoint at main" \
78     -number 3 -func main
81 # Now resume the execler thread.  Eventually, it execs.
82 mi_send_resuming_command "exec-continue --thread 2" "resume execler thread"
84 # Check that the main thread passes by the _dl_debug_state internal
85 # breakpoint without silently stopping.
86 mi_expect_stop "breakpoint-hit" "main" "\[^\n\]*" "$srcfile" \
87     "\[0-9\]*" {"" "disp=\"keep\""} "stop at main after exec"
89 mi_gdb_exit