1 # Copyright (C) 2010-2018 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 is part of the GDB testsuite. It tests the mechanism
17 # exposing breakpoints to Python.
19 load_lib gdb-python.exp
23 set options {debug c++}
25 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} ${options}] } {
29 # Skip all tests if Python scripting is not enabled.
30 if { [skip_python_tests] } { continue }
32 proc_with_prefix test_bkpt_basic { } {
33 global srcfile testfile hex decimal
35 # Start with a fresh gdb.
36 clean_restart ${testfile}
38 # We should start with no breakpoints.
39 gdb_test "python print (gdb.breakpoints())" "\\(\\)"
41 if ![runto_main] then {
42 fail "cannot run to main."
46 # Now there should be one breakpoint: main.
47 gdb_py_test_silent_cmd "python blist = gdb.breakpoints()" \
48 "Get Breakpoint List" 0
49 gdb_test "python print (blist\[0\])" \
50 "<gdb.Breakpoint object at $hex>" "Check obj exists @main"
51 gdb_test "python print (blist\[0\].location)" \
52 "main." "Check breakpoint location @main"
53 gdb_test "python print (blist\[0\].pending)" "False" \
54 "Check pending status of main breakpoint"
56 set mult_line [gdb_get_line_number "Break at multiply."]
57 gdb_breakpoint ${mult_line}
58 gdb_continue_to_breakpoint "Break at multiply" \
59 ".*Break at multiply.*"
61 # Check that the Python breakpoint code noted the addition of a
62 # breakpoint "behind the scenes".
63 gdb_py_test_silent_cmd "python blist = gdb.breakpoints()" \
64 "Get Breakpoint List" 0
65 gdb_test "python print (len(blist))" \
66 "2" "Check for two breakpoints"
67 gdb_test "python print (blist\[0\])" \
68 "<gdb.Breakpoint object at $hex>" "Check obj exists @main 2"
69 gdb_test "python print (blist\[0\].location)" \
70 "main." "Check breakpoint location @main 2"
71 gdb_test "python print (blist\[1\])" \
72 "<gdb.Breakpoint object at $hex>" "Check obj exists @mult_line"
74 gdb_test "python print (blist\[1\].location)" \
75 "py-breakpoint\.c:${mult_line}*" \
76 "check breakpoint location @mult_line"
78 # Check hit and ignore counts.
79 gdb_test "python print (blist\[1\].hit_count)" \
80 "1" "Check breakpoint hit count @1"
81 gdb_py_test_silent_cmd "python blist\[1\].ignore_count = 4" \
82 "Set breakpoint hit count" 0
83 gdb_continue_to_breakpoint "Break at multiply @6" \
84 ".*Break at multiply.*"
85 gdb_test "python print (blist\[1\].hit_count)" \
86 "6" "Check breakpoint hit count @6"
87 gdb_test "print result" \
88 " = 545" "Check expected variable result after 6 iterations"
90 # Test breakpoint is enabled and disabled correctly..
91 gdb_breakpoint [gdb_get_line_number "Break at add."]
92 gdb_continue_to_breakpoint "Break at add 1" ".*Break at add.*"
93 gdb_test "python print (blist\[1\].enabled)" \
94 "True" "Check breakpoint enabled."
95 gdb_py_test_silent_cmd "python blist\[1\].enabled = False" \
96 "Set breakpoint disabled." 0
97 gdb_continue_to_breakpoint "Break at add 2" ".*Break at add.*"
98 gdb_py_test_silent_cmd "python blist\[1\].enabled = True" \
99 "Set breakpoint enabled." 0
100 gdb_continue_to_breakpoint "Break at multiply after re-enable" \
101 ".*Break at multiply.*"
103 # Test other getters and setters.
104 gdb_py_test_silent_cmd "python blist = gdb.breakpoints()" \
105 "Get Breakpoint List" 0
106 gdb_test "python print (blist\[1\].thread)" \
107 "None" "Check breakpoint thread"
108 gdb_test "python print (blist\[1\].type == gdb.BP_BREAKPOINT)" \
109 "True" "Check breakpoint type"
110 gdb_test "python print (blist\[0\].number)" \
111 "1" "Check breakpoint number 0"
112 gdb_test "python print (blist\[1\].number)" \
113 "2" "Check breakpoint number 1"
114 gdb_test "python print (blist\[2\].number)" \
115 "3" "Check breakpoint number 2"
118 proc_with_prefix test_bkpt_deletion { } {
119 global srcfile testfile hex decimal
121 # Start with a fresh gdb.
122 clean_restart ${testfile}
124 if ![runto_main] then {
125 fail "cannot run to main."
129 # Test breakpoints are deleted correctly.
130 set deltst_location [gdb_get_line_number "Break at multiply."]
131 set end_location [gdb_get_line_number "Break at end."]
132 gdb_py_test_silent_cmd "python dp1 = gdb.Breakpoint (\"$deltst_location\")" \
134 gdb_breakpoint [gdb_get_line_number "Break at end."]
135 gdb_py_test_silent_cmd "python del_list = gdb.breakpoints()" \
136 "Get Breakpoint List" 0
137 gdb_test "python print (len(del_list))" \
138 "3" "Number of breakpoints before delete"
139 gdb_continue_to_breakpoint "Break at multiply." \
140 ".*$srcfile:$deltst_location.*"
141 gdb_py_test_silent_cmd "python dp1.delete()" \
142 "Delete Breakpoint" 0
143 gdb_test "python print (dp1.number)" \
144 "RuntimeError: Breakpoint 2 is invalid.*" \
145 "Check breakpoint invalidated"
146 gdb_py_test_silent_cmd "python del_list = gdb.breakpoints()" \
147 "Get Breakpoint List" 0
148 gdb_test "python print (len(del_list))" \
149 "2" "Number of breakpoints after delete"
150 gdb_continue_to_breakpoint "Break at end." \
151 ".*$srcfile:$end_location.*"
154 proc_with_prefix test_bkpt_cond_and_cmds { } {
155 global srcfile testfile hex decimal
157 # Start with a fresh gdb.
158 clean_restart ${testfile}
160 if ![runto_main] then {
161 fail "cannot run to main."
165 # Test conditional setting.
166 set bp_location1 [gdb_get_line_number "Break at multiply."]
167 gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (\"$bp_location1\")" \
169 gdb_continue_to_breakpoint "Break at multiply" \
170 ".*Break at multiply.*"
171 gdb_py_test_silent_cmd "python bp1.condition = \"i == 5\"" \
173 gdb_test "python print (bp1.condition)" "i == 5" \
174 "Test conditional has been set"
175 gdb_continue_to_breakpoint "Break at multiply @5" \
176 ".*Break at multiply.*"
178 "5" "Test conditional breakpoint stopped after five iterations"
179 gdb_py_test_silent_cmd "python bp1.condition = None" \
181 gdb_test "python print (bp1.condition)" \
182 "None" "Test conditional read"
183 gdb_continue_to_breakpoint "Break at multiply @6" \
184 ".*Break at multiply.*"
186 "6" "Test breakpoint stopped after six iterations"
189 gdb_breakpoint [gdb_get_line_number "Break at add."]
190 set test {commands $bpnum}
191 gdb_test_multiple $test $test { -re "\r\n>$" { pass $test } }
192 set test {print "Command for breakpoint has been executed."}
193 gdb_test_multiple $test $test { -re "\r\n>$" { pass $test } }
194 set test {print result}
195 gdb_test_multiple $test $test { -re "\r\n>$" { pass $test } }
198 gdb_py_test_silent_cmd "python blist = gdb.breakpoints()" \
199 "Get Breakpoint List" 0
200 gdb_test "python print (blist\[len(blist)-1\].commands)" \
201 "print \"Command for breakpoint has been executed.\".*print result"
204 proc_with_prefix test_bkpt_invisible { } {
205 global srcfile testfile hex decimal
207 # Start with a fresh gdb.
208 clean_restart ${testfile}
210 if ![runto_main] then {
211 fail "cannot run to main."
216 set ibp_location [gdb_get_line_number "Break at multiply."]
217 gdb_py_test_silent_cmd "python ibp = gdb.Breakpoint(\"$ibp_location\", internal=False)" \
218 "Set invisible breakpoint" 0
219 gdb_py_test_silent_cmd "python ilist = gdb.breakpoints()" \
220 "Get Breakpoint List" 0
221 gdb_test "python print (ilist\[0\])" \
222 "<gdb.Breakpoint object at $hex>" "Check invisible bp obj exists 1"
223 gdb_test "python print (ilist\[0\].location)" \
224 "py-breakpoint\.c:$ibp_location*" "Check breakpoint location 1"
225 gdb_test "python print (ilist\[0\].visible)" \
226 "True" "Check breakpoint visibility 1"
227 gdb_test "info breakpoints" "py-breakpoint\.c:$ibp_location.*" \
228 "Check info breakpoints shows visible breakpoints"
230 gdb_py_test_silent_cmd "python ibp = gdb.Breakpoint(\"$ibp_location\", internal=True)" \
231 "Set invisible breakpoint" 0
232 gdb_py_test_silent_cmd "python ilist = gdb.breakpoints()" \
233 "Get Breakpoint List" 0
234 gdb_test "python print (ilist\[0\])" \
235 "<gdb.Breakpoint object at $hex>" "Check invisible bp obj exists 2"
236 gdb_test "python print (ilist\[0\].location)" \
237 "py-breakpoint\.c:$ibp_location*" "Check breakpoint location 2"
238 gdb_test "python print (ilist\[0\].visible)" \
239 "False" "Check breakpoint visibility 2"
240 gdb_test "info breakpoints" "No breakpoints or watchpoints.*" \
241 "Check info breakpoints does not show invisible breakpoints"
242 gdb_test "maint info breakpoints" \
243 "py-breakpoint\.c:$ibp_location.*" \
244 "Check maint info breakpoints shows invisible breakpoints"
247 proc_with_prefix test_watchpoints { } {
248 global srcfile testfile hex decimal
250 # Start with a fresh gdb.
251 clean_restart ${testfile}
253 # Disable hardware watchpoints if necessary.
254 if [target_info exists gdb,no_hardware_watchpoints] {
255 gdb_test_no_output "set can-use-hw-watchpoints 0" ""
258 if ![runto_main] then {
259 fail "cannot run to main."
263 gdb_py_test_silent_cmd "python wp1 = gdb.Breakpoint (\"result\", type=gdb.BP_WATCHPOINT, wp_class=gdb.WP_WRITE )" \
265 gdb_test "python print (wp1.pending)" "False"
266 gdb_test "continue" \
267 ".*\[Ww\]atchpoint.*result.*Old value = 0.*New value = 25.*main.*" \
268 "Test watchpoint write"
271 proc_with_prefix test_bkpt_internal { } {
272 global srcfile testfile hex decimal
274 # Start with a fresh gdb.
275 clean_restart ${testfile}
277 # Disable hardware watchpoints if necessary.
278 if [target_info exists gdb,no_hardware_watchpoints] {
279 gdb_test_no_output "set can-use-hw-watchpoints 0" ""
281 if ![runto_main] then {
282 fail "cannot run to main."
286 gdb_py_test_silent_cmd "python wp1 = gdb.Breakpoint (\"result\", type=gdb.BP_WATCHPOINT, wp_class=gdb.WP_WRITE, internal=True )" \
288 gdb_test "info breakpoints" \
289 "No breakpoints or watchpoints.*" \
290 "Check info breakpoints does not show invisible breakpoints"
291 gdb_test "maint info breakpoints" \
292 ".*watchpoint.*result.*" \
293 "Check maint info breakpoints shows invisible breakpoints"
294 gdb_test "continue" \
295 ".*\[Ww\]atchpoint.*result.*Old value = 0.*New value = 25.*" \
296 "Test watchpoint write"
299 proc_with_prefix test_bkpt_eval_funcs { } {
300 global srcfile testfile hex decimal
302 # Start with a fresh gdb.
303 clean_restart ${testfile}
305 # Disable hardware watchpoints if necessary.
306 if [target_info exists gdb,no_hardware_watchpoints] {
307 gdb_test_no_output "set can-use-hw-watchpoints 0" ""
309 if ![runto_main] then {
310 fail "cannot run to main."
315 gdb_py_test_multiple "Sub-class a breakpoint" \
317 "class bp_eval (gdb.Breakpoint):" "" \
320 " def stop (self):" "" \
321 " self.count = self.count + 1" "" \
322 " self.inf_i = gdb.parse_and_eval(\"i\")" "" \
323 " if self.inf_i == 3:" "" \
328 gdb_py_test_multiple "Sub-class a second breakpoint" \
330 "class bp_also_eval (gdb.Breakpoint):" "" \
332 " def stop (self):" "" \
333 " self.count = self.count + 1" "" \
334 " if self.count == 9:" "" \
339 gdb_py_test_multiple "Sub-class a third breakpoint" \
341 "class basic (gdb.Breakpoint):" "" \
345 set bp_location2 [gdb_get_line_number "Break at multiply."]
346 set end_location [gdb_get_line_number "Break at end."]
347 gdb_py_test_silent_cmd "python eval_bp1 = bp_eval(\"$bp_location2\")" \
349 gdb_py_test_silent_cmd "python also_eval_bp1 = bp_also_eval(\"$bp_location2\")" \
351 gdb_py_test_silent_cmd "python never_eval_bp1 = bp_also_eval(\"$end_location\")" \
353 gdb_continue_to_breakpoint "Break at multiply, i==3" \
354 ".*$srcfile:$bp_location2.*"
356 "3" "Check inferior value matches python accounting"
357 gdb_test "python print (eval_bp1.inf_i)" \
358 "3" "Check python accounting matches inferior"
359 gdb_test "python print (also_eval_bp1.count)" "4" \
360 "Check non firing same-location also_eval_bp1 function was also called at each stop."
361 gdb_test "python print (eval_bp1.count)" "4" \
362 "Check non firing same-location eval_bp1 function was also called at each stop."
365 set cond_bp [gdb_get_line_number "Break at multiply."]
366 gdb_py_test_silent_cmd "python eval_bp1 = bp_eval(\"$cond_bp\")" \
368 set test_cond {cond $bpnum}
369 gdb_test "$test_cond \"foo==3\"" \
370 "Only one stop condition allowed. There is currently a Python.*" \
371 "Check you cannot add a CLI condition to a Python breakpoint that has defined stop"
372 gdb_py_test_silent_cmd "python eval_bp2 = basic(\"$cond_bp\")" \
374 gdb_py_test_silent_cmd "python eval_bp2.condition = \"1==1\"" \
376 gdb_py_test_multiple "Construct an eval function" \
378 "def stop_func ():" "" \
382 gdb_test "python eval_bp2.stop = stop_func" \
383 "RuntimeError: Only one stop condition allowed. There is currently a GDB.*" \
384 "assign stop function to a breakpoint that has a condition"
387 gdb_breakpoint [gdb_get_line_number "Break at multiply."]
388 gdb_py_test_silent_cmd "python check_eval = bp_eval(\"$bp_location2\")" \
390 gdb_test "python print (check_eval.count)" "0" \
391 "Test that evaluate function has not been yet executed (ie count = 0)"
392 gdb_continue_to_breakpoint "Break at multiply, count==1" \
393 ".*$srcfile:$bp_location2.*"
394 gdb_test "python print (check_eval.count)" "1" \
395 "Test that evaluate function is run when location also has normal bp"
397 gdb_py_test_multiple "Sub-class a watchpoint" \
399 "class wp_eval (gdb.Breakpoint):" "" \
400 " def stop (self):" "" \
401 " self.result = gdb.parse_and_eval(\"result\")" "" \
402 " if self.result == 788:" "" \
408 gdb_py_test_silent_cmd "python wp1 = wp_eval (\"result\", type=gdb.BP_WATCHPOINT, wp_class=gdb.WP_WRITE)" \
410 gdb_test "continue" \
411 ".*\[Ww\]atchpoint.*result.*Old value =.*New value = 788.*" \
412 "Test watchpoint write"
413 gdb_test "python print (never_eval_bp1.count)" "0" \
414 "Check that this unrelated breakpoints eval function was never called."
417 proc_with_prefix test_bkpt_temporary { } {
418 global srcfile testfile hex decimal
420 # Start with a fresh gdb.
421 clean_restart ${testfile}
423 if ![runto_main] then {
424 fail "cannot run to main."
429 gdb_py_test_multiple "Sub-class and check temporary breakpoint" \
431 "class temp_bp (gdb.Breakpoint):" "" \
433 " def stop (self):" "" \
434 " self.count = self.count + 1" "" \
437 set ibp_location [gdb_get_line_number "Break at multiply."]
438 gdb_py_test_silent_cmd "python ibp = temp_bp(\"$ibp_location\", temporary=True)" \
439 "Set temporary breakpoint" 0
440 gdb_test "info breakpoints" \
441 "2.*breakpoint.*del.*py-breakpoint\.c:$ibp_location.*" \
442 "Check info breakpoints shows breakpoint with temporary status"
443 gdb_test "python print (ibp.location)" "py-breakpoint\.c:$ibp_location*" \
444 "Check temporary breakpoint location"
445 gdb_test "python print (ibp.temporary)" "True" \
446 "Check breakpoint temporary status"
447 gdb_continue_to_breakpoint "Break at multiply." \
448 ".*$srcfile:$ibp_location.*"
449 gdb_test "python print (ibp.count)" "1" \
450 "Check temporary stop callback executed before deletion."
451 gdb_test "python print (ibp.temporary)" "RuntimeError: Breakpoint 2 is invalid.*" \
452 "Check temporary breakpoint is deleted after being hit"
453 gdb_test "info breakpoints" "No breakpoints or watchpoints.*" \
454 "Check info breakpoints shows temporary breakpoint is deleted"
457 # Test address locations.
459 proc_with_prefix test_bkpt_address {} {
460 global gdb_prompt decimal srcfile
462 # Delete all breakpoints
465 gdb_test "python gdb.Breakpoint(\"*main\")" \
466 ".*Breakpoint ($decimal)+ at .*$srcfile, line ($decimal)+\."
468 gdb_py_test_silent_cmd \
469 "python main_loc = gdb.parse_and_eval(\"main\").address" \
470 "eval address of main" 0
472 # Python 2 vs 3 ... Check `int' first. If that fails, try `long'.
473 gdb_test_multiple "python main_addr = int(main_loc)" "int value of main" {
474 -re "Traceback.*$gdb_prompt $" {
475 gdb_test_no_output "python main_addr = long(main_loc)" \
478 -re "$gdb_prompt $" {
479 pass "int value of main"
483 # Include whitespace in the linespec to double-check proper
484 # grokking of argument to gdb.Breakpoint.
485 gdb_test "python gdb.Breakpoint(\" *{}\".format(str(main_addr)))" \
486 ".*Breakpoint ($decimal)+ at .*$srcfile, line ($decimal)+\."
489 proc_with_prefix test_bkpt_pending {} {
491 gdb_breakpoint "nosuchfunction" allow-pending
492 gdb_test "python print (gdb.breakpoints()\[0\].pending)" "True" \
493 "Check pending status of pending breakpoint"
496 # Helper proc to install an event listener for a given breakpoint
497 # event. NAME is the name of the event to listen for.
498 proc connect_event {name} {
499 set lambda "lambda x: note_event(\"$name\")"
500 gdb_test_no_output "python gdb.events.$name.connect($lambda)" \
501 "install $name event listener"
504 # Helper proc to check that the most recently emitted breakpoint event
506 proc check_last_event {expected} {
507 gdb_test "python print (last_bp_event)" $expected \
508 "check for $expected event"
511 proc_with_prefix test_bkpt_events {} {
514 clean_restart ${testfile}
516 gdb_py_test_multiple "Create event handler" \
518 "def note_event(arg):" "" \
519 " global last_bp_event" "" \
520 " last_bp_event = arg" "" \
522 gdb_test_no_output "python last_bp_event = None"
524 connect_event breakpoint_created
525 connect_event breakpoint_modified
526 connect_event breakpoint_deleted
528 gdb_breakpoint [gdb_get_line_number "Break at add."]
529 check_last_event breakpoint_created
530 gdb_test_no_output "disable 1"
531 check_last_event breakpoint_modified
532 gdb_test_no_output "delete 1"
533 check_last_event breakpoint_deleted
536 proc_with_prefix test_bkpt_explicit_loc {} {
537 global srcfile testfile
539 # Start with a fresh gdb.
540 clean_restart ${testfile}
542 if ![runto_main] then {
543 fail "cannot run to main."
549 set bp_location1 [gdb_get_line_number "Break at multiply."]
550 set bp_location2 [gdb_get_line_number "Break at add."]
552 gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (line=$bp_location1)" \
553 "set explicit breakpoint by line" 0
554 gdb_continue_to_breakpoint "break at multiply for explicit line" \
555 ".*Break at multiply.*"
557 gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (line=\"+1\")" \
558 "set explicit breakpoint by relative line" 0
559 gdb_continue_to_breakpoint "break at add for relative line" \
563 gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (line=\"-1\")" \
564 "set explicit breakpoint by relative negative line" 0
565 gdb_continue_to_breakpoint "break at multiply for negative line" \
566 ".*Break at multiply.*"
569 gdb_test "python bp1 = gdb.Breakpoint (line=bp1)" \
570 "RuntimeError: Line keyword should be an integer or a string.*" \
571 "set explicit breakpoint by invalid line type"
574 gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (function=\"add\")" \
575 "set explicit breakpoint by function" 0
576 gdb_continue_to_breakpoint "break at function add for function" \
577 ".*Break at function add.*"
580 gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (source=\"$srcfile\", function=\"add\")" \
581 "set explicit breakpoint by source file and function" 0
582 gdb_continue_to_breakpoint "break at function add for source and function" \
583 ".*Break at function add.*"
586 gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (source=\"$srcfile\", line=\"$bp_location2\")" \
587 "set explicit breakpoint by source file and line number" 0
588 gdb_continue_to_breakpoint "break at add for source and line" \
592 gdb_py_test_silent_cmd "python bp1 = gdb.Breakpoint (\"-source $srcfile -line $bp_location2\")" \
593 "set explicit breakpoint by source file and line number in spec" 0
594 gdb_continue_to_breakpoint "break at add for source and line in spec" \
598 gdb_test "python bp1 = gdb.Breakpoint (source=\"$srcfile\")" \
599 "RuntimeError: Specifying a source must also include a line, label or function.*" \
600 "set invalid explicit breakpoint by source only"
602 gdb_test "python bp1 = gdb.Breakpoint (source=\"foo.c\", line=\"5\")" \
603 "No source file named foo.*" \
604 "set invalid explicit breakpoint by missing source and line"
605 gdb_test "python bp1 = gdb.Breakpoint (source=\"$srcfile\", line=\"900\")" \
606 "No line 900 in file \"$srcfile\".*" \
607 "set invalid explicit breakpoint by source and invalid line"
608 gdb_test "python bp1 = gdb.Breakpoint (function=\"blah\")" \
609 "Function \"blah\" not defined.*" \
610 "set invalid explicit breakpoint by missing function"
613 proc_with_prefix test_bkpt_qualified {} {
614 global decimal hex testfile
616 # Start with a fresh gdb.
617 clean_restart ${testfile}
619 set one_location_re "Breakpoint $decimal at $hex:.*line $decimal."
620 set two_location_re "Breakpoint $decimal at $hex:.*2 locations."
622 if ![runto_main] then {
623 fail "cannot run to main."
627 # Test the default value of "qualified".
630 "python gdb.Breakpoint(\"multiply\")" \
632 "qualified implicitly false"
634 # Test qualified=False.
637 "python gdb.Breakpoint(\"multiply\", qualified=False)" \
641 # Test qualified=True.
644 "python gdb.Breakpoint(\"multiply\", qualified=True)" \
648 # Test qualified=True with an explicit function.
651 "python gdb.Breakpoint(function=\"multiply\", qualified=True)" \
653 "qualified true and explicit"
655 # Test qualified=False with an explicit function.
658 "python gdb.Breakpoint(function=\"multiply\", qualified=False)" \
660 "qualified false and explicit"
662 # Test -q in the spec string.
665 "python gdb.Breakpoint(\"-q multiply\")" \
669 # Test -q in the spec string with explicit location.
672 "python gdb.Breakpoint(\"-q -function multiply\")" \
674 "-q in spec string with explicit location"
676 # Test -q in the spec string and qualified=False (-q should win).
679 "python gdb.Breakpoint(\"-q multiply\", qualified=False)" \
681 "-q in spec string and qualified false"
686 test_bkpt_cond_and_cmds
695 test_bkpt_explicit_loc