From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [RFA] Add "fin" alias for "finish"
Date: Wed, 21 May 2008 15:26:00 -0000 [thread overview]
Message-ID: <20080521045022.GE4080@adacore.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 927 bytes --]
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 <brobecker@adacore.com>
* infcmd.c (_initialize_infcmd): Add new "fin" alias for "finish".
2008-05-20 Joel Brobecker <brobecker@adacore.com>
* 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 <brobecker@adacore.com>
* gdb.texinfo (Continuing and Stepping): Document the new "fin"
abbreviation for "finish".
Tested on x86-linux without any regression. OK to apply?
Thanks,
--
Joel
[-- Attachment #2: fin.diff --]
[-- Type: text/plain, Size: 661 bytes --]
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\
[-- Attachment #3: fin-tc.diff --]
[-- Type: text/plain, Size: 1018 bytes --]
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.
[-- Attachment #4: fin-doc.diff --]
[-- Type: text/plain, Size: 758 bytes --]
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}).
next reply other threads:[~2008-05-21 4:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-21 15:26 Joel Brobecker [this message]
2008-05-21 19:44 ` Eli Zaretskii
2008-05-21 20:38 ` Joel Brobecker
2008-05-21 19:58 ` Daniel Jacobowitz
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=20080521045022.GE4080@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/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