1 # Copyright 1988-2016 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/>.
17 # test special commands (if, while, etc)
22 if { [prepare_for_testing commands.exp commands run.c {debug additional_flags=-DFAKEARGV}] } {
26 proc gdbvar_simple_if_test {} {
29 gdb_test_no_output "set \$foo = 0" "set foo in gdbvar_simple_if_test"
30 # All this test should do is print 0xdeadbeef once.
31 gdb_test "if \$foo == 1\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" \
32 "\\\$\[0-9\]* = 0xdeadbeef" "gdbvar_simple_if_test #1"
33 # All this test should do is print 0xfeedface once.
34 gdb_test "if \$foo == 0\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" \
35 "\\\$\[0-9\]* = 0xfeedface" "gdbvar_simple_if_test #2"
38 proc gdbvar_simple_while_test {} {
41 gdb_test_no_output "set \$foo = 5" "set foo in gdbvar_simple_while_test"
42 # This test should print 0xfeedface five times.
43 gdb_test "while \$foo > 0\np/x 0xfeedface\nset \$foo -= 1\nend" \
44 "\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" \
45 "gdbvar_simple_while_test #1"
48 proc gdbvar_complex_if_while_test {} {
51 gdb_test_no_output "set \$foo = 4" \
52 "set foo in gdbvar complex_if_while_test"
53 # This test should alternate between 0xdeadbeef and 0xfeedface two times.
54 gdb_test "while \$foo > 0\nset \$foo -= 1\nif \(\$foo % 2\) == 1\np/x 0xdeadbeef\nelse\np/x 0xfeedface\nend\nend" \
55 "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" \
56 "gdbvar_complex_if_while_test #1"
59 proc progvar_simple_if_test {} {
62 if { ![runto factorial] } then { gdb_suppress_tests; }
63 # Don't depend upon argument passing, since most simulators don't
64 # currently support it. Bash value variable to be what we want.
65 gdb_test "p value=5" ".*" "set value to 5 in progvar_simple_if_test #1"
66 # All this test should do is print 0xdeadbeef once.
67 gdb_test "if value == 1\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" \
68 "\\\$\[0-9\]* = 0xdeadbeef" \
69 "progvar_simple_if_test #1"
70 # All this test should do is print 0xfeedface once.
71 gdb_test "if value == 5\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" \
72 "\\\$\[0-9\]* = 0xfeedface" \
73 "progvar_simple_if_test #2"
74 gdb_stop_suppressing_tests
77 proc progvar_simple_while_test {} {
80 if { ![runto factorial] } then { gdb_suppress_tests }
81 # Don't depend upon argument passing, since most simulators don't
82 # currently support it. Bash value variable to be what we want.
83 gdb_test "p value=5" ".*" "set value to 5 in progvar_simple_if_test #2"
84 # This test should print 0xfeedface five times.
85 gdb_test "while value > 0\np/x 0xfeedface\nset value -= 1\nend" \
86 "\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" \
87 "progvar_simple_while_test #1"
88 gdb_stop_suppressing_tests
91 proc progvar_complex_if_while_test {} {
94 if { ![runto factorial] } then { gdb_suppress_tests }
95 # Don't depend upon argument passing, since most simulators don't
96 # currently support it. Bash value variable to be what we want.
97 gdb_test "p value=4" ".*" "set value to 4 in progvar_simple_if_test"
98 # This test should alternate between 0xdeadbeef and 0xfeedface two times.
99 gdb_test "while value > 0\nset value -= 1\nif \(value % 2\) == 1\np/x 0xdeadbeef\nelse\np/x 0xfeedface\nend\nend" \
100 "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" \
101 "progvar_complex_if_while_test #1"
102 gdb_stop_suppressing_tests
105 proc if_while_breakpoint_command_test {} {
107 if { ![runto factorial] } then { gdb_suppress_tests }
108 # Don't depend upon argument passing, since most simulators don't
109 # currently support it. Bash value variable to be what we want.
110 gdb_test "p value=5" ".*" "set value to 5 in progvar_simple_if_test"
112 gdb_test "break factorial" "Breakpoint.*at.*" "break factorial #1"
114 gdb_test_multiple "commands" \
115 "commands in if_while_breakpoint_command_test" {
117 pass "commands in if_while_breakpoint_command_test"
121 # This test should alternate between 0xdeadbeef and 0xfeedface two times.
122 gdb_test "while value > 0\nset value -= 1\nif \(value % 2\) == 1\np/x 0xdeadbeef\nelse\np/x 0xfeedface\nend\nend\nend" \
124 "commands part 2 in if_while_breakpoint_command_test"
125 gdb_test "continue" \
126 "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" \
127 "if_while_breakpoint_command_test #1"
128 gdb_test "info break" \
129 "while.*set.*if.*p/x.*else.*p/x.*end.*" \
130 "info break in if_while_breakpoint_command_test"
131 gdb_stop_suppressing_tests
134 # Test that we can run the inferior from breakpoint commands.
136 # The expected behavior is that all commands after the first "step"
137 # shall be ignored. See the gdb manual, "Break Commands",
138 # subsection "Breakpoint command lists".
140 proc infrun_breakpoint_command_test {} {
142 if { ![runto factorial] } then { gdb_suppress_tests }
143 # Don't depend upon argument passing, since most simulators don't
144 # currently support it. Bash value variable to be what we want.
145 gdb_test "p value=6" ".*" "set value to 6 in progvar_simple_if_test #1"
147 gdb_test "break factorial if value == 5" "Breakpoint.*at.*"
149 # infrun_breakpoint_command_test - This test was broken into two parts
150 # to get around a synchronization problem in expect.
151 # part1: issue the gdb command "commands"
152 # part2: send the list of commands
153 gdb_test_multiple "commands" \
154 "commands in infrun_breakpoint_command_test #1" {
156 pass "commands in infrun_breakpoint_command_test #1"
159 gdb_test "step\nstep\nstep\nstep\nend" "" \
160 "commands in infrun_breakpoint_command_test #2"
162 gdb_test "continue" \
163 "Continuing.*.*.*Breakpoint \[0-9\]*, factorial \\(value=5\\).*at.*\[0-9\]*\[ \]*if \\(value > 1\\) \{.*\[0-9\]*\[ \]*value \\*= factorial \\(value - 1\\);.*" \
164 "continue in infrun_breakpoint_command_test"
166 gdb_stop_suppressing_tests
169 proc breakpoint_command_test {} {
171 if { ![runto factorial] } then { gdb_suppress_tests; }
172 # Don't depend upon argument passing, since most simulators don't
173 # currently support it. Bash value variable to be what we want.
174 gdb_test "p value=6" ".*" "set value to 6 in progvar_simple_if_test #2"
176 gdb_test "break factorial" "Breakpoint.*at.*" "break factorial #2"
177 gdb_test "commands\nprintf \"Now the value is %d\\n\", value\nend" \
178 "End with.*" "commands in breakpoint_command_test"
179 gdb_test "continue" \
180 "Breakpoint \[0-9\]*, factorial.*Now the value is 5" \
181 "continue in breakpoint_command_test"
182 gdb_test "print value" " = 5" "print value in breakpoint_command_test"
183 gdb_stop_suppressing_tests
186 # Test a simple user defined command (with arguments)
187 proc user_defined_command_test {} {
190 gdb_test_no_output "set \$foo = 4" \
191 "set foo in user_defined_command_test"
193 gdb_test_multiple "define mycommand" \
194 "define mycommand in user_defined_command_test" {
196 pass "define mycommand in user_defined_command_test"
200 # This test should alternate between 0xdeadbeef and 0xfeedface two times.
201 gdb_test "while \$arg0 > 0\nset \$arg0 -= 1\nif \(\$arg0 % 2\) == 1\np/x 0xdeadbeef\nelse\np/x 0xfeedface\nend\nend\nend" \
203 "enter commands in user_defined_command_test"
205 gdb_test "mycommand \$foo" \
206 "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" \
207 "execute user defined command in user_defined_command_test"
208 gdb_test "show user mycommand" \
209 " while \\\$arg0.*set.* if \\\(\\\$arg0.*p/x.* else\[^\n\].*p/x.* end\[^\n\].* end\[^\n\].*" \
210 "display user command in user_defined_command_test"
212 # Create and test a user-defined command with an empty body.
213 gdb_test_multiple "define myemptycommand" \
214 "define myemptycommand in user_defined_command_test" {
216 pass "define myemptycommand in user_defined_command_test"
221 "end definition of user-defined command with empty body"
223 gdb_test_no_output "myemptycommand" \
224 "execute user-defined empty command in user_defined_command_test"
226 gdb_test "show user" \
227 "User command \"myemptycommand.*" \
228 "display empty command in command list in user_defined_command_test"
230 gdb_test "show user myemptycommand" \
231 "User command \"myemptycommand.*" \
232 "display user-defined empty command in user_defined_command_test"
235 proc watchpoint_command_test {} {
238 # Disable hardware watchpoints if necessary.
239 if [target_info exists gdb,no_hardware_watchpoints] {
240 gdb_test_no_output "set can-use-hw-watchpoints 0" ""
243 if { ![runto factorial] } then { return }
246 # Verify that we can create a watchpoint, and give it a commands
247 # list that continues the inferior. We set the watchpoint on a
248 # local variable, too, so that it self-deletes when the watched
249 # data goes out of scope.
251 # What should happen is: Each time the watchpoint triggers, it
252 # continues the inferior. Eventually, the watchpoint will self-
253 # delete, when the watched variable is out of scope. But by that
254 # time, the inferior should have exited. GDB shouldn't crash or
255 # anything untoward as a result of this.
259 gdb_test_multiple "watch local_var" "watch local_var" {
260 -re "\[Ww\]atchpoint (\[0-9\]*): local_var.*$gdb_prompt $" {
261 set wp_id $expect_out(1,string)
262 pass "watch local_var"
266 if {$wp_id == -1} {return}
268 gdb_test_multiple "commands $wp_id" "begin commands on watch" {
269 -re "Type commands for breakpoint.*, one per line.*>$" {
270 pass "begin commands on watch"
273 # See the 'No symbol "value...' fail below. This command will
274 # fail if it's executed in the wrong frame. If adjusting the
275 # test, make sure this property holds.
276 gdb_test_multiple "print value" "add print command to watch" {
278 pass "add print command to watch"
281 gdb_test_multiple "continue" "add continue command to watch" {
283 pass "add continue command to watch"
288 "end commands on watch"
290 set test "continue with watch"
291 set lno_1 [gdb_get_line_number "commands.exp: hw local_var out of scope" "run.c"]
292 set lno_2 [gdb_get_line_number "commands.exp: local_var out of scope" "run.c"]
293 gdb_test_multiple "continue" "$test" {
294 -re "No symbol \"value\" in current context.\r\n$gdb_prompt $" {
295 # Happens if GDB actually runs the watchpoints commands,
296 # even though the watchpoint was deleted for not being in
300 -re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:($lno_1|$lno_2).*$gdb_prompt $" {
306 proc test_command_prompt_position {} {
309 if { ![runto factorial] } then { gdb_suppress_tests; }
310 # Don't depend upon argument passing, since most simulators don't
311 # currently support it. Bash value variable to be what we want.
313 gdb_test "break factorial" "Breakpoint.*at.*" "break factorial #3"
314 gdb_test "p value=5" ".*" "set value to 5 in test_command_prompt_position"
315 # All this test should do is print 0xdeadbeef once.
316 gdb_test "if value == 1\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" \
317 "\\\$\[0-9\]* = 0xdeadbeef" \
318 "if test in test_command_prompt_position"
320 # Now let's test for the correct position of the '>' in gdb's
321 # prompt for commands. It should be at the beginning of the line,
322 # and not after one space.
324 send_gdb "commands\n"
326 -re "Type commands.*End with.*\[\r\n\]>$" {
327 send_gdb "printf \"Now the value is %d\\n\", value\n"
329 -re "^printf.*value\r\n>$" {
332 -re "^end\r\n$gdb_prompt $" {
333 pass "> OK in test_command_prompt_position"
335 -re ".*$gdb_prompt $" {
336 fail "some other message in test_command_prompt_position"
339 fail "(timeout) 1 in test_command_prompt_position"
343 -re "^ >$" { fail "> not OK in test_command_prompt_position" }
344 -re ".*$gdb_prompt $" {
345 fail "wrong message in test_command_prompt_position"
348 fail "(timeout) 2 in test_command_prompt_position "
352 -re "Type commands.*End with.*\[\r\n\] >$" {
353 fail "prompt not OK in test_command_prompt_position"
355 -re ".*$gdb_prompt $" {
356 fail "commands in test_command_prompt_position"
358 timeout { fail "(timeout) 3 commands in test_command_prompt_position" }
361 gdb_stop_suppressing_tests
366 proc deprecated_command_test {} {
367 gdb_test "maintenance deprecate blah" "Can't find command.*" \
368 "tried to deprecate non-existing command"
370 gdb_test_no_output "maintenance deprecate p \"new_p\"" "maintenance deprecate p \"new_p\" /1/"
372 "Warning: 'p', an alias for the command 'print' is deprecated.*Use 'new_p'.*" \
373 "p deprecated warning, with replacement"
374 gdb_test "p 5" ".\[0-9\]* = 5.*" "Deprecated warning goes away /1/"
376 gdb_test_no_output "maintenance deprecate p \"new_p\"" "maintenance deprecate p \"new_p\" /2/"
377 gdb_test_no_output "maintenance deprecate print \"new_print\""
379 "Warning: command 'print' \\(p\\) is deprecated.*Use 'new_print'.*" \
380 "both alias and command are deprecated"
381 gdb_test "p 5" ".\[0-9\]* = 5.*" "Deprecated warning goes away /2/"
383 gdb_test_no_output "maintenance deprecate set remote memory-read-packet-size \"srm\" " \
384 "deprecate long command /1/"
385 gdb_test "set remote memory-read-packet-size" \
386 "Warning: command 'set remote memory-read-packet-size' is deprecated.*Use 'srm'.*" \
387 "long command deprecated /1/"
389 gdb_test_no_output "maintenance deprecate set remote memory-read-packet-size" \
390 "deprecate long command /2/"
391 gdb_test "set remote memory-read-packet-size" \
392 "Warning: command 'set remote memory-read-packet-size' is deprecated.*No alternative known.*" \
393 "long command deprecated with no alternative /2/"
395 gdb_test "maintenance deprecate" \
396 "\"maintenance deprecate\".*" \
397 "deprecate with no arguments"
400 proc bp_deleted_in_command_test {} {
405 # Create a breakpoint, and associate a command-list to it, with
406 # one command that deletes this breakpoint.
407 gdb_test "break factorial" \
408 "Breakpoint \[0-9\]+ at .*: file .*run.c, line \[0-9\]+\." \
409 "breakpoint in bp_deleted_in_command_test"
411 gdb_test_multiple "commands" "begin commands in bp_deleted_in_command_test" {
412 -re "Type commands for breakpoint.*>$" {
413 pass "begin commands in bp_deleted_in_command_test"
416 gdb_test_multiple "silent" "add silent command" {
418 pass "add silent command"
421 gdb_test_multiple "clear factorial" "add clear command" {
423 pass "add clear command"
426 gdb_test_multiple "printf \"factorial command-list executed\\n\"" \
427 "add printf command" {
429 pass "add printf command"
432 gdb_test_multiple "cont" "add cont command" {
434 pass "add cont command"
442 gdb_test "" "factorial command-list executed.*" "run factorial until breakpoint"
445 proc temporary_breakpoint_commands {} {
450 # Create a temporary breakpoint, and associate a commands list to it.
451 # This test will verify that this commands list is executed when the
453 gdb_test "tbreak factorial" \
454 "Temporary breakpoint \[0-9\]+ at .*: file .*run.c, line \[0-9\]+\." \
455 "breakpoint in temporary_breakpoint_commands"
457 gdb_test_multiple "commands" \
458 "begin commands in bp_deleted_in_command_test" {
459 -re "Type commands for breakpoint.*>$" {
460 pass "begin commands in bp_deleted_in_command_test"
463 gdb_test_multiple "silent" "add silent tbreak command" {
465 pass "add silent tbreak command"
468 gdb_test_multiple "printf \"factorial tbreak commands executed\\n\"" \
469 "add printf tbreak command" {
471 pass "add printf tbreak command"
474 gdb_test_multiple "cont" "add cont tbreak command" {
476 pass "add cont tbreak command"
481 "end tbreak commands"
484 gdb_test "" "factorial tbreak commands executed.*" \
485 "run factorial until temporary breakpoint"
488 # Test that GDB can handle $arg0 outside of user functions without
490 proc stray_arg0_test { } {
491 gdb_test "print \$arg0" \
492 "\\\$\[0-9\]* = void" \
495 gdb_test "if 1 == 1\nprint \$arg0\nend" \
496 "\\\$\[0-9\]* = void" \
499 gdb_test "print \$arg0 = 1" \
503 gdb_test "print \$arg0" \
508 # Test that GDB is able to source a file with an indented comment.
509 proc source_file_with_indented_comment {} {
510 set file1 [standard_output_file file1]
512 set fd [open "$file1" w]
520 gdb_test "source $file1" "Done!" "source file with indented comment"
523 # Test that GDB can handle arguments when sourcing files recursively.
524 # If the arguments are overwritten with ####### then the test has failed.
525 proc recursive_source_test {} {
526 set file1 [standard_output_file file1]
527 set file2 [standard_output_file file2]
528 set file3 [standard_output_file file3]
530 set fd [open "$file1" w]
536 set fd [open "$file2" w]
539 echo 1: <<<\$arg0>>>\\n
541 echo 2: <<<\$arg0>>>\\n
545 set fd [open "$file3" w]
548 #################################################################"
551 gdb_test "source $file1" \
552 "1: <<<qwerty>>>\[\r\n]+in file3\[\r\n]+2: <<<qwerty>>>" \
553 "recursive source test"
560 proc gdb_test_no_prompt { command result msg } {
563 set msg "$command - $msg"
564 set result "^[string_to_regexp $command]\r\n$result$"
565 gdb_test_multiple $command $msg {
578 proc if_commands_test {} {
581 gdb_test_no_output "set \$tem = 1" "set \$tem in if_commands_test"
583 set test "if_commands_test 1"
584 gdb_test_no_prompt "if \$tem == 2" { >} $test
585 gdb_test_no_prompt "break main" { >} $test
586 gdb_test_no_prompt "else" { >} $test
587 gdb_test_no_prompt "break factorial" { >} $test
588 gdb_test_no_prompt "commands" { >} $test
589 gdb_test_no_prompt "silent" { >} $test
590 gdb_test_no_prompt "set \$tem = 3" { >} $test
591 gdb_test_no_prompt "continue" { >} $test
592 gdb_test_multiple "end" "first end - $test" {
594 pass "first end - $test"
597 fail "first end - $test"
600 gdb_test_multiple "end" "second end - $test" {
601 -re "Breakpoint \[0-9\]+ at .*: file .*run.c, line \[0-9\]+\.\r\n$gdb_prompt $" {
602 pass "second end - $test"
604 -re "Undefined command: \"silent\".*$gdb_prompt $" {
605 fail "second end - $test"
609 set test "if_commands_test 2"
610 gdb_test_no_prompt "if \$tem == 1" { >} $test
611 gdb_test_no_prompt "break main" { >} $test
612 gdb_test_no_prompt "else" { >} $test
613 gdb_test_no_prompt "break factorial" { >} $test
614 gdb_test_no_prompt "commands" { >} $test
615 gdb_test_no_prompt "silent" { >} $test
616 gdb_test_no_prompt "set \$tem = 3" { >} $test
617 gdb_test_no_prompt "continue" { >} $test
618 gdb_test_multiple "end" "first end - $test" {
620 pass "first end - $test"
623 fail "first end - $test"
626 gdb_test_multiple "end" "second end - $test" {
627 -re "Breakpoint \[0-9\]+ at .*: file .*run.c, line \[0-9\]+\.\r\n$gdb_prompt $" {
628 pass "second end - $test"
633 # Verify an error during "commands" commands execution will prevent any other
634 # "commands" from other breakpoints at the same location to be executed.
636 proc error_clears_commands_left {} {
637 set test "hook-stop 1"
638 gdb_test_multiple {define hook-stop} $test {
639 -re "End with a line saying just \"end\"\\.\r\n>$" {
643 set test "hook-stop 1a"
644 gdb_test_multiple {echo hook-stop1\n} $test {
649 gdb_test_no_output "end" "hook-stop 1b"
652 gdb_breakpoint "main"
654 set test "main commands 1"
655 gdb_test_multiple {commands $bpnum} $test {
656 -re "End with a line saying just \"end\"\\.\r\n>$" {
660 set test "main commands 1a"
661 gdb_test_multiple {echo cmd1\n} $test {
666 set test "main commands 1b"
667 gdb_test_multiple {errorcommandxy\n} $test {
672 gdb_test_no_output "end" "main commands 1c"
674 gdb_breakpoint "main"
675 set test "main commands 2"
676 gdb_test_multiple {commands $bpnum} $test {
677 -re "End with a line saying just \"end\"\\.\r\n>$" {
681 set test "main commands 2a"
682 gdb_test_multiple {echo cmd2\n} $test {
687 set test "main commands 2b"
688 gdb_test_multiple {errorcommandyz\n} $test {
693 gdb_test_no_output "end" "main commands 2c"
696 gdb_test "" "hook-stop1\r\n.*\r\ncmd1\r\nUndefined command: \"errorcommandxy\"\\. Try \"help\"\\." "cmd1 error"
698 gdb_test {echo idle\n} "\r\nidle" "no cmd2"
701 proc redefine_hook_test {} {
704 gdb_test "define one\nend" \
708 gdb_test "define hook-one\necho hibob\\n\nend" \
712 gdb_test_multiple "define one" "redefine one" {
713 -re "Redefine command .one.. .y or n. $" {
719 pass "define one in redefine_hook_test"
722 fail "(timeout or eof) define one in redefine_hook_test"
728 "enter commands for one redefinition in redefine_hook_test"
732 "execute one command in redefine_hook_test"
735 proc redefine_backtrace_test {} {
738 gdb_test_multiple "define backtrace" "define backtrace" {
739 -re "Really redefine built-in command \"backtrace\"\\? \\(y or n\\) $" {
740 pass "define backtrace"
744 gdb_test_multiple "y" "expect response to define backtrace" {
745 -re "End with a line saying just \"end\"\\.\r\n>$" {
746 pass "expect response to define backtrace"
750 gdb_test "echo hibob\\n\nend" \
752 "enter commands in redefine_backtrace_test"
754 gdb_test "backtrace" \
756 "execute backtrace command in redefine_backtrace_test"
759 "execute bt command in redefine_backtrace_test"
762 gdbvar_simple_if_test
763 gdbvar_simple_while_test
764 gdbvar_complex_if_while_test
765 progvar_simple_if_test
766 progvar_simple_while_test
767 progvar_complex_if_while_test
768 if_while_breakpoint_command_test
769 infrun_breakpoint_command_test
770 breakpoint_command_test
771 user_defined_command_test
772 watchpoint_command_test
773 test_command_prompt_position
774 deprecated_command_test
775 bp_deleted_in_command_test
776 temporary_breakpoint_commands
778 source_file_with_indented_comment
779 recursive_source_test
781 error_clears_commands_left
783 # This one should come last, as it redefines "backtrace".
784 redefine_backtrace_test