This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH V4 5/9] New probe type: DTrace USDT probes.
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: "Jose E. Marchesi" <jose dot marchesi at oracle dot com>, gdb-patches at sourceware dot org
- Date: Sun, 09 Aug 2015 23:21:00 -0400
- Subject: Re: [PATCH V4 5/9] New probe type: DTrace USDT probes.
- Authentication-results: sourceware.org; auth=none
- References: <87r3tp722i dot fsf at redhat dot com> <20150325191418 dot GA32233 at adacore dot com> <87bnjfraq1 dot fsf at oracle dot com> <20150326175028 dot GA13867 at adacore dot com> <87y4mdjcie dot fsf at oracle dot com> <20150331184727 dot GF13867 at adacore dot com> <878uedey48 dot fsf at oracle dot com> <20150806213103 dot GC14992 at adacore dot com> <874mkb9qv9 dot fsf at oracle dot com> <87k2t7rxmk dot fsf at oracle dot com> <20150807151232 dot GD14992 at adacore dot com>
On Friday, August 07 2015, Joel Brobecker wrote:
>> So... we can make GDB to look at the DOF version and then use a
>> different struct (struct dof_provider_v1 ?) when handling embedded
>> programs using the old format.
>>
>> I can prepare a patch for this. For testing purposes pdtrace can be
>> made to generate DOFv1 programs even in systems lacking an old enough
>> dtrace.
Thanks, Jose. That would be much appreciated.
> Also, I didn't say it before, I wasn't so sure that casting a binary
> stream to a structure to read its contents was the best way to do
> things. It can of works, but makes the code a little harder to read,
> IMO, because accessing its contents requires the accessor macros.
> Perhaps it might be better to just have decoding routines that take
> the binary data and produce the corresponding struct, with the data
> properly decoded. That way, you can add DOF version checks and decode
> the data differently, without the rest of the code having to worry
> about which version of the type they should be using. It's not obvious
> to me that this way is better than the current way, but that's how
> I would have tried it first... (just my 2 cents)
I agree. Something else really worth doing is creating a debug setting
for DTrace probes, and print useful information while decoding them.
Almost all (if not all) the information that Joel gathered using
external tools could have been printed from inside GDB.
Cheers,
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/