Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Add "del" as alias to "delete"
Date: Thu, 06 Apr 2006 18:38:00 -0000	[thread overview]
Message-ID: <20060406183733.GB800@adacore.com> (raw)
In-Reply-To: <20060406163009.GA29559@nevyn.them.org>

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

  reply	other threads:[~2006-04-06 18:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-06 16:24 Joel Brobecker
2006-04-06 16:30 ` Daniel Jacobowitz
2006-04-06 18:38   ` Joel Brobecker [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060406183733.GB800@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox