]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.base/annota1.exp
2004-07-13 Andrew Cagney <cagney@gnu.org>
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / annota1.exp
CommitLineData
b475183b
AC
1# Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software
2# Foundation, Inc.
a4cb37cb
SS
3
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 2 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
a4cb37cb
SS
18# This file was written by Elena Zannoni (ezannoni@cygnus.com)
19
20if $tracelevel then {
21 strace $tracelevel
22}
23
24
fc33412a
DT
25# are we on a target board? If so, don't run these tests.
26# note: this is necessary because we cannot use runto_main (which would
27# work for remote targets too) because of the different prompt we get
28# when using annotation level 2.
29#
676a0442 30if [is_remote target] then {
fc33412a
DT
31 return 0
32}
33
34
a4cb37cb
SS
35#
36# test running programs
37#
38set prms_id 0
39set bug_id 0
40
41set testfile "annota1"
42set srcfile ${testfile}.c
43set binfile ${objdir}/${subdir}/${testfile}
44
45if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
46 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
47}
48
49
a4cb37cb
SS
50gdb_exit
51gdb_start
52gdb_reinitialize_dir $srcdir/$subdir
53gdb_load ${binfile}
54
55if [target_info exists gdb_stub] {
56 gdb_step_for_stub;
57}
58
59#
60# the line at which break main will put the breakpoint
61#
085dd6e6 62set main_line 32
a4cb37cb
SS
63
64# The commands we test here produce many lines of output; disable "press
65# <return> to continue" prompts.
66send_gdb "set height 0\n"
67gdb_expect -re "$gdb_prompt $"
68
69#
70# break at main
71#
72gdb_test "break main" \
73 "Breakpoint.*at.* file .*$srcfile, line.*" \
74 "breakpoint main"
75
76
77#
78# NOTE: this prompt is OK only when the annotation level is > 1
79# NOTE: When this prompt is in use the gdb_test procedure cannot be used because
80# it assumes that the last char after the gdb_prompt is a white space. This is not
81# true with this annotated prompt. So we must use send_gdb and gdb_expect.
82#
83
84set old_gdb_prompt $gdb_prompt
85set gdb_prompt "\r\n\032\032pre-prompt\r\n$gdb_prompt \r\n\032\032prompt\r\n"
86
d99968dc
EZ
87#
88# Escape all the characters in the path that need it. For instance
89# the directory name could contain '+'.
90#
91set escapedsrcfile [string_to_regexp ${srcdir}/${subdir}/${srcfile}]
a4cb37cb
SS
92
93
94#
95# set the annotation level to 2
96#
97# of course, this will test:
98# annotate-pre-prompt
99# annotate-prompt
100# annotate-post-prompt (in the next block)
101#
102send_gdb "set annotate 2\n"
103gdb_expect {
104 -re "set annotate 2\r\n$gdb_prompt$" { pass "annotation set at level 2" }
105 -re ".*$gdb_prompt$" { fail "annotation set at level 2" }
106 timeout { fail "annotation set at level 2 (timeout)" }
107 }
108
109
110#
111# info break will test:
112# annotate-breakpoints-headers
113# annotate-field
114# annotate-breakpoints-table
115# annotate-record
116# annotate-breakpoints-table-end
117#
118send_gdb "info break\n"
119gdb_expect {
d99968dc 120 -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$" \
a4cb37cb 121 {pass "breakpoint info"}
d99968dc
EZ
122 -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$" \
123 { setup_xfail "*-*-*" 1270
124 fail "breakpoint info"}
a4cb37cb
SS
125 -re ".*$gdb_prompt$" { fail "breakpoint info" }
126 timeout { fail "breakpoint info (timeout)" }
127}
128
129
130#
131# run to a break point will test:
132# annotate-frames-invalid
133# annotate-breakpoints-invalid (a.k.a. breakpoints-changed)
134# annotate-starting
135# annotate-breakpoint
136# annotate-frame-begin
137# annotate-frame-function-name
138# annotate-frame-args
139# annotate-frame-source-begin
140# annotate-frame-source-file
141# annotate-frame-source-file-end
142# annotate-frame-source-line
143# annotate-frame-source-end
144# annotate-source
145# annotate-frame-end
146# annotate-stopped
147#
392a587b 148#exp_internal 1
a4cb37cb 149send_gdb "run\n"
7346e70f
MS
150gdb_expect {
151 -re "\r\n\032\032post-prompt\r\nStarting program: $binfile \(\r\n\r\n\032\032frames-invalid\)+\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n\032\032breakpoint 1\r\n\r\nBreakpoint 1, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota1.c\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped.*$gdb_prompt$" {
152 pass "run until main breakpoint"
153 }
154 -re ".*$gdb_prompt$" {
155 fail "run until main breakpoint"
156 }
157 timeout {
158 fail "run until main breakpoint (timeout)"
159 }
a4cb37cb 160 }
392a587b
JM
161#exp_internal 0
162#exit 0
a4cb37cb
SS
163
164#
165# Let's do a next, to get to a point where the array is initialized
166# We don't care about the annotated output for this operation, it is the same as
167# the one produced by run above
168#
169send_gdb "next\n"
170gdb_expect {
171 -re ".*$gdb_prompt$" { pass "go after array init line" }
172 timeout { fail "go after array init line (timeout)" }
173}
174
175
176#
177# printing the array will test:
178# annotate-value-history-begin
179# annotate-value-history-value
180# annotate-array-section-begin
181# annotate-elt
182# FIXME: annotate-elt-rep and annotate-elt-rep-end not tested
183# annotate-array-section-end
184# annotate-value-history-end
185# FIXME: annotate-value-begin and annotate-value-end not tested (the gdb output
186# command would cause them to be used)
187#
188send_gdb "print my_array\n"
189gdb_expect {
190 -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$" \
191 { pass "print array" }
192 -re ".*$gdb_prompt$" { fail "print array" }
193 timeout { fail "print array (timeout)" }
194}
195
196
197#
198# this should generate an error message, so to test:
199# annotate-error-begin
200# FIXME: annotate-error not tested
201#
202
203#exp_internal 1
204send_gdb "print non_existent_value\n"
205gdb_expect {
206 -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$" \
207 { pass "print non_existent_value" }
208 -re ".*$gdb_prompt$" { fail "print non_existent_value" }
209 timeout { fail "print non_existent_value (timeout)" }
210}
211
212
213#
214# break at signal handler. So that, once we are in the sig handler, if we do a bt
215# we can test annotate-signal-handler-caller
216#
217send_gdb "break handle_USR1\n"
218gdb_expect {
219 -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-invalid\r\nBreakpoint.*at $hex: file.*$srcfile, line.*\r\n$gdb_prompt$" \
220 { pass "breakpoint handle_USR1" }
221 -re ".*$gdb_prompt$" { fail "break at handle_USR1" }
222 timeout { fail "break at handle_USR1 (timeout)" }
223}
224
225#
226# break at printf. When we are stopped at printf, we can test
227#
228send_gdb "break printf\n"
229gdb_expect {
230 -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-invalid\r\nBreakpoint.*at $hex.*$gdb_prompt$" \
231 { pass "breakpoint printf" }
232 -re ".*$gdb_prompt$" { fail "break printf" }
233 timeout { fail "break printf (timeout)" }
234}
235
236#
237# get to printf
238#
239send_gdb "continue\n"
240gdb_expect {
a0b3c4fd 241 -re "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\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\nprintf\r\n\032\032frame-args\r\n.*\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
a4cb37cb
SS
242 { pass "continue to printf" }
243 -re ".*$gdb_prompt$" { fail "continue to printf" }
244 timeout { fail "continue to printf (timeout)" }
245}
246
247#
248# test:
249# annotate-frame-where
250# annotate-frame-address
251# annotate-frame-address-end
252#
253send_gdb "backtrace\n"
254gdb_expect {
d99968dc 255 -re "\r\n\032\032post-prompt\r\n\r\n\032\032frame-begin 0 $hex\r\n.0 \r\n(\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n)*\032\032frame-function-name\r\nprintf\r\n\032\032frame-args\r\n \\(.*frame-end\r\n\r\n\032\032frame-begin 1 $hex\r\n.1 \r\n\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\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\032frame-end\r\n(\r\n\032\032frame-begin .*\r\n\r\n\032\032frame-end\r\n)*$gdb_prompt$" \
7148ab62 256 { pass "backtrace from shlibrary" }
d99968dc
EZ
257 -re "\r\n\032\032post-prompt\r\n\r\n\032\032frame-begin 0 $hex\r\n.0 \r\n(\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n)*\032\032frame-function-name\r\nprintf\r\n\032\032frame-args\r\n \\(.*frame-end\r\n\r\n\032\032frame-begin 1 $hex\r\n.1 \r\n\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\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\032frame-end\r\n(\r\n\032\032frame-begin .*\r\n\r\n\032\032frame-end\r\n)*$gdb_prompt$" \
258 { setup_xfail "*-*-*" 1270
259 fail "backtrace from shlibrary" }
a4cb37cb
SS
260 -re ".*$gdb_prompt$" { fail "backtrace from shlibrary" }
261 timeout { fail "backtrace from shlibrary (timeout)" }
262}
263
264
265#
266# test printing a frame with some arguments:
267# annotate-arg-begin
268# annotate-arg-name-end
269# annotate-arg-value
270# annotate-arg-end
271#
272send_gdb "signal SIGUSR1\n"
273gdb_expect {
d99968dc 274 -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\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$" \
a4cb37cb 275 { pass "send SIGUSR1" }
d99968dc
EZ
276 -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\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$" \
277 { setup_xfail "*-*-*" 1270
278 fail "send SIGUSR1" }
a4cb37cb
SS
279 -re ".*$gdb_prompt$" { fail "send SIGUSR1" }
280 timeout { fail "send SIGUSR1 (timeout)" }
281}
282
283
284#
285# test:
286# annotate-signal-handler-caller
287#
0f71a2f6
JM
288verbose "match_max local is: [match_max]"
289verbose "match_max default is: [match_max -d]"
290# This is necessary because a 2000 buffer is not enought to get everything
291# up to the prompt ad the test gets a timeout.
292match_max 3000
293verbose "match_max now is: [match_max]"
a4cb37cb
SS
294send_gdb "backtrace\n"
295gdb_expect {
0b915e9c 296 -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$" {
0a791409
MS
297 pass "backtrace @ signal handler"
298 }
299 -re ".*$gdb_prompt$" { fail "backtrace @ signal handler" }
300 timeout { fail "backtrace @ signal handler (timeout)" }
a4cb37cb
SS
301}
302
303#
304# delete all the breakpoints
305#
306send_gdb "delete 1\n"
307gdb_expect {
308 -re "\r\n\032\032post-prompt\r\n$gdb_prompt$" \
309 { pass "delete bp 1" }
310 -re ".*$gdb_prompt$" { fail "delete bp 1" }
311 timeout { fail "delete bp 1 (timeout)" }
312}
313
314send_gdb "delete 2\n"
315gdb_expect {
316 -re "\r\n\032\032post-prompt\r\n$gdb_prompt$" \
317 { pass "delete bp 2" }
318 -re ".*$gdb_prompt$" { fail "delete bp 2 " }
319 timeout { fail "delete bp 2 (timeout)" }
320}
321
322send_gdb "delete 3\n"
323gdb_expect {
324 -re "\r\n\032\032post-prompt\r\n$gdb_prompt$" \
325 { pass "delete bp 3" }
326 -re ".*$gdb_prompt$" { fail "delete bp 3" }
327 timeout { fail "delete bp 3 (timeout)" }
328}
329
330#
331# break at main, after value is initialized. This is in preparation
332# to test the annotate output for the display command.
333#
334send_gdb "break main\n"
335gdb_expect {
d99968dc 336 -re "post-prompt.*\032\032breakpoints-invalid.*Breakpoint 4 at $hex: file ${escapedsrcfile}, line $main_line.*$gdb_prompt$" \
a4cb37cb 337 { pass "break at 28" }
d99968dc
EZ
338 -re "post-prompt.*\032\032breakpoints-invalid.*Breakpoint 4 at $hex: file .*${srcfile}, line $main_line.*$gdb_prompt$" \
339 { setup_xfail "*-*-*" 1270
340 fail "break at 28" }
a4cb37cb
SS
341 -re ".*$gdb_prompt$" { fail "break at 28" }
342 timeout { fail "break at 28 (timeout)" }
343}
344
345#
346# display the value; test:
347# annotate-display-begin
348# annotate-display-number-end
349# annotate-display-format
350# annotate-display-expression
351# annotate-display-expression-end
352# annotate-display-end
353# FIXME: annotate-display-value not tested
354#
355send_gdb "display value\n"
356gdb_expect {
357 -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$" \
358 { pass "set up display" }
359 -re ".*$gdb_prompt$" { fail "set up display" }
360 timeout { fail "set up display (timeout)" }
361}
362
363
364# should ask query. Test annotate-query.
365# we don't care about anything else here, only the query.
366
367send_gdb "run\n"
368gdb_expect {
369 -re "pre-query.*already.*\\(y or n\\).*query\r\n" {
370 send_gdb "y\n"
371 gdb_expect {
372 -re ".*post-query.*$gdb_prompt$" \
373 { pass "re-run" }
374 -re ".*$gdb_prompt$" { fail "re-run" }
375 timeout { fail "re-run (timeout)" }
376 }
377 }
378 -re ".*$gdb_prompt$" { fail "re-run" }
379 timeout { fail "re-run (timeout)" }
380}
381
5c44784c
JM
382#
383# Test that breakpoints-invalid is issued once and only once for
384# breakpoint ignore count changes, after annotation stopped.
385#
386send_gdb "break 46\n"
387gdb_expect {
388 -re "Breakpoint 5 at $hex: file .*$srcfile, line 46.*$gdb_prompt$" {
389 pass "break at 46"
390 }
391 -re ".*$gdb_prompt$" { fail "break at 46" }
392 timeout { fail "break at 46 (timeout)" }
393}
394
395send_gdb "ignore 5 4\n"
396gdb_expect {
397 -re "Will ignore next 4 crossings of breakpoint 5.*$gdb_prompt$" {
398 pass "ignore 5 4"
399 }
400 -re ".*$gdb_prompt$" { fail "ignore 5 4" }
401 timeout { fail "ignore 5 4 (timeout)" }
402}
403
404send_gdb "continue\n"
405gdb_expect {
406 -re ".*$srcfile:46:.*\032\032stopped\r\n\r\n\032\032breakpoints-invalid\r\n$gdb_prompt$" {
407 pass "annotate ignore count change"
408 }
409 -re ".*$gdb_prompt$" { fail "annotate ignore count change" }
410 timeout { fail "annotate ignore count change (timeout)" }
411}
412
413# check that ignore command is working, or the above can provide
414# misleading assurance ...
415
416send_gdb "next\n"
417gdb_expect {
418 -re "$gdb_prompt$" {}
419 timeout { fail "next to exit loop" }
420}
421
422send_gdb "next\n"
423gdb_expect {
424 -re ".*$srcfile:49:.*$gdb_prompt$" {
425 pass "breakpoint ignore count"
426 }
427 -re ".*$gdb_prompt$" { fail "breakpoint ignore count" }
428 timeout { fail "breakpoint ignore count (timeout)" }
429}
a4cb37cb
SS
430
431#
432# Send a signal that is not handled; test:
433# annotate-signalled
434# annotate-signal-name
435# annotate-signal-name-end
436# annotate-signal-string
437# annotate-signal-string-end
438# FIXME: annotate-signal not tested (requires that the inferior be
439# stopped by a "random" signal)
440#
8fb87725
JL
441# SIGTRAP signals are dropped before they get to the inferior process
442# on hpux11. In theory, this behaivor can be controlled by setting
443# TTEO_NORM_SIGTRAP in the inferior, but doing so did not cause
444# the signal to be properly delivered.
445#
446# It has been verified that other signals will be delivered. However,
447# rather than twiddle the test, I choose to leave it as-is as it
448# exposes an interesting failure on hpux11.
449setup_xfail hppa*-*-hpux11*
a4cb37cb
SS
450send_gdb "signal SIGTRAP\n"
451gdb_expect {
11cf8741 452 -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\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\032stopped\r\n$gdb_prompt$" \
a4cb37cb
SS
453 { pass "signal sent" }
454 -re ".*$gdb_prompt$" { fail "signal sent" }
455 timeout { fail "signal sent (timeout)" }
456}
457
458
419e626b 459# Check for production of a core file and remove it!
a4cb37cb
SS
460
461set exec_output [remote_exec build "ls core"]
462
419e626b 463set test "cleanup core file"
a4cb37cb 464if [ regexp "core not found" $exec_output] {
419e626b 465 pass "$test (not dumped)"
a4cb37cb 466} else {
419e626b
AC
467 if [ regexp "No such file or directory" $exec_output] {
468 pass "$test (not dumped)"
469 } else {
470 remote_exec build "rm -f core"
471 pass "$test (removed)"
472 }
a4cb37cb
SS
473}
474
a4cb37cb
SS
475# restore the original prompt for the rest of the testsuite
476
477set gdb_prompt $old_gdb_prompt