[uClinux-dev] Symbolic debugging with GDB/GDBserver on ARM/uClinux
jadb at redhat.com
Wed Feb 7 18:53:52 EST 2001
I think the problem on ARM is that the symbols are not necesarily placed
at equivalent alignments. The ELF executable specifies more rigid
alignment for loading than does FLAT (FLAT section origin is nearest
longword, ELF is probably aligned on a page boundary). I think some
careful attention to the elf2flt/ldelf2flt process and the linker
command file could resolve the issue. A good place to start might be to
link the 'debug version' to an origin of 0x58 (the flat header size)
instead of 0x00 so that the alignments could be satisfied. This would
mean that you would end up subtracting this offset from the load address
in the add-symbol-file command.
I think that is how you really want to approach the problem, but of
course I could be wrong ;o)
Stephen Brasher wrote:
> We run a simular architecture on our product, i.e. org-ing the product
> at one address
> and running it at another. To get around the problem, find the location
> of the global
> symbols (pointed to by A5 on the m68k). Once you have this address,
> exit gdb without
> diconnecting, (quit), do an objcopy of the executable with simbols using
> --adjust-section-address=section.name.of.bss=0xaddress obtained above.
> Once this is complete, reconnect to the server and you should be
> pointing to your globals.
> "Thuys, Michiel" wrote:
> Hi All,
> I am running uClinux on an ARM 9. For debugging, I am running gdb on
> the host
> and gdbserver on the target. This enables me to step through the
> assembly code
> and set breakpoints.
> When I want symbolic debugging, I load the symbols from the ELF
> binary by
> issuing the gdb command "add-symbol-file <address of entry point>".
> This way I
> can step through the source code and I can inspect local variables.
> However, I
> can't view global variables because the global symbols are mapped to
> the wrong
> memory addresses.
> Is there anybody who has this working correctly, i.e. can also view
> variables? If so, I'd like to know how!
> Michiel Thuys
> This message resent by the uclinux-dev at uclinux.org list server
> Stephen Brasher Cirilium Corp.
> sbrasher at cirilium.com Tempe, AZ
> Sr Development Engineer
Red Hat, Inc.
307 Wynn Drive
Huntsville AL, 35805
voice : (256)-704-9200
fax : (256)-837-3839
This message resent by the uclinux-dev at uclinux.org list server http://www.uClinux.org/
More information about the uClinux-dev