This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Ensure correct symbol-file when attaching to a (remote) process


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
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]