This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PATCH: dont_repeat() at top level while defining
- From: Daniel Jacobowitz <drow at false dot org>
- To: Christopher SMITH <chris dot smith at st dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 21 Aug 2007 09:35:04 -0400
- Subject: Re: PATCH: dont_repeat() at top level while defining
- References: <46AF67C1.30004@st.com>
On Tue, Jul 31, 2007 at 05:48:01PM +0100, Christopher SMITH wrote:
> Hi all!
>
> One of our users just got caught out by the fact that the repeat-on-enter
> functionality works while using "define", but only at the top level. Inside a
> sub-block, it is suppressed with dont_repeat().
>
> It seemed more sensible to us to suppress it at the top level too, as per this
> patch. What do you think?
Let's see what happens now:
(gdb) define bar
Type commands for definition of "bar".
End with a line saying just "end".
>
>end
(gdb) bar
Redefine command "bar"? (y or n) [answered Y; input not from terminal]
end
(gdb)
Whoops! "define bar" repeated into the body of the user-defined
command. I agree that this is unhelpful.
> 2007-07-31 Chris Smith <chris.smith@st.com>
>
> * cli-script.c (read_command_lines): Call dont_repeat() for each line.
No parentheses after the name of the function, please - dont_repeat is
a function you can call, dont_repeat () is an expression. Also
careful of the line length limits.
> + dont_repeat();
Space between the name of a function and the parentheses.
Otherwise this patch is fine. I checked it in for you. Thanks!
--
Daniel Jacobowitz
CodeSourcery