aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/commands.exp
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1995-01-24 05:16:25 +0000
committerJeff Law <law@redhat.com>1995-01-24 05:16:25 +0000
commitaf2e6b157ef7444bc407d83c7d9858e1399368e9 (patch)
tree3bfbf4269eef6eaa18dd6ddaa28f6dcdceec2f07 /gdb/testsuite/gdb.base/commands.exp
parent36491e5bda742c9b4250c87b9695bdca233be329 (diff)
downloadgdb-af2e6b157ef7444bc407d83c7d9858e1399368e9.zip
gdb-af2e6b157ef7444bc407d83c7d9858e1399368e9.tar.gz
gdb-af2e6b157ef7444bc407d83c7d9858e1399368e9.tar.bz2
* gdb.base/commands.exp: Make test names unique; every test either
passes or fails. Update some comments.
Diffstat (limited to 'gdb/testsuite/gdb.base/commands.exp')
-rw-r--r--gdb/testsuite/gdb.base/commands.exp46
1 files changed, 27 insertions, 19 deletions
diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp
index bef2468..8345851 100644
--- a/gdb/testsuite/gdb.base/commands.exp
+++ b/gdb/testsuite/gdb.base/commands.exp
@@ -43,7 +43,7 @@ gdb_load $objdir/$subdir/$binfile
proc gdbvar_simple_if_test {} {
global prompt
- gdb_test "set \\\$foo = 0"
+ gdb_test "set \\\$foo = 0" "" "set foo in gdbvar_simple_if_test"
# All this test should do is print 0xdeadbeef once.
gdb_test "if \\\$foo == 1\\np/x 0xfeedface\\nelse\\np/x 0xdeadbeef\\nend" "\\\$\[0-9\]* = 0xdeadbeef" "gdbvar_simple_if_test #1"
# All this test should do is print 0xfeedface once.
@@ -53,7 +53,7 @@ proc gdbvar_simple_if_test {} {
proc gdbvar_simple_while_test {} {
global prompt
- gdb_test "set \\\$foo = 5"
+ gdb_test "set \\\$foo = 5" "" "set foo in gdbvar_simple_while_test"
# This test should print 0xfeedface five times.
gdb_test "while \\\$foo > 0\\np/x 0xfeedface\\nset \\\$foo -= 1\\nend" "\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" "gdbvar_simple_while_test #1"
}
@@ -61,7 +61,7 @@ proc gdbvar_simple_while_test {} {
proc gdbvar_complex_if_while_test {} {
global prompt
- gdb_test "set \\\$foo = 4"
+ gdb_test "set \\\$foo = 4" "" "set foo in gdbvar complex_if_while_test"
# This test should alternate between 0xdeadbeef and 0xfeedface two times.
gdb_test "while \\\$foo > 0\\nset \\\$foo -= 1\\nif \(\\\$foo % 2\) == 1\\np/x 0xdeadbeef\\nelse\\np/x 0xfeedface\\nend\\nend" "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" "gdbvar_complex_if_while_test #1"
}
@@ -69,7 +69,7 @@ proc gdbvar_complex_if_while_test {} {
proc progvar_simple_if_test {} {
global prompt
- gdb_test "set args 5"
+ gdb_test "set args 5" "" "set args in progvar_simple_if_test"
if { ![runto factorial] } then { return }
# All this test should do is print 0xdeadbeef once.
gdb_test "if value == 1\\np/x 0xfeedface\\nelse\\np/x 0xdeadbeef\\nend" "\\\$\[0-9\]* = 0xdeadbeef" "progvar_simple_if_test #1"
@@ -80,7 +80,7 @@ proc progvar_simple_if_test {} {
proc progvar_simple_while_test {} {
global prompt
- gdb_test "set args 5"
+ gdb_test "set args 5" "" "set args in progvar_simple_while_test"
if { ![runto factorial] } then { return }
# This test should print 0xfeedface five times.
gdb_test "while value > 0\\np/x 0xfeedface\\nset value -= 1\\nend" "\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" "progvar_simple_while_test #1"
@@ -89,7 +89,7 @@ proc progvar_simple_while_test {} {
proc progvar_complex_if_while_test {} {
global prompt
- gdb_test "set args 4"
+ gdb_test "set args 4" "" "set args in progvar_complex_if_while_test"
if { ![runto factorial] } then { return }
# This test should alternate between 0xdeadbeef and 0xfeedface two times.
gdb_test "while value > 0\\nset value -= 1\\nif \(value % 2\) == 1\\np/x 0xdeadbeef\\nelse\\np/x 0xfeedface\\nend\\nend" "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" "progvar_complex_if_while_test #1"
@@ -98,38 +98,46 @@ proc progvar_complex_if_while_test {} {
proc if_while_breakpoint_command_test {} {
global prompt
- gdb_test "set args 5"
+ gdb_test "set args 5" "" "set args in if_while_breakpoint_command_test"
if { ![runto factorial] } then { return }
delete_breakpoints
gdb_test "break factorial" "Breakpoint.*at"
- # For some stupid reason doing this with a gdb_test timed out. Weird.
+
send "commands\n"
expect {
- -re "End with" { }
- default { fail "(timeout or eof) commands" }
+ -re "End with" {
+ pass "commands in if_while_breakpoint_command_test"
+ }
+ default {
+ fail "(timeout or eof) commands in if_while_breakpoint_command_test"
+ }
}
# This test should alternate between 0xdeadbeef and 0xfeedface two times.
- gdb_test "while value > 0\\nset value -= 1\\nif \(value % 2\) == 1\\np/x 0xdeadbeef\\nelse\\np/x 0xfeedface\\nend\\nend\\nend\\n" "" "commands"
+ gdb_test "while value > 0\\nset value -= 1\\nif \(value % 2\) == 1\\np/x 0xdeadbeef\\nelse\\np/x 0xfeedface\\nend\\nend\\nend" "" "commands part 2 in if_while_breakpoint_command_test"
gdb_test "continue" "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" "if_while_breakpoint_command_test #1"
- gdb_test "info break" "while.*set.*if.*p/x.*else.*p/x.*end.*" "info break"
+ gdb_test "info break" "while.*set.*if.*p/x.*else.*p/x.*end.*" "info break in if_while_breakpoint_command_test"
}
# Test a simple user defined command (with arguments)
proc user_defined_command_test {} {
global prompt
- gdb_test "set \\\$foo = 4"
- # For some stupid reason doing this with a gdb_test timed out. Weird.
+ gdb_test "set \\\$foo = 4" "" "set foo in user_defined_command_test"
+
send "define mycommand\n"
expect {
- -re "End with" { }
- default { fail "(timeout or eof) enter user defined command" }
+ -re "End with" {
+ pass "define mycommand in user_defined_command_test"
+ }
+ default {
+ fail "(timeout or eof) define mycommand in user_defined_command_test"
+ }
}
# This test should alternate between 0xdeadbeef and 0xfeedface two times.
- gdb_test "while \\\$arg0 > 0\\nset \\\$arg0 -= 1\\nif \(\\\$arg0 % 2\) == 1\\np/x 0xdeadbeef\\nelse\\np/x 0xfeedface\\nend\\nend\\nend\\n" ".*$prompt.*" "enter user defined command"
+ gdb_test "while \\\$arg0 > 0\\nset \\\$arg0 -= 1\\nif \(\\\$arg0 % 2\) == 1\\np/x 0xdeadbeef\\nelse\\np/x 0xfeedface\\nend\\nend\\nend" "" "enter commands in user_defined_command_test"
- gdb_test "mycommand \\\$foo" "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" "execute user defined command"
- gdb_test "show user mycommand" "while.*set.*if.*p/x.*else.*p/x.*end.*" "display user command"
+ gdb_test "mycommand \\\$foo" "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" "execute user defined command in user_defined_command_test"
+ gdb_test "show user mycommand" "while.*set.*if.*p/x.*else.*p/x.*end.*" "display user command in user_defined_command_test"
}
gdbvar_simple_if_test