This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 0/4] Improve "show style", use style in "help" and "apropos".
>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:
Philippe> Note that I am envisaging to do a small addition
Philippe> to the 'define' command so as to make it slightly
Philippe> easier to write a 'define wrapper shortcut' around
Philippe> a 'with command'.
Philippe> Something like:
Philippe> define Lc
Philippe> with language c -- $arg@
Philippe> end
Philippe> But the 'define' parser seems to not understand that
Philippe> a 'with' line can start an 'if' that needs a
Philippe> corresponding 'end'.
I'm surprised "with if" is intended to work, but if it is, then that's
just a bug.
If it needs special handling for "if" it will probably also need it for
the other multi-line commands.
Philippe> Alternatively, we should allow alias to accept 'arguments':
Philippe> Instead of:
Philippe> (gdb) alias Lc = with language c --
Philippe> Invalid command to alias to: with language c --
I think that would be a reasonable addition. I was surprised this
wasn't done initially.
Philippe> I have in a corner a patch that allows to add default arguments to
Philippe> a command or an alias, which gives more or less the above, but using
Philippe> 2 successive actions:
Philippe> (gdb) alias bt2 = bt
Philippe> (gdb) help add-args
Philippe> Specify additional arguments to preprend to user provided command arguments.
Philippe> Usage: add-args COMMAND [= ADDITIONAL_ARGS...]
Philippe> Allows to specify or clear the additional arguments automatically
Philippe> prepended to the user provided arguments when COMMAND is run.
I am not so sure about this. It seems pretty obscure. Maybe a more
gdb-ish way of doing this would be to introduce "set" parameters to
control the defaults of the relevant commands.
Philippe> So, maybe I should finalize an RFA for this add-args idea in preference
Philippe> to the 'alias argument idea' and/or to the '$arg@' idea.
I'm also not sure about the $arg@ idea, or maybe just the spelling of
it.
Tom