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] Add the -catch-load and -catch-unload MI commands.


On 08/30/2012 06:52 PM, Marc Khouzam wrote:
> 
>> -----Original Message-----
>> From: Mircea Gherzan [mailto:mircea.gherzan@intel.com] 
>> Sent: Thursday, August 30, 2012 1:47 PM
>> To: Marc Khouzam
>> Cc: 'gdb-patches@sourceware.org'; 'mgherzan@gmail.com'
>> Subject: Re: [PATCH] Add the -catch-load and -catch-unload MI 
>> commands.
>>
>> On 30.08.2012 16:43, Marc Khouzam wrote:
>>>
>>>> -----Original Message-----
>>>> From: gdb-patches-owner@sourceware.org
>>>> [mailto:gdb-patches-owner@sourceware.org] On Behalf Of 
>> Mircea Gherzan
>>>> Sent: Thursday, August 30, 2012 5:52 AM
>>>> To: gdb-patches@sourceware.org
>>>> Cc: mgherzan@gmail.com; Mircea Gherzan
>>>> Subject: [PATCH] Add the -catch-load and -catch-unload MI commands.
>>>>
>>>> They are equivalent to "catch load" and "catch unload" from CLI.
>>>>
>>>> Rationale: GUIs might be interested in catching solib load or
>>>> unload events.
>>>
>>> I think this can be done with:
>>>   -gdb-set stop-on-solib-events 1
>>>
>>> although I don't believe there is support for regex as
>>> "catch load [regex]".

Yeah, and with catch load, gdb doesn't need to stop at each
and every internal libc solib event, even if nothing seemingly
interesting (in the user's perspective) happened.

>>
>> It's precisely this kind of support that I'm aiming at.
>>
>>> That being said, it may be better to have an MI command to 
>> perform the
>>> "catch" command intead of specifically "catch load".
>>> For example, in Eclipse, we use "catch catch", "catch throw",
>>> "catch exec", "catch fork", "catch vfork", "catch syscall".
>>
>> Please, can you propose a format for such a command family? I 
>> see it like:
>>
>>    -catch --load [params] <regex>
>>    -catch --unload [params] <regex>
> 
> The GDB experts would know better, but I'm thinking of something
> like:
> 
>    -break-catch <load|unload|catch|throw|exec|fork|vfork|syscall> [regexp]

I don't this would be a good idea compared to separate commands.  Each
of those catch variants takes different parameters/options.  I'm not
seeing what putting them all under the same roof would buy.

In the CLI, although "catch exec", "catch fork", "catch syscall", etc.
have the same prefix, they're really implemented as separate commands
as well.

-- 
Pedro Alves


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