[gdb/syscalls] Sync with strace v6.13
[binutils-gdb.git] / gdb / testsuite / gdb.base / annota1.exp
blob927e8a7e5792fd52feea150f41837ceaea0b4598
1 # Copyright 1999-2024 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 # This file was written by Elena Zannoni (ezannoni@cygnus.com)
19 # This testcase cannot use runto_main because of the different prompt
20 # we get when using annotation level 2.
22 require target_can_use_run_cmd
24 # This test checks the full path to the binary in the output of some
25 # tests, as a result this test will not work for remote host boards
26 # where we have to first copy the binary to the remote host.
27 require {!is_remote host}
29 set breakpoints_invalid "\r\n\032\032breakpoints-invalid\r\n"
32 # test running programs
35 standard_testfile
37 if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
38     return -1
42 # break in main
45 set main_line [gdb_get_line_number "break main"]
47 gdb_test "break ${srcfile}:${main_line}" \
48     "Breakpoint.*at.* file .*$srcfile, line $main_line\\." \
49     "breakpoint main"
53 # NOTE: this prompt is OK only when the annotation level is > 1
54 # NOTE: When this prompt is in use the gdb_test procedure must be
55 #       called with '-prompt "$gdb_prompt$"' otherwise it assumes the
56 #       last char after the gdb_prompt is a white space. This is not
57 #       true with this annotated prompt.
59 set old_gdb_prompt $gdb_prompt
60 set gdb_prompt "\r\n\032\032pre-prompt\r\n$gdb_prompt \r\n\032\032prompt\r\n"
63 # Escape all the characters in the path that need it. For instance 
64 # the directory name could contain '+'.
66 set escapedsrcfile [string_to_regexp ${srcdir}/${subdir}/${srcfile}]
70 # set the annotation level to 2
72 # of course, this will test:
73 # annotate-pre-prompt
74 # annotate-prompt
75 # annotate-post-prompt (in the next block)
77 gdb_test_no_output -prompt "$gdb_prompt$" "set annotate 2" \
78     "annotation set at level 2"
81 # info break will test:
82 # annotate-breakpoints-headers
83 # annotate-field
84 # annotate-breakpoints-table
85 # annotate-record
86 # annotate-breakpoints-table-end
88 gdb_test_multiple "info break" "breakpoint info" {
89     -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-headers\r\n\r\n\032\032field 0\r\nNum     \r\n\032\032field 1\r\nType           \r\n\032\032field 2\r\nDisp \r\n\032\032field 3\r\nEnb \r\n\032\032field 4\r\nAddress    +\r\n\032\032field 5\r\nWhat\r\n\r\n\032\032breakpoints-table\r\n\r\n\032\032record\r\n\r\n\032\032field 0\r\n1       \r\n\032\032field 1\r\nbreakpoint     \r\n\032\032field 2\r\nkeep \r\n\032\032field 3\r\ny   \r\n\032\032field 4\r\n$hex +\r\n\032\032field 5\r\nin main at ${escapedsrcfile}:$main_line\r\n\r\n\032\032breakpoints-table-end\r\n$gdb_prompt$" {
90         pass $gdb_test_name
91     }
92     -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-headers\r\n\r\n\032\032field 0\r\nNum     \r\n\032\032field 1\r\nType           \r\n\032\032field 2\r\nDisp \r\n\032\032field 3\r\nEnb \r\n\032\032field 4\r\nAddress    +\r\n\032\032field 5\r\nWhat\r\n\r\n\032\032breakpoints-table\r\n\r\n\032\032record\r\n\r\n\032\032field 0\r\n1       \r\n\032\032field 1\r\nbreakpoint     \r\n\032\032field 2\r\nkeep \r\n\032\032field 3\r\ny   \r\n\032\032field 4\r\n$hex +\r\n\032\032field 5\r\nin main at .*${srcfile}:$main_line\r\n\r\n\032\032breakpoints-table-end\r\n$gdb_prompt$" {
93         setup_xfail "*-*-*" 8375
94         fail $gdb_test_name
95     }
100 # run to a break point will test:
101 # annotate-frames-invalid
102 # annotate-breakpoints-invalid (a.k.a. breakpoints-changed)
103 # annotate-starting
104 # annotate-breakpoint
105 # annotate-frame-begin
106 # annotate-frame-function-name
107 # annotate-frame-args
108 # annotate-frame-source-begin
109 # annotate-frame-source-file
110 # annotate-frame-source-file-end
111 # annotate-frame-source-line
112 # annotate-frame-source-end
113 # annotate-source
114 # annotate-frame-end
115 # annotate-stopped
118 set binexp [string_to_regexp $binfile]
120 set warning_slow_re \
121     "warning: File transfers from remote targets can be slow\[^\r\n\]+\r\n"
122 set warning_gdb_index_re \
123     [multi_line \
124          "warning: Skipping \[^\r\n\]+ .gdb_index section in \[^\r\n\]+" \
125          "Do \"set use-deprecated-index-sections on\" before the file is read" \
126          "to use the section anyway\\.\r\n"]
127 set reading_re \
128     "Reading \[^\r\n\]+\r\n"
129 set libthread_db_re \
130     [multi_line \
131          [string_to_regexp {[Thread debugging using libthread_db enabled]}] \
132          "Using host libthread_db library \[^\r\n\]+\r\n"]
134 set optional_re \
135     [list \
136          "\(" \
137          "\($reading_re)" \
138          "|" \
139          "\($warning_slow_re\)" \
140          "|" \
141          "\($libthread_db_re\)" \
142          "|" \
143          "\(\r\n$warning_gdb_index_re\)?" \
144          "\)*"]
145 set optional_re [join $optional_re ""]
147 set run_re \
148     [list \
149          "\r\n\032\032post-prompt\r\n" \
150          "Starting program: $binexp \r\n" \
151          $optional_re \
152          "(\r\n\032\032breakpoints-invalid\r\n)?" \
153          $optional_re \
154          "(\r\n\032\032frames-invalid\r\n)?" \
155          $optional_re \
156          "\r\n\032\032starting\r\n" \
157          $optional_re \
158          "\r\n\032\032frames-invalid\r\n" \
159          $optional_re \
160          "\r\n\032\032breakpoints-invalid\r\n" \
161          $optional_re \
162          "\r\n\032\032breakpoint 1\r\n" \
163          "\r\n" \
164          "Breakpoint 1, " \
165          "\r\n\032\032frame-begin 0 $hex\r\n" \
166          "\r\n\032\032frame-function-name\r\n" \
167          "main" \
168          "\r\n\032\032frame-args\r\n" \
169          [string_to_regexp " ()"] \
170          "\r\n\032\032frame-source-begin\r\n" \
171          " at " \
172          "\r\n\032\032frame-source-file\r\n" \
173          ".*annota1.c" \
174          "\r\n\032\032frame-source-file-end\r\n" \
175          ":" \
176          "\r\n\032\032frame-source-line\r\n" \
177          "$main_line" \
178          "\r\n\032\032frame-source-end\r\n" \
179          "\r\n" \
180          "\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n" \
181          "\r\n\032\032frame-end\r\n" \
182          "\r\n\032\032stopped\r\n"]
184 set run_re [join $run_re ""]
186 gdb_test_multiple "run" "run until main breakpoint" {
187     -re $run_re.*$gdb_prompt$ {
188         pass $gdb_test_name
189     }
193 # Let's do a next, to get to a point where the array is initialized
194 # We don't care about the annotated output for this operation, it is the same as
195 # the one produced by run above
197 gdb_test_multiple "next" "go after array init line" {
198     -re "source .*annota1.c.*$gdb_prompt$" {
199         pass $gdb_test_name
200     }
205 # printing the array will test:
206 # annotate-value-history-begin
207 # annotate-value-history-value
208 # annotate-array-section-begin
209 # annotate-elt
210 # FIXME: annotate-elt-rep and annotate-elt-rep-end not tested
211 # annotate-array-section-end
212 # annotate-value-history-end
213 # FIXME: annotate-value-begin and annotate-value-end not tested (the gdb output
214 #              command would cause them to be used)
216 gdb_test_multiple "print my_array" "print array" {
217     -re "\r\n\032\032post-prompt\r\n\r\n\032\032value-history-begin 1 -\r\n.*= \r\n\032\032value-history-value\r\n.\r\n\032\032array-section-begin 0 -\r\n1\r\n\032\032elt\r\n, 2\r\n\032\032elt\r\n, 3\r\n\032\032elt\r\n\r\n\032\032array-section-end\r\n.\r\n\r\n\032\032value-history-end\r\n$gdb_prompt$" {
218         pass $gdb_test_name
219     }
224 # this should generate an error message, so to test:
225 # annotate-error-begin
226 # FIXME: annotate-error not tested
229 gdb_test_multiple "print non_existent_value" "print non_existent_value" {
230     -re "\r\n\032\032post-prompt\r\n\r\n\032\032error-begin\r\nNo symbol \"non_existent_value\" in current context.\r\n\r\n\032\032error\r\n$gdb_prompt$" {
231         pass $gdb_test_name
232     }
237 # break at signal handler. So that, once we are in the sig handler, if we do a bt
238 # we can test annotate-signal-handler-caller
240 gdb_test_multiple "break handle_USR1" "break handle_USR1" {
241     -re  "\r\n\032\032post-prompt\r\nBreakpoint.*at $hex: file.*$srcfile, line.*\r\n\032\032breakpoints-invalid\r\n.*$gdb_prompt$" {
242         pass $gdb_test_name
243     }
247 # break at printf. When we are stopped at printf, we can test 
249 gdb_test_multiple "break printf" "break printf" {
250     -re  "\r\n\032\032post-prompt\r\nBreakpoint.*at $hex.*\032\032breakpoints-invalid\r\n.*$gdb_prompt$" {
251         pass $gdb_test_name
252     }
253     -re  "\r\n\032\032post-prompt\r\nwarning: Breakpoint address adjusted from $hex to $hex.\r\n\r\n\032\032breakpoints-invalid\r\nBreakpoint.*at $hex.*$gdb_prompt$" {
254         pass $gdb_test_name
255     }
259 # get to printf
261 set pat_begin "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n${breakpoints_invalid}\r\n\032\032frames-invalid\r\n"
262 set pat_adjust "warning: Breakpoint 3 address previously adjusted from $hex to $hex.\r\n"
263 set pat_end "\r\n\032\032breakpoint 3\r\n\r\nBreakpoint 3, \r\n\032\032frame-begin 0 $hex\r\n\r\n(\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n)*.*\032\032frame-function-name\r\n.*printf(@.*)?\r\n\032\032frame-args\r\n.*\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$"
265 gdb_test_multiple "continue" "continue to printf" {
266     -re "${pat_begin}($pat_adjust)?$pat_end" {
267         pass $gdb_test_name
268     }
269     -re ".*$gdb_prompt$"     { fail $gdb_test_name }
272 set pac [string_to_regexp {[PAC]}]
275 # test:
276 # annotate-frame-where
277 # annotate-frame-address
278 # annotate-frame-address-end
280 set pat_begin \
281     [list \
282          "\r\n\032\032post-prompt\r\n" \
283          "\r\n\032\032frame-begin 0 $hex\r\n" \
284          ".0  \r\n" \
285          "(" \
286          "\032\032frame-address\r\n" \
287          "${hex}( $pac)?" \
288          "\r\n\032\032frame-address-end\r\n" \
289          " in \r\n" \
290          ")*" \
291          "\032\032frame-function-name\r\n" \
292          ".*printf(@.*)?" \
293          "\r\n\032\032frame-args\r\n" \
294          " \\(.*frame-end\r\n" \
295          "\r\n\032\032frame-begin 1 $hex\r\n" \
296          ".1  " \
297          "\r\n\032\032frame-address\r\n" \
298          "${hex}( $pac)?" \
299          "\r\n\032\032frame-address-end\r\n" \
300          " in " \
301          "\r\n\032\032frame-function-name\r\n" \
302          "main" \
303          "\r\n\032\032frame-args\r\n" \
304          [string_to_regexp " ()"] \
305          "\r\n\032\032frame-source-begin\r\n" \
306          " at " \
307          "\r\n\032\032frame-source-file\r\n"]
309 set pat_begin [join $pat_begin ""]
311 set pat_end \
312     [list \
313          "\r\n\032\032frame-source-file-end\r\n" \
314          ":" \
315          "\r\n\032\032frame-source-line\r\n" \
316          ".*" \
317          "\r\n\032\032frame-source-end\r\n\r\n" \
318          "\r\n\032\032frame-end\r\n" \
319          "(" \
320          "\r\n\032\032frame-begin .*\r\n" \
321          "\r\n\032\032frame-end\r\n" \
322          ")*" \
323          "$gdb_prompt$"]
325 set pat_end [join $pat_end ""]
327 gdb_test_multiple "backtrace" "backtrace from shlibrary" {
328     -re "$pat_begin$escapedsrcfile$pat_end" {
329         pass $gdb_test_name
330     }
331     -re "$pat_begin.*$srcfile$pat_end" {
332         setup_xfail "*-*-*" 8375
333         fail $gdb_test_name
334     }
339 # test printing a frame with some arguments: 
340 # annotate-arg-begin
341 # annotate-arg-name-end
342 # annotate-arg-value
343 # annotate-arg-end
346 if [target_info exists gdb,nosignals] {
347     unsupported "send SIGUSR1"
348     unsupported "backtrace @ signal handler"
349 } else {
350     gdb_test_multiple "signal SIGUSR1" "send SIGUSR1" {
351         -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)+\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${escapedsrcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" {
352             pass $gdb_test_name
353         }
354         -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)+\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*${srcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" {
355             setup_xfail "*-*-*" 8375
356             fail $gdb_test_name
357         }
358     }
360     #
361     # test:
362     # annotate-signal-handler-caller
363     #
364     gdb_test_multiple "backtrace" "backtrace @ signal handler" {
365         -re "frame-begin 0 $hex\r\n#0.*frame-end.*frame-begin 1 $hex\r\n#1.*(\032\032signal-handler-caller\r\n.signal handler called.\r\n\r\n)+\032\032frame-end\r\n\r\n\032\032frame-begin 2 $hex\r\n#2.*(frame-begin 3 $hex\r\n#3.*)*frame-end.*$gdb_prompt$" {
366             pass $gdb_test_name
367         }
368     }
372 # delete all the breakpoints
374 gdb_test_multiple "delete 1" "delete bp 1" {
375     -re "\r\n\032\032post-prompt\r\n${breakpoints_invalid}$gdb_prompt$" {
376         pass $gdb_test_name
377     }
380 gdb_test_multiple "delete 2" "delete bp 2" {
381     -re "\r\n\032\032post-prompt\r\n${breakpoints_invalid}$gdb_prompt$" {
382         pass $gdb_test_name
383     }
386 gdb_test_multiple "delete 3" "delete bp 3" {
387     -re "\r\n\032\032post-prompt\r\n${breakpoints_invalid}$gdb_prompt$" {
388         pass $gdb_test_name
389     }
393 # break in main, after value is initialized. This is in preparation
394 # to test the annotate output for the display command.
396 gdb_test_multiple "break ${srcfile}:${main_line}" "break in main" {
397     -re "post-prompt.*Breakpoint 4 at $hex: file ${escapedsrcfile}, line $main_line.*\032\032breakpoints-invalid.*$gdb_prompt$" {
398         pass $gdb_test_name
399     }
400     -re "post-prompt.*Breakpoint 4 at $hex: file .*${srcfile}, line $main_line.*\032\032breakpoints-invalid.*$gdb_prompt$" {
401         setup_xfail "*-*-*" 8375
402         fail $gdb_test_name
403     }
407 # display the value; test:
408 # annotate-display-begin
409 # annotate-display-number-end
410 # annotate-display-format
411 # annotate-display-expression
412 # annotate-display-expression-end
413 # annotate-display-end
414 # FIXME: annotate-display-value not tested
416 gdb_test_multiple "display value" "set up display" {
417     -re "post-prompt\r\n\r\n\032\032display-begin\r\n1\r\n\032\032display-number-end\r\n: \r\n\032\032display-format\r\n\r\n\032\032display-expression\r\nvalue\r\n\032\032display-expression-end\r\n = \r\n\032\032display-expression\r\n7\r\n\r\n\032\032display-end\r\n$gdb_prompt$" {
418         pass "set up display"
419     }
422 # Get the core into the output directory.
423 if {![is_remote host]} {
424     gdb_test -prompt "$gdb_prompt$" \
425         "set cwd [file dirname $binfile]" "" \
426         "set inferior cwd to test directory"
429 set y_or_n [string_to_regexp "(y or n)"]
431 # should ask query. Test annotate-query.
432 # we don't care about anything else here, only the query.
434 send_gdb "run\n"
435 gdb_expect {
436   -re "pre-query.*already.*$y_or_n.*query\r\n" {
437          send_gdb "y\n"
438          gdb_expect {
439              -re ".*post-query.*$gdb_prompt$" \
440                      { pass "re-run" }
441              -re ".*$gdb_prompt$"  { fail "re-run" }
442              timeout { fail "re-run (timeout)" }
443          }
444      }
445   -re ".*$gdb_prompt$"  { fail "re-run" }
446   timeout { fail "re-run (timeout)" }
450 # Test that breakpoints-invalid is issued once and only once for
451 # breakpoint ignore count changes, after annotation stopped.
454 set value_inc_line [gdb_get_line_number "increment value"]
456 gdb_test_multiple "break $value_inc_line" "break at value++" {
457     -re "Breakpoint 5 at $hex: file .*$srcfile, line $value_inc_line.*$gdb_prompt$" {
458         pass "break at value++"
459     }
462 gdb_test_multiple "ignore 5 4" "ignore 5 4" {
463     -re "Will ignore next 4 crossings of breakpoint 5.*$gdb_prompt$" {
464         pass "ignore 5 4"
465     }
468 gdb_test_multiple "continue" "annotate ignore count change" {
469     -re ".*breakpoints-invalid.*breakpoints-invalid.*$gdb_prompt$" {
470         fail "annotate ignore count change"
471     }
472     -re ".*$srcfile:$value_inc_line:.*\032\032stopped\r\n$gdb_prompt$" {
473         pass "annotate ignore count change"
474     }
477 # check that ignore command is working, or the above can provide
478 # misleading assurance ...
480 gdb_test_multiple "next" "next to exit loop" {
481     -re "source .*annota1.c.*$gdb_prompt$" {
482     }
485 set after_loop_line [gdb_get_line_number "after loop"]
487 gdb_test_multiple "next" "breakpoint ignore count" {
488     -re ".*$srcfile:$after_loop_line:.*$gdb_prompt$" {
489         pass "breakpoint ignore count"
490     }
493 # Get the inferior's PID for later.
495 set pid -1
496 gdb_test_multiple "info inferior 1" "get inferior pid" {
497     -re "process (\[0-9\]*).*$gdb_prompt$" {
498         set pid $expect_out(1,string)
499         pass $gdb_test_name
500     }
504 # Send a signal that is not handled; test:
505 # annotate-signalled
506 # annotate-signal-name
507 # annotate-signal-name-end
508 # annotate-signal-string
509 # annotate-signal-string-end
510 # FIXME: annotate-signal not tested (requires that the inferior be 
511 #                        stopped by a "random" signal)
513 if [target_info exists gdb,nosignals] {
514     unsupported "signal sent"
515 } else {
516     gdb_test_multiple "signal SIGTRAP" "signal sent" {
517         -re ".*\032\032post-prompt\r\nContinuing with signal SIGTRAP.\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\r\n\r\n\032\032signalled\r\n\r\nProgram terminated with signal \r\n\032\032signal-name\r\nSIGTRAP\r\n\032\032signal-name-end\r\n, \r\n\032\032signal-string\r\nTrace.breakpoint trap\r\n\032\032signal-string-end\r\n.\r\nThe program no longer exists.\r\n\r\n\032\032thread-exited,id=\"${decimal}\",group-id=\"i${decimal}\"\r\n\r\n\032\032stopped\r\n$gdb_prompt$" {
518             pass $gdb_test_name
519         }
520     }
523 # Check for production of a core file and remove it!
524 remove_core $pid
526 proc thread_test {} {
527     global subdir srcdir testfile srcfile binfile
528     global gdb_prompt old_gdb_prompt
529     global decimal
530     set srcfile watch_thread_num.c
531     set binfile [standard_output_file ${testfile}-watch_thread_num]
532     set gdb_prompt $old_gdb_prompt
534     if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] == "" } {
536         clean_restart $binfile
537         if {![runto_main]} {
538             return
539         }
541         set linenum [gdb_get_line_number "all threads started"]
542         gdb_breakpoint "$linenum"
544         set linenum [gdb_get_line_number "first child thread exited"]
545         gdb_breakpoint "$linenum"
547         set gdb_prompt \
548             "\r\n\032\032pre-prompt\r\n$gdb_prompt \r\n\032\032prompt\r\n"
550         gdb_test_multiple "set annotate 2" "" {
551             -re "set annotate 2\r\n$gdb_prompt$" {
552             }
553         }
555         gdb_test_multiple "continue" "new thread" {
556             -re "\032\032new-thread.*\r\n$gdb_prompt$" {
557                 pass $gdb_test_name
558             }
559         }
561     gdb_test_multiple "continue" "thread exit" {
562             -re "\032\032thread-exited,id=\"${decimal}\",group-id=\"i${decimal}\".*\r\n$gdb_prompt$" {
563                 pass $gdb_test_name
564             }
565     }
566     }
569 proc thread_switch {} {
570     gdb_test_multiple "thread 1" "thread switch" {
571         -re ".*\032\032thread-changed" {
572             pass $gdb_test_name
573         }
574     }
577 thread_test
578 thread_switch
580 # restore the original prompt for the rest of the testsuite
582 set gdb_prompt $old_gdb_prompt