[PATCH] gdb: add "-a" option for inferior commands

Simon Marchi simon.marchi@polymtl.ca
Wed Feb 22 21:11:00 GMT 2017


On 2017-02-22 16:06, Spencer Baugh wrote:
> Andreas Schwab <schwab@linux-m68k.org> writes:
>> On Feb 21 2017, Spencer Baugh <sbaugh@catern.com> wrote:
>> 
>>> Andreas Schwab <schwab@linux-m68k.org> writes:
>>>> On Dez 29 2016, Spencer Baugh <sbaugh@catern.com> wrote:
>>>> 
>>>>> @@ -1055,8 +1101,8 @@ as main program."));
>>>>>    set_cmd_completer (c, filename_completer);
>>>>> 
>>>>>    add_com ("remove-inferiors", no_class, remove_inferior_command, 
>>>>> _("\
>>>>> -Remove inferior ID (or list of IDs).\n\
>>>>> -Usage: remove-inferiors ID..."));
>>>>> +Remove inferior ID (or list of IDs, or all inferiors with -a).\n\
>>>>> +Usage: remove-inferiors [-a] ID..."));
>>>> 
>>>> What is the meaning of ID if -a is present?
>>> 
>>> ID is ignored if -a is present.
>> 
>> Shouldn't ID be optional then?
> 
> Like this then?
> 
> Usage: remove-inferiors [-a] [ID...]
> 
> I was just concerned that that doesn't indicate that one of them must 
> be
> present. Not sure what the convention is to indicate that.

An option would be to have multiple lines.  Not sure how to format it, 
but something like:

   (gdb) help remove-inferiors
   Remove inferior ID (or list of IDS)
   Usage: remove-inferiors ID...

   Remove all inferiors
   Usage: remove-inferiors -a

It would be nice to decide on a standard format for help messages, kind 
of like man pages always have the same format.

Simon



More information about the Gdb-patches mailing list