This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Add the -catch-load and -catch-unload MI commands.
- From: Pedro Alves <palves at redhat dot com>
- To: Marc Khouzam <marc dot khouzam at ericsson dot com>
- Cc: "'Mircea Gherzan'" <mircea dot gherzan at intel dot com>, "'gdb-patches at sourceware dot org'" <gdb-patches at sourceware dot org>, "'mgherzan at gmail dot com'" <mgherzan at gmail dot com>
- Date: Mon, 10 Sep 2012 15:09:33 +0100
- Subject: Re: [PATCH] Add the -catch-load and -catch-unload MI commands.
- References: <1346320317-1599-1-git-send-email-mircea.gherzan@intel.com> <F7CE05678329534C957159168FA70DEC5E116C3855@EUSAACMS0703.eamcs.ericsson.se> <503FA714.4020206@intel.com> <F7CE05678329534C957159168FA70DEC5E116C3AD4@EUSAACMS0703.eamcs.ericsson.se>
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