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: jose dot marchesi at oracle dot com (Jose E. Marchesi)
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Sergio Durigan Junior <sergiodj at redhat dot com>, gdb-patches at sourceware dot org
- Date: Fri, 27 Mar 2015 00:45:26 +0100
- Subject: Re: [PATCH V4 5/9] New probe type: DTrace USDT probes.
- Authentication-results: sourceware.org; auth=none
- References: <1422874968-382-1-git-send-email-jose dot marchesi at oracle dot com> <1422874968-382-6-git-send-email-jose dot marchesi at oracle dot com> <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>
> Could you please send me your sparc-solaris reproducer?
Thanks for the offer to help! Sadly, the SEGV doesn't seem to
happen on sparc-solaris, it seems. Once I apply the patch above,
I pretty much get normal results back (yay!).
So, the problem appears to be specific to x86-solaris. I didn't know
the DOF program was embedded in the executable, but I suspect there is
a problem in its contents. How do you think we should proceed?
Hmm, this may be an endianness problem:
/* DOF supports two different encodings: MSB (big-endian) and LSB
(little-endian). The encoding is itself encoded in the DOF header.
The following function returns an unsigned value in the host
endianness. */
#define DOF_UINT(dof, field) \
extract_unsigned_integer ((gdb_byte *) &(field), \
sizeof ((field)), \
(((dof)->dofh_ident[DTRACE_DOF_ID_ENCODING] \
== DTRACE_DOF_ENCODE_MSB) \
? BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE))
We know for a fact that the implementation works properly on a
little-endian host (x86) and little-endian DOF data (generated by either
pdtrace or dtrace).
I would need to look at the x86-solaris binaries you are using. Maybe
dtrace on that platform is generating big-endian DOF data in the
little-endian platform and the implementation is not handling that
properly.