diff options
author | Joel Brobecker <brobecker@gnat.com> | 2006-05-20 01:35:27 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2006-05-20 01:35:27 +0000 |
commit | 6c0112ecf20c8954ef06ad6fa24b75cb48481ebb (patch) | |
tree | d995acda1323455b68daf0cbfc5befa2d527638f | |
parent | b4e70030cba9f8d42c5b5371f8c0d091011474a6 (diff) | |
download | binutils-6c0112ecf20c8954ef06ad6fa24b75cb48481ebb.zip binutils-6c0112ecf20c8954ef06ad6fa24b75cb48481ebb.tar.gz binutils-6c0112ecf20c8954ef06ad6fa24b75cb48481ebb.tar.bz2 |
* gdb.base/del.exp (test_delete_alias): New function.
Now check that both "del" and "d" work as aliases for "delete".
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/del.exp | 53 |
2 files changed, 42 insertions, 16 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index c64f6b5..35809e4 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-05-19 Joel Brobecker <brobecker@adacore.com> + + * gdb.base/del.exp (test_delete_alias): New function. + Now check that both "del" and "d" work as aliases for "delete". + 2006-05-18 Fred Fish <fnf@specifix.com> * gdb.base/a2-run.exp: Allow part of test to run when args aren't diff --git a/gdb/testsuite/gdb.base/del.exp b/gdb/testsuite/gdb.base/del.exp index 4d5bf47..fa0c60c 100644 --- a/gdb/testsuite/gdb.base/del.exp +++ b/gdb/testsuite/gdb.base/del.exp @@ -39,19 +39,40 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} -# Test whether the "del" command works as an alias of "delete". -# For that, insert a breakpoint at an easy location, remove it, -# and then check in the output of "info break" that this breakpoint -# no longer exists. - -gdb_test "break main" \ - "Breakpoint.*at.* file .*$srcfile, line.*" \ - "breakpoint function" - -gdb_test "del \$bpnum" \ - "" \ - "Remove last breakpoint" - -gdb_test "info break" \ - "No breakpoints or watchpoints." \ - "info break after removing break on main" +# A function to test that ALIAS is working as a shortcut of the "delete" +# command. + +proc test_delete_alias { alias } { + global srcfile + + # First of all, remove all previous breakpoints if there were any, + # and then verify that we do not have any breakpoint lying around. + gdb_test "delete" \ + "" \ + "Remove all breakpoints ($alias)" + gdb_test "info break" \ + "No breakpoints or watchpoints." \ + "info break after removing break on main" + + + # Now, insert a breakpoint at an easy location, and then remove it + # using $alias. We verified that the removal worked by checking + # the list of breakpoints. + gdb_test "break main" \ + "Breakpoint.*at.* file .*$srcfile, line.*" \ + "breakpoint insertion ($alias)" + + gdb_test "$alias \$bpnum" \ + "" \ + "Remove last breakpoint ($alias)" + + gdb_test "info break" \ + "No breakpoints or watchpoints." \ + "info break after removing break on main ($alias)" +} + +# Test various shortcut forms of the "delete" command. + +test_delete_alias "del" +test_delete_alias "d" + |