[U-Boot-Users] debugging relocated code

What is typically done to debug relocated code with gdb? For example, u-boot is linked at 0xFFF0000, but then relocates itself to 0x0FF03000. The debug symbols all reference the linked location. After the relocation occurs gdb is lost as far as symbolic information goes.
Am I supposed to link the code to the place I know it will end up after relocation?
Anyone know of a way in gdb to relocate all the symbols?
Thanks,
Stuart Yoder

Message Hi Stuart,
Try the 'add-symbol-file' command. It relocates symbols to specified address. In your case, you can relocate symbols by following commands.
gdb> add-symbol-file u-boot 0x0ff03000 gdb> file u-boot
You may find more information in gdb manual.
Sincerely, Ho
----- Original Message ----- From: Stuart Yoder To: u-boot-users@lists.sourceforge.net Sent: Tuesday, May 25, 2004 11:27 AM Subject: [U-Boot-Users] debugging relocated code
What is typically done to debug relocated code with gdb? For example, u-boot is linked at 0xFFF0000, but then relocates itself to 0x0FF03000. The debug symbols all reference the linked location. After the relocation occurs gdb is lost as far as symbolic information goes.
Am I supposed to link the code to the place I know it will end up after relocation?
Anyone know of a way in gdb to relocate all the symbols?
Thanks,
Stuart Yoder

In message 001601c44286$0328e880$2900a8c0@foundation you wrote:
What is typically done to debug relocated code with gdb? For example,
This requires a two-pass sort of solution. In the first pass, read the FAQ.
Anyone know of a way in gdb to relocate all the symbols?
Sure. See http://www.denx.de/twiki/bin/view/DULG/WrongDebugSymbolsAfterRelocation
------=_NextPart_000_0017_01C4425C.1A52E080 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
And never, never post HTML to this list, please!
Best regards,
Wolfgang Denk
participants (3)
-
Ho Lee
-
Stuart Yoder
-
Wolfgang Denk