[PATCH]PR 4886: validate debuginfo based on build-id
David Smith
dsmith@redhat.com
Wed Jul 16 17:28:00 GMT 2008
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)
More information about the Systemtap
mailing list