Index: del.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/del.exp,v retrieving revision 1.1 diff -u -p -r1.1 del.exp --- del.exp 5 May 2006 22:49:39 -0000 1.1 +++ del.exp 5 May 2006 23:06:46 -0000 @@ -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" +