]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.guile/scm-breakpoint.exp
gdb/guile: don't try to print location for watchpoints
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.guile / scm-breakpoint.exp
CommitLineData
3666a048 1# Copyright (C) 2010-2021 Free Software Foundation, Inc.
ed3ef339
DE
2#
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.
7#
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.
12#
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/>.
15
16# This file is part of the GDB testsuite.
17# It tests the mechanism exposing breakpoints to Guile.
18
19load_lib gdb-guile.exp
20
21standard_testfile
22
5b362f04 23if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
ed3ef339
DE
24 return -1
25}
26
27# Skip all tests if Guile scripting is not enabled.
28if { [skip_guile_tests] } { continue }
29
a7ed4ea6 30proc_with_prefix test_bkpt_basic { } {
ed3ef339
DE
31 global srcfile testfile hex decimal
32
a7ed4ea6
AB
33 # Start with a fresh gdb.
34 clean_restart ${testfile}
35
36 if ![gdb_guile_runto_main] {
37 return
ed3ef339 38 }
a7ed4ea6
AB
39
40 # Initially there should be one breakpoint: main.
41
42 gdb_scm_test_silent_cmd "guile (define blist (breakpoints))" \
43 "get breakpoint list 1"
44 gdb_test "guile (print (car blist))" \
45 "<gdb:breakpoint #1 BP_BREAKPOINT enabled noisy hit:1 ignore:0 @-qualified main>" \
46 "check main breakpoint"
47 gdb_test "guile (print (breakpoint-location (car blist)))" \
48 "main" "check main breakpoint location"
49
50 set mult_line [gdb_get_line_number "Break at multiply."]
51 gdb_breakpoint ${mult_line}
52 gdb_continue_to_breakpoint "Break at multiply, first time"
53
54 # Check that the Guile breakpoint code noted the addition of a
55 # breakpoint "behind the scenes".
56 gdb_scm_test_silent_cmd "guile (define blist (breakpoints))" \
57 "get breakpoint list 2"
58 gdb_scm_test_silent_cmd "guile (define mult-bkpt (cadr blist))" \
59 "get multiply breakpoint"
60 gdb_test "guile (print (length blist))" \
61 "= 2" "check for two breakpoints"
62 gdb_test "guile (print mult-bkpt)" \
63 "= #<gdb:breakpoint #2 BP_BREAKPOINT enabled noisy hit:1 ignore:0 @.*scm-breakpoint.c:$mult_line>" \
64 "check multiply breakpoint"
65 gdb_test "guile (print (breakpoint-location mult-bkpt))" \
66 "scm-breakpoint\.c:${mult_line}*" \
67 "check multiply breakpoint location"
68
69 # Check hit and ignore counts.
70 gdb_test "guile (print (breakpoint-hit-count mult-bkpt))" \
71 "= 1" "check multiply breakpoint hit count"
72 gdb_scm_test_silent_cmd "guile (set-breakpoint-ignore-count! mult-bkpt 4)" \
73 "set multiply breakpoint ignore count"
74 gdb_continue_to_breakpoint "Break at multiply, second time"
75 gdb_test "guile (print (breakpoint-hit-count mult-bkpt))" \
76 "= 6" "check multiply breakpoint hit count 2"
77 gdb_test "print result" \
78 " = 545" "check expected variable result after 6 iterations"
79
80 # Test breakpoint is enabled and disabled correctly.
81 gdb_breakpoint [gdb_get_line_number "Break at add."]
82 gdb_continue_to_breakpoint "Break at add, first time"
83 gdb_test "guile (print (breakpoint-enabled? mult-bkpt))" \
84 "= #t" "check multiply breakpoint enabled"
85 gdb_scm_test_silent_cmd "guile (set-breakpoint-enabled! mult-bkpt #f)" \
86 "set multiply breakpoint disabled"
87 gdb_continue_to_breakpoint "Break at add, second time"
88 gdb_scm_test_silent_cmd "guile (set-breakpoint-enabled! mult-bkpt #t)" \
89 "set multiply breakpoint enabled"
90 gdb_continue_to_breakpoint "Break at multiply, third time"
91
92 # Test other getters and setters.
93 gdb_scm_test_silent_cmd "guile (define blist (breakpoints))" \
94 "get breakpoint list 3"
95 gdb_test "guile (print (breakpoint-thread mult-bkpt))" \
96 "= #f" "check breakpoint thread"
97 gdb_test "guile (print (= (breakpoint-type mult-bkpt) BP_BREAKPOINT))" \
98 "= #t" "check breakpoint type"
99 gdb_test "guile (print (map breakpoint-number blist))" \
100 "= \\(1 2 3\\)" "check breakpoint numbers"
ed3ef339
DE
101}
102
a7ed4ea6 103proc_with_prefix test_bkpt_deletion { } {
ed3ef339
DE
104 global srcfile testfile hex decimal
105
a7ed4ea6
AB
106 # Start with a fresh gdb.
107 clean_restart ${testfile}
108
109 if ![gdb_guile_runto_main] {
110 return
ed3ef339 111 }
a7ed4ea6
AB
112
113 # Test breakpoints are deleted correctly.
114 set deltst_location [gdb_get_line_number "Break at multiply."]
115 set end_location [gdb_get_line_number "Break at end."]
116 gdb_scm_test_silent_cmd "guile (define dp1 (make-breakpoint \"$deltst_location\"))" \
117 "create deltst breakpoint"
118 gdb_scm_test_silent_cmd "guile (register-breakpoint! dp1)" \
119 "register dp1"
120 gdb_breakpoint [gdb_get_line_number "Break at end."]
121 gdb_scm_test_silent_cmd "guile (define del-list (breakpoints))" \
122 "get breakpoint list 4"
123 gdb_test "guile (print (length del-list))" \
124 "= 3" "number of breakpoints before delete"
125 gdb_continue_to_breakpoint "Break at multiply." \
126 ".*$srcfile:$deltst_location.*"
127 gdb_scm_test_silent_cmd "guile (delete-breakpoint! dp1)" \
128 "delete breakpoint"
129 gdb_test "guile (print (breakpoint-number dp1))" \
130 "ERROR: .*: Invalid object: <gdb:breakpoint> in position 1: #<gdb:breakpoint #-1>.*" \
131 "check breakpoint invalidated"
132 gdb_scm_test_silent_cmd "guile (set! del-list (breakpoints))" \
133 "get breakpoint list 5"
134 gdb_test "guile (print (length del-list))" \
135 "= 2" "number of breakpoints after delete"
136 gdb_continue_to_breakpoint "Break at end." ".*$srcfile:$end_location.*"
ed3ef339
DE
137}
138
a7ed4ea6 139proc_with_prefix test_bkpt_cond_and_cmds { } {
ed3ef339
DE
140 global srcfile testfile hex decimal
141
a7ed4ea6
AB
142 # Start with a fresh gdb.
143 clean_restart ${testfile}
144
145 if ![gdb_guile_runto_main] {
146 return
ed3ef339 147 }
a7ed4ea6
AB
148
149 # Test conditional setting.
150 set bp_location1 [gdb_get_line_number "Break at multiply."]
151 gdb_scm_test_silent_cmd "guile (define bp1 (make-breakpoint \"$bp_location1\"))" \
152 "create multiply breakpoint"
153 gdb_scm_test_silent_cmd "guile (register-breakpoint! bp1)" \
154 "register bp1"
155 gdb_continue_to_breakpoint "Break at multiply, first time"
156 gdb_scm_test_silent_cmd "guile (set-breakpoint-condition! bp1 \"i == 5\")" \
157 "set condition"
158 gdb_test "guile (print (breakpoint-condition bp1))" \
159 "= i == 5" "test condition has been set"
160 gdb_continue_to_breakpoint "Break at multiply, second time"
161 gdb_test "print i" \
162 "5" "test conditional breakpoint stopped after five iterations"
163 gdb_scm_test_silent_cmd "guile (set-breakpoint-condition! bp1 #f)" \
164 "clear condition"
165 gdb_test "guile (print (breakpoint-condition bp1))" \
166 "= #f" "test condition has been removed"
167 gdb_continue_to_breakpoint "Break at multiply, third time"
168 gdb_test "print i" "6" "test breakpoint stopped after six iterations"
169
170 # Test commands.
171 gdb_breakpoint [gdb_get_line_number "Break at add."]
172 set test {commands $bpnum}
173 gdb_test_multiple $test $test { -re "\r\n>$" { pass $test } }
174 set test {print "Command for breakpoint has been executed."}
175 gdb_test_multiple $test $test { -re "\r\n>$" { pass $test } }
176 set test {print result}
177 gdb_test_multiple $test $test { -re "\r\n>$" { pass $test } }
178 gdb_test "end"
179
180 gdb_scm_test_silent_cmd "guile (define blist (breakpoints))" \
181 "get breakpoint list 6"
182 gdb_test "guile (print (breakpoint-commands (list-ref blist (- (length blist) 1))))" \
183 "print \"Command for breakpoint has been executed.\".*print result"
ed3ef339
DE
184}
185
a7ed4ea6 186proc_with_prefix test_bkpt_invisible { } {
ed3ef339
DE
187 global srcfile testfile hex decimal
188
a7ed4ea6
AB
189 # Start with a fresh gdb.
190 clean_restart ${testfile}
191
192 if ![gdb_guile_runto_main] {
193 return
ed3ef339 194 }
a7ed4ea6
AB
195
196 # Test invisible breakpoints.
197 delete_breakpoints
198 set ibp_location [gdb_get_line_number "Break at multiply."]
199 gdb_scm_test_silent_cmd "guile (define vbp1 (make-breakpoint \"$ibp_location\" #:internal #f))" \
200 "create visible breakpoint"
201 gdb_scm_test_silent_cmd "guile (register-breakpoint! vbp1)" \
202 "register vbp1"
203 gdb_scm_test_silent_cmd "guile (define vbp (car (breakpoints)))" \
204 "get visible breakpoint"
205 gdb_test "guile (print vbp)" \
206 "= #<gdb:breakpoint #2 BP_BREAKPOINT enabled noisy hit:0 ignore:0 @.*scm-breakpoint.c:$ibp_location>" \
207 "check visible bp obj exists"
208 gdb_test "guile (print (breakpoint-location vbp))" \
209 "scm-breakpoint\.c:$ibp_location*" "check visible breakpoint location"
210 gdb_test "guile (print (breakpoint-visible? vbp))" \
211 "= #t" "check breakpoint visibility"
212 gdb_test "info breakpoints" \
213 "scm-breakpoint\.c:$ibp_location.*" \
214 "check info breakpoints shows visible breakpoints"
215 delete_breakpoints
216 gdb_scm_test_silent_cmd "guile (define ibp (make-breakpoint \"$ibp_location\" #:internal #t))" \
217 "create invisible breakpoint"
218 gdb_scm_test_silent_cmd "guile (register-breakpoint! ibp)" \
219 "register ibp"
220 gdb_test "guile (print ibp)" \
221 "= #<gdb:breakpoint #-$decimal BP_BREAKPOINT enabled noisy hit:0 ignore:0 @.*scm-breakpoint.c:$ibp_location>" \
222 "check invisible bp obj exists"
223 gdb_test "guile (print (breakpoint-location ibp))" \
224 "scm-breakpoint\.c:$ibp_location*" "check invisible breakpoint location"
225 gdb_test "guile (print (breakpoint-visible? ibp))" \
226 "= #f" "check breakpoint invisibility"
227 gdb_test "info breakpoints" \
228 "No breakpoints or watchpoints.*" \
229 "check info breakpoints does not show invisible breakpoints"
230 gdb_test "maint info breakpoints" \
231 "scm-breakpoint\.c:$ibp_location.*" \
232 "check maint info breakpoints shows invisible breakpoints"
ed3ef339
DE
233}
234
a7ed4ea6 235proc_with_prefix test_watchpoints { } {
ed3ef339
DE
236 global srcfile testfile hex decimal
237
a7ed4ea6
AB
238 # Start with a fresh gdb.
239 clean_restart ${testfile}
240
241 # Disable hardware watchpoints if necessary.
242 if [target_info exists gdb,no_hardware_watchpoints] {
243 gdb_test_no_output "set can-use-hw-watchpoints 0" ""
244 }
245 if ![gdb_guile_runto_main] {
246 return
ed3ef339 247 }
a7ed4ea6
AB
248
249 gdb_scm_test_silent_cmd "guile (define wp1 (make-breakpoint \"result\" #:type BP_WATCHPOINT #:wp-class WP_WRITE))" \
250 "create watchpoint"
0618ecf6
AB
251 gdb_test "guile (display wp1) (newline)" "#<gdb:breakpoint #-1>" \
252 "print watchpoint before registering"
a7ed4ea6
AB
253 gdb_scm_test_silent_cmd "guile (register-breakpoint! wp1)" \
254 "register wp1"
0618ecf6
AB
255 gdb_test "guile (display wp1) (newline)" \
256 "#<gdb:breakpoint #${decimal} BP_(?:HARDWARE_)?WATCHPOINT enabled noisy hit:0 ignore:0>" \
257 "print watchpoint after registering"
a7ed4ea6
AB
258 gdb_test "continue" \
259 ".*\[Ww\]atchpoint.*result.*Old value = 0.*New value = 25.*main.*" \
260 "test watchpoint write"
ed3ef339
DE
261}
262
a7ed4ea6 263proc_with_prefix test_bkpt_internal { } {
ed3ef339
DE
264 global srcfile testfile hex decimal
265
a7ed4ea6
AB
266 # Start with a fresh gdb.
267 clean_restart ${testfile}
268
269 # Disable hardware watchpoints if necessary.
270 if [target_info exists gdb,no_hardware_watchpoints] {
271 gdb_test_no_output "set can-use-hw-watchpoints 0" ""
ed3ef339 272 }
a7ed4ea6
AB
273 if ![gdb_guile_runto_main] {
274 return
275 }
276
277 delete_breakpoints
278
279 gdb_scm_test_silent_cmd "guile (define wp1 (make-breakpoint \"result\" #:type BP_WATCHPOINT #:wp-class WP_WRITE #:internal #t))" \
280 "create invisible watchpoint"
281 gdb_scm_test_silent_cmd "guile (register-breakpoint! wp1)" \
282 "register wp1"
283 gdb_test "info breakpoints" \
284 "No breakpoints or watchpoints.*" \
285 "check info breakpoints does not show invisible watchpoint"
286 gdb_test "maint info breakpoints" \
287 ".*watchpoint.*result.*" \
288 "check maint info breakpoints shows invisible watchpoint"
289 gdb_test "continue" \
290 ".*\[Ww\]atchpoint.*result.*Old value = 0.*New value = 25.*" \
291 "test invisible watchpoint write"
ed3ef339
DE
292}
293
a7ed4ea6 294proc_with_prefix test_bkpt_eval_funcs { } {
ed3ef339
DE
295 global srcfile testfile hex decimal
296
a7ed4ea6
AB
297 # Start with a fresh gdb.
298 clean_restart ${testfile}
299
300 # Disable hardware watchpoints if necessary.
301 if [target_info exists gdb,no_hardware_watchpoints] {
302 gdb_test_no_output "set can-use-hw-watchpoints 0" ""
ed3ef339 303 }
a7ed4ea6
AB
304 if ![gdb_guile_runto_main] {
305 return
306 }
307
308 delete_breakpoints
309
310 # Define create-breakpoint! as a convenient wrapper around
311 # make-breakpoint, register-breakpoint!
312 gdb_test_no_output "guile (define (create-breakpoint! . args) (let ((bp (apply make-breakpoint args))) (register-breakpoint! bp) bp))" \
313 "define create-breakpoint!"
314
315 gdb_test_multiline "data collection breakpoint 1" \
316 "guile" "" \
317 "(define (make-bp-data) (cons 0 0))" "" \
318 "(define bp-data-count car)" "" \
319 "(define set-bp-data-count! set-car!)" "" \
320 "(define bp-data-inf-i cdr)" "" \
321 "(define set-bp-data-inf-i! set-cdr!)" "" \
322 "(define (bp-eval-count bkpt) (bp-data-count (object-property bkpt 'bp-data)))" "" \
323 "(define (bp-eval-inf-i bkpt) (bp-data-inf-i (object-property bkpt 'bp-data)))" "" \
324 "(define (make-bp-eval location)" "" \
325 " (let ((bp (create-breakpoint! location)))" "" \
326 " (set-object-property! bp 'bp-data (make-bp-data))" "" \
327 " (set-breakpoint-stop! bp" "" \
328 " (lambda (bkpt)" "" \
329 " (let ((data (object-property bkpt 'bp-data))" "" \
330 " (inf-i (parse-and-eval \"i\")))" "" \
331 " (set-bp-data-count! data (+ (bp-data-count data) 1))" "" \
332 " (set-bp-data-inf-i! data inf-i)" "" \
333 " (value=? inf-i 3))))" "" \
334 " bp))" "" \
335 "end" ""
336
337 gdb_test_multiline "data collection breakpoint 2" \
338 "guile" "" \
339 "(define (make-bp-also-eval location)" "" \
340 " (let ((bp (create-breakpoint! location)))" "" \
341 " (set-object-property! bp 'bp-data (make-bp-data))" "" \
342 " (set-breakpoint-stop! bp" "" \
343 " (lambda (bkpt)" "" \
344 " (let* ((data (object-property bkpt 'bp-data))" "" \
345 " (count (+ (bp-data-count data) 1)))" "" \
346 " (set-bp-data-count! data count)" "" \
347 " (= count 9))))" "" \
348 " bp))" "" \
349 "end" ""
350
351 gdb_test_multiline "data collection breakpoint 3" \
352 "guile" "" \
353 "(define (make-bp-basic location)" "" \
354 " (let ((bp (create-breakpoint! location)))" "" \
355 " (set-object-property! bp 'bp-data (make-bp-data))" "" \
356 " bp))" "" \
357 "end" ""
358
359 set bp_location2 [gdb_get_line_number "Break at multiply."]
360 set end_location [gdb_get_line_number "Break at end."]
361 gdb_scm_test_silent_cmd "guile (define eval-bp1 (make-bp-eval \"$bp_location2\"))" \
362 "create eval-bp1 breakpoint"
363 gdb_scm_test_silent_cmd "guile (define also-eval-bp1 (make-bp-also-eval \"$bp_location2\"))" \
364 "create also-eval-bp1 breakpoint"
365 gdb_scm_test_silent_cmd "guile (define never-eval-bp1 (make-bp-also-eval \"$end_location\"))" \
366 "create never-eval-bp1 breakpoint"
367 gdb_continue_to_breakpoint "Break at multiply, first time" \
368 ".*$srcfile:$bp_location2.*"
369 gdb_test "print i" "3" "check inferior value matches guile accounting"
370 gdb_test "guile (print (bp-eval-inf-i eval-bp1))" \
371 "= 3" "check guile accounting matches inferior"
372 gdb_test "guile (print (bp-eval-count also-eval-bp1))" \
373 "= 4" \
374 "check non firing same-location breakpoint eval function was also called at each stop 1"
375 gdb_test "guile (print (bp-eval-count eval-bp1))" \
376 "= 4" \
377 "check non firing same-location breakpoint eval function was also called at each stop 2"
378
379 # Check we cannot assign a condition to a breakpoint with a stop-func,
380 # and cannot assign a stop-func to a breakpoint with a condition.
381
382 delete_breakpoints
383 set cond_bp [gdb_get_line_number "Break at multiply."]
384 gdb_scm_test_silent_cmd "guile (define eval-bp1 (make-bp-eval \"$cond_bp\"))" \
385 "create eval-bp1 breakpoint 2"
386 set test_cond {cond $bpnum}
387 gdb_test "$test_cond \"foo==3\"" \
388 "Only one stop condition allowed.*"
389 gdb_scm_test_silent_cmd "guile (define eval-bp2 (make-bp-basic \"$cond_bp\"))" \
390 "create basic breakpoint"
391 gdb_scm_test_silent_cmd "guile (set-breakpoint-condition! eval-bp2 \"1==1\")" \
392 "set a condition"
393 gdb_test_multiline "construct an eval function" \
394 "guile" "" \
395 "(define (stop-func bkpt)" "" \
396 " return #t)" "" \
397 "end" ""
398 gdb_test "guile (set-breakpoint-stop! eval-bp2 stop-func)" \
399 "Only one stop condition allowed.*"
400
401 # Check that stop-func is run when location has normal bp.
402
403 delete_breakpoints
404 gdb_breakpoint [gdb_get_line_number "Break at multiply."]
405 gdb_scm_test_silent_cmd "guile (define check-eval (make-bp-eval \"$bp_location2\"))" \
406 "create check-eval breakpoint"
407 gdb_test "guile (print (bp-eval-count check-eval))" \
408 "= 0" \
409 "test that evaluate function has not been yet executed (ie count = 0)"
410 gdb_continue_to_breakpoint "Break at multiply, second time" \
411 ".*$srcfile:$bp_location2.*"
412 gdb_test "guile (print (bp-eval-count check-eval))" \
413 "= 1" \
414 "test that evaluate function is run when location also has normal bp"
415
416 # Test watchpoints with stop-func.
417
418 gdb_test_multiline "watchpoint stop func" \
419 "guile" "" \
420 "(define (make-wp-eval location)" "" \
421 " (let ((wp (create-breakpoint! location #:type BP_WATCHPOINT #:wp-class WP_WRITE)))" "" \
422 " (set-breakpoint-stop! wp" "" \
423 " (lambda (bkpt)" "" \
424 " (let ((result (parse-and-eval \"result\")))" "" \
425 " (value=? result 788))))" "" \
426 " wp))" "" \
427 "end" ""
428
429 delete_breakpoints
430 gdb_scm_test_silent_cmd "guile (define wp1 (make-wp-eval \"result\"))" \
431 "create watchpoint"
432 gdb_test "continue" ".*\[Ww\]atchpoint.*result.*Old value =.*New value = 788.*" \
433 "test watchpoint write"
434
435 # Misc final tests.
436
437 gdb_test "guile (print (bp-eval-count never-eval-bp1))" \
438 "= 0" \
439 "check that this unrelated breakpoints eval function was never called"
ed3ef339
DE
440}
441
a7ed4ea6 442proc_with_prefix test_bkpt_registration {} {
16f691fb
DE
443 global srcfile testfile
444
a7ed4ea6
AB
445 # Start with a fresh gdb.
446 clean_restart ${testfile}
447
448 if ![gdb_guile_runto_main] {
449 return
16f691fb 450 }
a7ed4ea6
AB
451
452 # Initially there should be one breakpoint: main.
453 gdb_scm_test_silent_cmd "guile (define blist (breakpoints))" \
454 "get breakpoint list 1"
455 gdb_test "guile (register-breakpoint! (car blist))" \
456 "ERROR: .*: not a Scheme breakpoint.*" \
457 "try to register a non-guile breakpoint"
458
459 set bp_location1 [gdb_get_line_number "Break at multiply."]
460 gdb_scm_test_silent_cmd "guile (define bp1 (make-breakpoint \"$bp_location1\"))" \
461 "create multiply breakpoint"
462 gdb_test "guile (print (breakpoint-valid? bp1))" \
463 "= #f" "breakpoint invalid after creation"
464 gdb_scm_test_silent_cmd "guile (register-breakpoint! bp1)" \
465 "register bp1"
466 gdb_test "guile (print (breakpoint-valid? bp1))" \
467 "= #t" "breakpoint valid after registration"
468 gdb_test "guile (register-breakpoint! bp1)" \
469 "ERROR: .*: breakpoint is already registered.*" \
470 "re-register already registered bp1"
471 gdb_scm_test_silent_cmd "guile (delete-breakpoint! bp1)" \
472 "delete registered breakpoint"
473 gdb_test "guile (print (breakpoint-valid? bp1))" \
474 "= #f" "breakpoint invalid after deletion"
475 gdb_scm_test_silent_cmd "guile (register-breakpoint! bp1)" \
476 "re-register bp1"
477 gdb_test "guile (print (breakpoint-valid? bp1))" \
478 "= #t" "breakpoint valid after re-registration"
16f691fb
DE
479}
480
a7ed4ea6 481proc_with_prefix test_bkpt_address {} {
a96e36da
KS
482 global decimal srcfile
483
484 # Leading whitespace is intentional!
485 gdb_scm_test_silent_cmd \
486 "guile (define bp1 (make-breakpoint \" *multiply\"))" \
487 "create address breakpoint a ' *multiply'" 1
488
489 gdb_test "guile (register-breakpoint! bp1)" \
490 ".*Breakpoint ($decimal)+ at .*$srcfile, line ($decimal)+\."
491}
492
a7ed4ea6 493proc_with_prefix test_bkpt_probe {} {
bac7c5cf
GB
494 global decimal hex testfile srcfile
495
496 if { [prepare_for_testing "failed to prepare" ${testfile}-probes \
497 ${srcfile} {additional_flags=-DUSE_PROBES}] } {
498 return -1
499 }
500
501 if ![gdb_guile_runto_main] then {
502 return
503 }
504
505 gdb_scm_test_silent_cmd \
506 "guile (define bp1 (make-breakpoint \"-probe test:result_updated\"))" \
507 "create probe breakpoint"
508
509 gdb_test \
510 "guile (register-breakpoint! bp1)" \
511 "Breakpoint $decimal at $hex" \
512 "register probe breakpoint"
513}
514
ed3ef339
DE
515test_bkpt_basic
516test_bkpt_deletion
517test_bkpt_cond_and_cmds
518test_bkpt_invisible
519test_watchpoints
520test_bkpt_internal
521test_bkpt_eval_funcs
16f691fb 522test_bkpt_registration
a96e36da 523test_bkpt_address
bac7c5cf 524test_bkpt_probe