From: Joel Brobecker <brobecker@adacore.com>
To: "Jose E. Marchesi" <jose.marchesi@oracle.com>
Cc: Sergio Durigan Junior <sergiodj@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH V4 5/9] New probe type: DTrace USDT probes.
Date: Fri, 07 Aug 2015 15:12:00 -0000 [thread overview]
Message-ID: <20150807151232.GD14992@adacore.com> (raw)
In-Reply-To: <87k2t7rxmk.fsf@oracle.com>
> Confirmed: DOF version 2 added support for is-enabled probes, and the
> struct dtrace_dof_provider got a new 4 bytes field:
>
> @@ -719,6 +722,7 @@ typedef struct dof_provider {
> dof_attr_t dofpv_funcattr; /* function attributes */
> dof_attr_t dofpv_nameattr; /* name attributes */
> dof_attr_t dofpv_argsattr; /* args attributes */
> + dof_secidx_t dofpv_prenoffs; /* link to DOF_SECT_PRENOFFS section */
> } dof_provider_t;
>
> Looks like your solaris-x86 binaries are embedding DOFv1 programs. You
> can check that by looking at dof->dofh_ident[6]: it will be 1 in a DOFv1
> program and 2 in a DOFv2 program.
I think I can confirm that. This is the contents of the .SUNW_dof
section for the .so file:
Contents of section .SUNW_dof:
b4398 7f444f46 01010102 08080000 00000000 .DOF............
^^
||
> 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.
Sure. I would perhaps also consider the idea of not support DOF v1,
if v1 support is only of marginal value.
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)
--
Joel
next prev parent reply other threads:[~2015-08-07 15:12 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-02 10:57 [PATCH V4 0/9] Add support for DTrace USDT probes to gdb Jose E. Marchesi
2015-02-02 10:57 ` [PATCH V4 1/9] Adapt `info probes' to support printing probes of different types Jose E. Marchesi
2015-02-17 1:12 ` Sergio Durigan Junior
2015-02-02 10:57 ` [PATCH V4 9/9] Announce the DTrace USDT probes support in NEWS Jose E. Marchesi
2015-02-02 16:03 ` Eli Zaretskii
2015-02-02 10:57 ` [PATCH V4 7/9] Simple testsuite for DTrace USDT probes Jose E. Marchesi
2015-02-02 11:18 ` Jose E. Marchesi
2015-02-17 1:53 ` Sergio Durigan Junior
2015-02-17 1:58 ` Sergio Durigan Junior
2015-02-17 11:32 ` Pedro Alves
2015-02-02 10:57 ` [PATCH V4 3/9] New commands `enable probe' and `disable probe' Jose E. Marchesi
2015-02-02 16:01 ` Eli Zaretskii
2015-02-17 1:54 ` Sergio Durigan Junior
2015-02-02 10:57 ` [PATCH V4 4/9] New gdbarch functions: dtrace_parse_probe_argument, dtrace_probe_is_enabled, dtrace_enable_probe, dtrace_disable_probe Jose E. Marchesi
2015-02-17 1:14 ` Sergio Durigan Junior
2015-02-02 10:57 ` [PATCH V4 6/9] Support for DTrace USDT probes in x86_64 targets Jose E. Marchesi
2015-02-17 1:37 ` Sergio Durigan Junior
2015-02-02 10:57 ` [PATCH V4 2/9] Move `compute_probe_arg' and `compile_probe_arg' to probe.c Jose E. Marchesi
2015-02-17 1:13 ` Sergio Durigan Junior
2015-02-02 10:57 ` [PATCH V4 8/9] Documentation for DTrace USDT probes Jose E. Marchesi
2015-02-02 16:03 ` Eli Zaretskii
2015-02-02 19:47 ` Jose E. Marchesi
2015-02-02 10:57 ` [PATCH V4 5/9] New probe type: " Jose E. Marchesi
2015-02-17 1:35 ` Sergio Durigan Junior
2015-03-25 19:14 ` Joel Brobecker
2015-03-26 16:15 ` Jose E. Marchesi
2015-03-26 17:50 ` Joel Brobecker
2015-03-26 18:43 ` Joel Brobecker
2015-03-26 18:53 ` Sergio Durigan Junior
2015-03-26 21:00 ` Joel Brobecker
2015-03-27 9:47 ` gdb fails to compile with GCC 4.4.7 (was: [PATCH V4 5/9] New probe type: DTrace USDT probes.) Tobias Burnus
2015-03-27 13:42 ` Joel Brobecker
2015-03-27 15:18 ` Tobias Burnus
2015-03-27 15:27 ` [pushed] " Joel Brobecker
2015-03-27 16:58 ` H.J. Lu
2015-03-26 23:39 ` [PATCH V4 5/9] New probe type: DTrace USDT probes Jose E. Marchesi
2015-03-31 17:29 ` Jose E. Marchesi
2015-03-31 18:47 ` Joel Brobecker
2015-03-31 19:54 ` Jose E. Marchesi
2015-08-06 21:31 ` Joel Brobecker
2015-08-07 2:03 ` Sergio Durigan Junior
2015-08-07 15:20 ` Joel Brobecker
2015-08-07 13:05 ` Jose E. Marchesi
2015-08-07 13:14 ` Jose E. Marchesi
2015-08-07 14:11 ` Jose E. Marchesi
2015-08-07 15:12 ` Joel Brobecker [this message]
2015-08-10 3:21 ` Sergio Durigan Junior
2015-08-10 14:31 ` Jose E. Marchesi
2015-02-16 13:20 ` [PATCH V4 0/9] Add support for DTrace USDT probes to gdb Jose E. Marchesi
2015-02-17 1:57 ` Sergio Durigan Junior
2015-02-17 11:56 ` Jose E. Marchesi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150807151232.GD14992@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=jose.marchesi@oracle.com \
--cc=sergiodj@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox