This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Ensure correct symbol-file when attaching to a (remote) process
- From: Martin Runge <martunge at googlemail dot com>
- To: Pedro Alves <palves at redhat dot com>, gdb at sourceware dot org
- Cc: John Gilmore <gnu at toad dot com>, Jan Kratochvil <jan dot kratochvil at redhat dot com>, Raphael Zulliger <zulliger at indel dot ch>
- Date: Sat, 12 Jan 2013 11:58:55 +0100
- Subject: Re: Ensure correct symbol-file when attaching to a (remote) process
- References: <50D3FC31.1020103@indel.ch> <20121221161114.GA32638@host2.jankratochvil.net> <201212211917.qBLJH6Il028006@new.toad.com> <50E474E3.7050605@redhat.com>
I would really like to see such a feature in gdb, too. Our projects
are Linux based, but the problem remains the same. We tried a self
made patch that compared the most important sections of host and
target binaries as a whole. Our projects are quite large (~260 MB
stripped binaries) and that patch caused extra 30-60 seconds startup
time for debugging, so we removed it again.
in gdb 7.3 I see a similar feature already build in. I see warnings like this:
warning: the debug information found in "/lib/libname.so" does not
match "/lib/libname.so" (CRC mismatch).
It shows up for all DSOs, that do not match between host and target,
e.g. if the solib search path is not set correctly and gdb on the host
looks at the host's library instead of the one that matches the
target's.
Who does this compare to your patch?
2013/1/2 Pedro Alves <palves@redhat.com>:
> On 12/21/2012 07:17 PM, John Gilmore wrote:
>> The best you can do in an automated way is to check the areas
>> of memory that are intended to contain instructions and read-only
>> data.
>
> For bare metal targets, that's often good enough, and GDB does have
> support that built in:
>
> (gdb) help compare-sections
> Compare section data on target to the exec file.
> Argument is a single section name (default: all loaded sections).
>
> A build id check would really be ideal.
>
> --
> Pedro Alves
>