This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: dont_repeat() at top level while defining


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]