This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH V2 3/9] New commands `enable probe' and `disable probe'.
- From: Pedro Alves <palves at redhat dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: "Jose E. Marchesi" <jose dot marchesi at oracle dot com>, Doug Evans <dje at google dot com>, gdb-patches at sourceware dot org
- Date: Fri, 17 Oct 2014 12:23:07 +0100
- Subject: Re: [PATCH V2 3/9] New commands `enable probe' and `disable probe'.
- Authentication-results: sourceware.org; auth=none
- References: <1412961772-16249-1-git-send-email-jose dot marchesi at oracle dot com> <1412961772-16249-4-git-send-email-jose dot marchesi at oracle dot com> <21560 dot 22449 dot 803178 dot 90104 at ruffy2 dot mtv dot corp dot google dot com> <878uknun2f dot fsf at oracle dot com> <5440649C dot 6080705 at redhat dot com> <54406623 dot 2020802 at redhat dot com> <87iojjfmv6 dot fsf at redhat dot com>
On 10/17/2014 03:31 AM, Sergio Durigan Junior wrote:
> On Thursday, October 16 2014, Pedro Alves wrote:
>
>> This also raises the question, can't we have both a stap
>> probe and a dtrace probe with the name provider and name? Like,
>> using the proposed output that doesn't distinguish the probe types,
>> can't the user end up with the confusing:
>>
>> Provider Name Where Semaphore Enabled Object
>> demo am-main 0x0000000000400c96 n/a /home/jemarch/oracle/usdt/demo
>> demo am-main 0x0000000000400c8b n/a always /home/jemarch/oracle/usdt/demo
>>
>> Does GDB cope correctly with this? Will the user have
>> trouble specifying the probe he wants with the current UI?
>
> Aha, a good question :-P.
>
> Well, you can actually test this with current GDB, without even needing
> dtrace:
>
> (gdb) info probes
> Provider Name Where Semaphore Object
> test bla 0x00000000004004f4 a.out
> test bla 0x00000000004004f5 a.out
> (gdb) b -p bla
> Breakpoint 1 at 0x4004f4 (2 locations)
>
> You have basically two ways of specifying where the probe breakpoint is
> going to be located: either by using -probe (or -p), or using
> -probe-[type] (or -p[type]). The second way is not problematic, because
> you tell GDB that type you want explicitly, so there is no confusion.
> However, in the first way, you put a breakpoint in a "probe" (the type
> is not important here, only the probe name/provider). GDB will then try
> to see if any of the probe backends have probes with this name, and will
> put a breakpoint on every probe it finds (again, no matter which type).
>
> The logic for this is in gdb/probe.c:parse_probes, if you are
> interested.
>
> This is already working (as you can see in my example above), and Jose's
> patch does not touch it, so we are pretty much covered in this area.
Excellent, thank you.
> Nonetheless, I think it is a good idea to add one more field to the
> output of 'info probes', specifying the probe type.
Thanks,
Pedro Alves