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 apologize: I've replied to this mail some weeks ago - but forgot to CC to the list. I therefore resend this email)

On 12/21/2012 10:11 PM, Aleksandar Ristovski wrote:
Interesting timing. I have just posted http://sourceware.org/ml/gdb-patches/2012-12/msg00776.html addressing this issue.
Indeed . Thanks!

The check is not exhaustive, but for most practical purposes it should suffice. It verifies that in-memory elf header and pheaders match those found in the bfd.


Of course it will not detect difference in all cases, e.g. very small changes that do not affect loadable segment size. Example:

- static int foo;
- static int bar;
+ static int bar;
+ static int foo;

Still, it should be much better than no check at all.
I'm not very familiar with ELF header information... But after to some quick investigation, it seems that this mechanism "only" helps to detect changes that affect "changes in size" or "changes of address", right?

Moreover, if I understood it correctly, we'd have a fundamental problem using this mechanism in our scenario: We don't download the ELF file to the embedded system. Instead, we process the ELF file with objcopy (-Osrec) on the developer system and only download the produced SREC file - which contains no ELF header information anymore.


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