* [RFA] Add "del" as alias to "delete"
@ 2006-04-06 16:24 Joel Brobecker
2006-04-06 16:30 ` Daniel Jacobowitz
0 siblings, 1 reply; 11+ messages in thread
From: Joel Brobecker @ 2006-04-06 16:24 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 626 bytes --]
This is a followup on a suggestion made by Daniel in:
http://sourceware.org/ml/gdb/2006-01/msg00205.html
Apparently, a message in GDB hinted that Daniel would not have time
in the near future to implement this, so I went ahead:
2006-04-06 Joel Brobecker <brobecker@adacore.com>
* breakpoint.c (_initialize_breakpoint): Add "del" as an alias
of the "delete" command.
currently testing against the testsuite on x86-linux, but I don't expect
any regression. OK to commit?
Perhaps I should add a test too in one of the breakpoint testcases...
Will work on that as soon as this one is in.
--
Joel
[-- Attachment #2: del.diff --]
[-- Type: text/plain, Size: 666 bytes --]
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.223
diff -u -p -r1.223 breakpoint.c
--- breakpoint.c 9 Feb 2006 11:24:46 -0000 1.223
+++ breakpoint.c 6 Apr 2006 16:19:29 -0000
@@ -7813,6 +7813,7 @@ Also a prefix command for deletion of ot
The \"unset\" command is also an alias for \"delete\"."),
&deletelist, "delete ", 1, &cmdlist);
add_com_alias ("d", "delete", class_breakpoint, 1);
+ add_com_alias ("del", "delete", class_breakpoint, 1);
if (xdb_commands)
add_com ("db", class_breakpoint, delete_command, _("\
Delete some breakpoints.\n\
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [RFA] Add "del" as alias to "delete"
2006-04-06 16:24 [RFA] Add "del" as alias to "delete" Joel Brobecker
@ 2006-04-06 16:30 ` Daniel Jacobowitz
2006-04-06 18:38 ` Joel Brobecker
2006-04-06 19:14 ` Eli Zaretskii
0 siblings, 2 replies; 11+ messages in thread
From: Daniel Jacobowitz @ 2006-04-06 16:30 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
On Thu, Apr 06, 2006 at 09:24:00AM -0700, Joel Brobecker wrote:
> 2006-04-06 Joel Brobecker <brobecker@adacore.com>
>
> * breakpoint.c (_initialize_breakpoint): Add "del" as an alias
> of the "delete" command.
>
> currently testing against the testsuite on x86-linux, but I don't expect
> any regression. OK to commit?
Yes, thank you!
> 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.
Does anyone think we should make "dele" and "delet" work again too?
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] Add "del" as alias to "delete"
2006-04-06 16:30 ` Daniel Jacobowitz
@ 2006-04-06 18:38 ` Joel Brobecker
2006-04-06 21:04 ` Michael Snyder
2006-05-05 20:22 ` Daniel Jacobowitz
2006-04-06 19:14 ` Eli Zaretskii
1 sibling, 2 replies; 11+ messages in thread
From: Joel Brobecker @ 2006-04-06 18:38 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1146 bytes --]
> > 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
[-- Attachment #2: del.c --]
[-- Type: text/plain, Size: 947 bytes --]
/* 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;
}
[-- Attachment #3: del.exp --]
[-- Type: text/plain, Size: 1820 bytes --]
# 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"
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [RFA] Add "del" as alias to "delete"
2006-04-06 18:38 ` Joel Brobecker
@ 2006-04-06 21:04 ` Michael Snyder
2006-04-06 21:11 ` Daniel Jacobowitz
2006-05-05 20:22 ` Daniel Jacobowitz
1 sibling, 1 reply; 11+ messages in thread
From: Michael Snyder @ 2006-04-06 21:04 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
Joel Brobecker wrote:
>>>2006-04-06 Joel Brobecker <brobecker@adacore.com>
>>>
>>> * breakpoint.c (_initialize_breakpoint): Add "del" as an alias
>>> of the "delete" command.
>>>
>>Does anyone think we should make "dele" and "delet" work again too?
Guys, this seems awkward and ad hoc (I realize it's my fault...)
What if we make "delete" a command prefix (like "maint"),
and then just branch from what follows it (eg. breakpoint,
tracepoint, fork, checkpoint, display), with the default to be
breakpoint.
I'm not quite sure why this is broken only now...
it used to work when "delete tracepoint" and
"delete display" were possibilities.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] Add "del" as alias to "delete"
2006-04-06 21:04 ` Michael Snyder
@ 2006-04-06 21:11 ` Daniel Jacobowitz
2006-04-06 21:38 ` Michael Snyder
2006-04-06 21:49 ` Andreas Schwab
0 siblings, 2 replies; 11+ messages in thread
From: Daniel Jacobowitz @ 2006-04-06 21:11 UTC (permalink / raw)
To: Michael Snyder; +Cc: Joel Brobecker, gdb-patches
On Thu, Apr 06, 2006 at 02:04:17PM -0700, Michael Snyder wrote:
> Joel Brobecker wrote:
> >>>2006-04-06 Joel Brobecker <brobecker@adacore.com>
> >>>
> >>> * breakpoint.c (_initialize_breakpoint): Add "del" as an alias
> >>> of the "delete" command.
> >>>
> >>Does anyone think we should make "dele" and "delet" work again too?
>
> Guys, this seems awkward and ad hoc (I realize it's my fault...)
>
> What if we make "delete" a command prefix (like "maint"),
> and then just branch from what follows it (eg. breakpoint,
> tracepoint, fork, checkpoint, display), with the default to be
> breakpoint.
>
> I'm not quite sure why this is broken only now...
> it used to work when "delete tracepoint" and
> "delete display" were possibilities.
You know, I had completely forgotten those were there. I wish I'd
realized before.
The reason it's a problem now is that you didn't add "delete
checkpoint", but instead "delete-checkpoint". If we switch it the
problem will go away.
There's a similar problem with detach, by the way. I used to type
"det" and now that doesn't work. Aliases or rename?
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] Add "del" as alias to "delete"
2006-04-06 21:11 ` Daniel Jacobowitz
@ 2006-04-06 21:38 ` Michael Snyder
2006-05-17 16:02 ` Daniel Jacobowitz
2006-04-06 21:49 ` Andreas Schwab
1 sibling, 1 reply; 11+ messages in thread
From: Michael Snyder @ 2006-04-06 21:38 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Joel Brobecker, gdb-patches
Daniel Jacobowitz wrote:
> On Thu, Apr 06, 2006 at 02:04:17PM -0700, Michael Snyder wrote:
>
>>Joel Brobecker wrote:
>>
>>>>>2006-04-06 Joel Brobecker <brobecker@adacore.com>
>>>>>
>>>>> * breakpoint.c (_initialize_breakpoint): Add "del" as an alias
>>>>> of the "delete" command.
>>>>>
>>>>
>>>>Does anyone think we should make "dele" and "delet" work again too?
>>
>>Guys, this seems awkward and ad hoc (I realize it's my fault...)
>>
>>What if we make "delete" a command prefix (like "maint"),
>>and then just branch from what follows it (eg. breakpoint,
>>tracepoint, fork, checkpoint, display), with the default to be
>>breakpoint.
>>
>>I'm not quite sure why this is broken only now...
>>it used to work when "delete tracepoint" and
>>"delete display" were possibilities.
>
>
> You know, I had completely forgotten those were there. I wish I'd
> realized before.
>
> The reason it's a problem now is that you didn't add "delete
> checkpoint", but instead "delete-checkpoint". If we switch it the
> problem will go away.
>
> There's a similar problem with detach, by the way. I used to type
> "det" and now that doesn't work. Aliases or rename?
Rename. It's early enough, I don't think many people are using
checkpoints yet.
I think I caused the very problem I was thinking to avoid,
by using that hyphen. ;-(
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] Add "del" as alias to "delete"
2006-04-06 21:38 ` Michael Snyder
@ 2006-05-17 16:02 ` Daniel Jacobowitz
0 siblings, 0 replies; 11+ messages in thread
From: Daniel Jacobowitz @ 2006-05-17 16:02 UTC (permalink / raw)
To: Michael Snyder; +Cc: Joel Brobecker, gdb-patches
[GDB 6.5 note: This ought to be fixed.]
On Thu, Apr 06, 2006 at 02:38:19PM -0700, Michael Snyder wrote:
> Daniel Jacobowitz wrote:
> >There's a similar problem with detach, by the way. I used to type
> >"det" and now that doesn't work. Aliases or rename?
>
> Rename. It's early enough, I don't think many people are using
> checkpoints yet.
I agree. What should it be renamed to, though?
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] Add "del" as alias to "delete"
2006-04-06 21:11 ` Daniel Jacobowitz
2006-04-06 21:38 ` Michael Snyder
@ 2006-04-06 21:49 ` Andreas Schwab
1 sibling, 0 replies; 11+ messages in thread
From: Andreas Schwab @ 2006-04-06 21:49 UTC (permalink / raw)
To: Michael Snyder; +Cc: Joel Brobecker, gdb-patches
Daniel Jacobowitz <drow@false.org> writes:
> The reason it's a problem now is that you didn't add "delete
> checkpoint", but instead "delete-checkpoint". If we switch it the
> problem will go away.
>
> There's a similar problem with detach, by the way. I used to type
> "det" and now that doesn't work. Aliases or rename?
Since gdb can grok multi-word commands hyphens in command names should be
the exception, IMHO.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] Add "del" as alias to "delete"
2006-04-06 18:38 ` Joel Brobecker
2006-04-06 21:04 ` Michael Snyder
@ 2006-05-05 20:22 ` Daniel Jacobowitz
2006-05-05 22:50 ` Joel Brobecker
1 sibling, 1 reply; 11+ messages in thread
From: Daniel Jacobowitz @ 2006-05-05 20:22 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
On Thu, Apr 06, 2006 at 11:37:33AM -0700, Joel Brobecker wrote:
> 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.
This testcase is OK, if you want to commit it. There's also a "d"
alias, if you want to test that too - although it's already covered by
"help d" in help.exp, which I updated today.
> I have a question: How can we test that GDB didn't return any output
> from the command? "" seems to match anything...
You can't really. We've talked about anchoring patters to the
beginning of the output, but it's a little tricky to do, and would
probably require changing lots of tests - a project for some other
rainier day.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] Add "del" as alias to "delete"
2006-05-05 20:22 ` Daniel Jacobowitz
@ 2006-05-05 22:50 ` Joel Brobecker
0 siblings, 0 replies; 11+ messages in thread
From: Joel Brobecker @ 2006-05-05 22:50 UTC (permalink / raw)
To: gdb-patches
> > 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.
>
> This testcase is OK, if you want to commit it. There's also a "d"
> alias, if you want to test that too - although it's already covered by
> "help d" in help.exp, which I updated today.
Thanks. It has been checked in. I think an extra test is going to be
cleaner, so I'll add it now and submit a new patch momentarily.
--
Joel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] Add "del" as alias to "delete"
2006-04-06 16:30 ` Daniel Jacobowitz
2006-04-06 18:38 ` Joel Brobecker
@ 2006-04-06 19:14 ` Eli Zaretskii
1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2006-04-06 19:14 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
> Date: Thu, 6 Apr 2006 12:30:09 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sources.redhat.com
>
> Does anyone think we should make "dele" and "delet" work again too?
I don't know. Back compatibility says YES, but at least the second
one is too strange to have, IMO.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-05-17 15:01 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-06 16:24 [RFA] Add "del" as alias to "delete" Joel Brobecker
2006-04-06 16:30 ` Daniel Jacobowitz
2006-04-06 18:38 ` Joel Brobecker
2006-04-06 21:04 ` Michael Snyder
2006-04-06 21:11 ` Daniel Jacobowitz
2006-04-06 21:38 ` Michael Snyder
2006-05-17 16:02 ` Daniel Jacobowitz
2006-04-06 21:49 ` Andreas Schwab
2006-05-05 20:22 ` Daniel Jacobowitz
2006-05-05 22:50 ` Joel Brobecker
2006-04-06 19:14 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox