aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/commands.exp
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2008-12-12 17:58:48 +0000
committerTom Tromey <tromey@redhat.com>2008-12-12 17:58:48 +0000
commitfad6eecd5d0bbccca6db96c20589a0bda9aeca48 (patch)
tree8a22ba513f3c928fdf257b859477d5514d3d6ae4 /gdb/testsuite/gdb.base/commands.exp
parent17c8aaf5078f15d4cd621a5428a82080a7f4c516 (diff)
downloadgdb-fad6eecd5d0bbccca6db96c20589a0bda9aeca48.zip
gdb-fad6eecd5d0bbccca6db96c20589a0bda9aeca48.tar.gz
gdb-fad6eecd5d0bbccca6db96c20589a0bda9aeca48.tar.bz2
gdb
PR cli/2563: * cli/cli-decode.c (delete_cmd): Add hook-related out parameters. (add_cmd): Update. Install hooks into new command. (add_alias_cmd): Update. gdb/testsuite * gdb.base/commands.exp (redefine_hook_test): New proc. Call it.
Diffstat (limited to 'gdb/testsuite/gdb.base/commands.exp')
-rw-r--r--gdb/testsuite/gdb.base/commands.exp35
1 files changed, 35 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp
index f6be3ea..f3dd9ac 100644
--- a/gdb/testsuite/gdb.base/commands.exp
+++ b/gdb/testsuite/gdb.base/commands.exp
@@ -692,6 +692,40 @@ proc if_commands_test {} {
}
}
+proc redefine_hook_test {} {
+ global gdb_prompt
+
+ gdb_test "define one\nend" \
+ "" \
+ "define one"
+
+ gdb_test "define hook-one\necho hibob\\n\nend" \
+ "" \
+ "define hook-one"
+
+ gdb_test_multiple "define one" "redefine one" {
+ -re "Redefine command .one.. .y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+
+ -re "End with" {
+ pass "define one in redefine_hook_test"
+ }
+ default {
+ fail "(timeout or eof) define one in redefine_hook_test"
+ }
+ }
+
+ gdb_test "end" \
+ "" \
+ "enter commands for one redefinition in redefine_hook_test"
+
+ gdb_test "one" \
+ "hibob" \
+ "execute one command in redefine_hook_test"
+}
+
proc redefine_backtrace_test {} {
global gdb_prompt
@@ -738,5 +772,6 @@ temporary_breakpoint_commands
stray_arg0_test
recursive_source_test
if_commands_test
+redefine_hook_test
# This one should come last, as it redefines "backtrace".
redefine_backtrace_test