Skip to contentSkip to conversation

debugging relocated code

U-Boot-Users Stuart Yoder 3 participants 3 messages May 25, 2004

lore
Share & tools
lore
#0 lore raw

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20040525/134811b6/attachment.htm

#1 lore raw

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 at 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

#2 lore raw
In reply to Stuart Yoder
Quoted 2 lines · 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.

Quoted 1 line

Anyone know of a way in gdb to relocate all the symbols?

Sure. See http://www.denx.de/twiki/bin/view/DULG/WrongDebugSymbolsAfterRelocation

Quoted 6 lines

------=_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

Signature · 6 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Is not that the nature of men and women -- that the  pleasure  is  in
the learning of each other?
	-- Natira, the High Priestess of Yonada, "For the World is
	   Hollow and I Have Touched the Sky", stardate 5476.3.