[RFA] Add "del" as alias to "delete"

Joel Brobecker brobecker@adacore.com
Thu Apr 6 18:38:00 GMT 2006


> > 2006-04-06  Joel Brobecker  <brobecker@adacore.com>
> > 
> >         * breakpoint.c (_initialize_breakpoint): Add "del" as an alias
> >         of the "delete" command.
> > 
>
> Yes, thank you!

Great. Thanks. This part has now been committed.

> > Perhaps I should add a test too in one of the breakpoint testcases...
> > Will work on that as soon as this one is in.
> 
> Please.  We know that people actually use "del", so let's take care
> not to break it.

Attached is a first attempt. I ended up writing a new testcase for it,
so we can collect all aliases of "delete" in that testcase. Hope it was
ok. This testcase causes 1 FAIL without the patch above.

I have a question: How can we test that GDB didn't return any output
from the command? "" seems to match anything...

> Does anyone think we should make "dele" and "delet" work again too?

I don't mind adding them, but I've never used these abbreviations.
I suggest we wait for people to complain before adding them as aliases.

2006-04-06  Joel Brobecker  <brobecker@adacore.com>

        * gdb.base/del.c: New file.
        * gdb.base/del.exp: New testcase.

Comments?
-- 
Joel
-------------- next part --------------
/* This testcase is part of GDB, the GNU debugger.

   Copyright 2006 Free Software Foundation, Inc.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
 
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

   Please email any bugs, comments, and/or additions to this file to:
   bug-gdb@prep.ai.mit.edu  */

int
main(void)
{
  return 0;
}
-------------- next part --------------
# Copyright 2006 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  

# The intent of this testcase it to verify that various aliases and
# shortcuts of the "delete" command never stop working.

if $tracelevel then {
    strace $tracelevel
}

set prms_id 0
set bug_id 0

set testfile del
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
    untested "Couldn't compile test program"
    return -1
}

# Get things started.

gdb_exit
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"


More information about the Gdb-patches mailing list