* [RFA] Add "fin" alias for "finish"
@ 2008-05-21 15:26 Joel Brobecker
2008-05-21 19:44 ` Eli Zaretskii
2008-05-21 19:58 ` Daniel Jacobowitz
0 siblings, 2 replies; 4+ messages in thread
From: Joel Brobecker @ 2008-05-21 15:26 UTC (permalink / raw)
To: gdb-patches
[-- 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}).
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [RFA] Add "fin" alias for "finish"
2008-05-21 15:26 [RFA] Add "fin" alias for "finish" Joel Brobecker
@ 2008-05-21 19:44 ` Eli Zaretskii
2008-05-21 20:38 ` Joel Brobecker
2008-05-21 19:58 ` Daniel Jacobowitz
1 sibling, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2008-05-21 19:44 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
> Date: Tue, 20 May 2008 21:50:22 -0700
> From: Joel Brobecker <brobecker@adacore.com>
>
> 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".
Thanks.
> @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}.
I suggest to say "This command can be abbreviated as @code{fin}."
instead of the last sentence.
Other than that, the patch for the manual is okay.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [RFA] Add "fin" alias for "finish"
2008-05-21 19:44 ` Eli Zaretskii
@ 2008-05-21 20:38 ` Joel Brobecker
0 siblings, 0 replies; 4+ messages in thread
From: Joel Brobecker @ 2008-05-21 20:38 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
> > @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}.
>
> I suggest to say "This command can be abbreviated as @code{fin}."
> instead of the last sentence.
Your suggestion sounds much better indeed. Thanks!
> Other than that, the patch for the manual is okay.
Code, testcase and documentation now checked in, with the modifications
suggested by Eli.
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFA] Add "fin" alias for "finish"
2008-05-21 15:26 [RFA] Add "fin" alias for "finish" Joel Brobecker
2008-05-21 19:44 ` Eli Zaretskii
@ 2008-05-21 19:58 ` Daniel Jacobowitz
1 sibling, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2008-05-21 19:58 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
On Tue, May 20, 2008 at 09:50:22PM -0700, Joel Brobecker wrote:
> 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.
I think this is an excellent idea and with Eli's comment, it seems
fine to me. I use "fin" all the time.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-05-21 18:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-21 15:26 [RFA] Add "fin" alias for "finish" Joel Brobecker
2008-05-21 19:44 ` Eli Zaretskii
2008-05-21 20:38 ` Joel Brobecker
2008-05-21 19:58 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox