From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5040 invoked by alias); 21 May 2008 04:50:45 -0000 Received: (qmail 5031 invoked by uid 22791); 21 May 2008 04:50:44 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 21 May 2008 04:50:27 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 8647D2A974F for ; Wed, 21 May 2008 00:50:25 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id VVKauKW6NGzJ for ; Wed, 21 May 2008 00:50:25 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 1E54B2A974E for ; Wed, 21 May 2008 00:50:25 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 8E874E7ACD; Tue, 20 May 2008 21:50:22 -0700 (PDT) Date: Wed, 21 May 2008 15:26:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFA] Add "fin" alias for "finish" Message-ID: <20080521045022.GE4080@adacore.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="n8g4imXOkfNTN/H1" Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00628.txt.bz2 --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 927 Hello, I was wondering if others out there were used to using "fin" as an abbreviation of "finish". Since the addition of the "find" command, this has become ambiguous, and so now the minimum abbreviation is "fini". I think it would be nice to keep the "fin" abbreviation, so this patch adds a new "fin" alias as an abbreviation of the "finish" command. 2008-05-20 Joel Brobecker * infcmd.c (_initialize_infcmd): Add new "fin" alias for "finish". 2008-05-20 Joel Brobecker * gdb.base/finish.exp: Test that "fin" works as an abbreviation of the "finish" command. And the associated doc update (Hello Eli! :): 2008-05-20 Joel Brobecker * gdb.texinfo (Continuing and Stepping): Document the new "fin" abbreviation for "finish". Tested on x86-linux without any regression. OK to apply? Thanks, -- Joel --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fin.diff" Content-length: 661 Index: infcmd.c =================================================================== RCS file: /cvs/src/src/gdb/infcmd.c,v retrieving revision 1.182 diff -u -p -r1.182 infcmd.c --- infcmd.c 6 May 2008 21:34:59 -0000 1.182 +++ infcmd.c 21 May 2008 04:42:56 -0000 @@ -2251,6 +2251,7 @@ Argument N means do this N times (or til add_com ("finish", class_run, finish_command, _("\ Execute until selected stack frame returns.\n\ Upon return, the value returned is printed and put in the value history.")); + add_com_alias ("fin", "finish", class_run, 1); add_com ("next", class_run, next_command, _("\ Step program, proceeding through subroutine calls.\n\ --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fin-tc.diff" Content-length: 1018 Index: testsuite/gdb.base/finish.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/finish.exp,v retrieving revision 1.10 diff -u -p -r1.10 finish.exp --- testsuite/gdb.base/finish.exp 1 Jan 2008 22:53:19 -0000 1.10 +++ testsuite/gdb.base/finish.exp 21 May 2008 04:43:58 -0000 @@ -97,6 +97,21 @@ proc finish_void { } { } } +# A function that tests that the given ABBREV is a working abbreviation +# of the "finish" command. + +proc finish_abbreviation { abbrev } { + + if { ! [ runto "int_func" ] } then { + fail "running to int_func" + return -1 + } + + gdb_test "$abbrev" \ + "Value returned is .* = 1" \ + "Testing the \"$abbrev\" abbreviation for \"finish\"" +} + proc finish_tests { } { global gdb_prompt @@ -113,6 +128,7 @@ proc finish_tests { } { finish_1 "long_long" finish_1 "float" finish_1 "double" + finish_abbreviation "fin" } # Start with a fresh gdb. --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fin-doc.diff" Content-length: 758 Index: doc/gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.495 diff -u -p -r1.495 gdb.texinfo --- doc/gdb.texinfo 9 May 2008 17:02:01 -0000 1.495 +++ doc/gdb.texinfo 21 May 2008 04:43:39 -0000 @@ -4127,9 +4127,11 @@ Show whether @value{GDBN} will stop in o source line debug information. @kindex finish +@kindex fin @r{(@code{finish})} @item finish Continue running until just after function in the selected stack frame -returns. Print the returned value (if any). +returns. Print the returned value (if any). This command is abbreviated +@code{fin}. Contrast this with the @code{return} command (@pxref{Returning, ,Returning from a Function}). --n8g4imXOkfNTN/H1--