This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH]PR 4886: validate debuginfo based on build-id
- From: David Smith <dsmith at redhat dot com>
- To: Wenji Huang <wenji dot huang at oracle dot com>
- Cc: systemtap at sources dot redhat dot com
- Date: Wed, 16 Jul 2008 12:27:32 -0500
- Subject: Re: [PATCH]PR 4886: validate debuginfo based on build-id
- References: <487C30BE.3070706@oracle.com>
Wenji Huang wrote:
> The patch is to provide sanity check of debuginfo(PR 4886) based on
> build-id, as described in
> http://fedoraproject.org/wiki/Releases/FeatureBuildId.
>
> There are some requisites for it to work:
> binutils-2.17.50.0.17 or later
> Kernel 2.6.23 or later
> elfutils 0.128 or later (compilation required)
> Otherwise, the check will be skipped.
>
> Already done some tests on x86/x86_64, relocate/non-relocate kernel.
>
> Any comment/reply are welcome.
>
> Regards,
> Wenji
I have a comment on one bit:
+ q->sess.build_id_len = build_id_len;
+ void *copy = malloc(build_id_len);
+ q->sess.build_id_bits = (unsigned char *)memcpy(copy,
+ build_id_bits,
+ build_id_len);
I'd probably do that a bit differently. I'd make 'build_id_bits' a
'string' variable and use the resize() method to set the correct size,
then you might be able to use memcpy directly into the string using the
c_str() method as a destination. You might also be able to replace the
memcpy() with the append() method.
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)