Tracing code memcpy()-ied to a new location

Jan Kratochvil jan.kratochvil@redhat.com
Wed May 4 12:55:00 GMT 2011


On Tue, 03 May 2011 18:01:19 +0200, Paolo Pisati wrote:
> So here is the question: since i know there is relocate_new_kernel() in
> that location, is there a way to tell gdb to "remap" the
> symbols/environment/$whatever of that routine in that location so i can
> keep debugging it?

(gdb) help add-symbol-file
Load symbols from FILE, assuming FILE has been dynamically loaded.
Usage: add-symbol-file FILE ADDR [-s <SECT> <SECT_ADDR> -s <SECT> <SECT_ADDR> ...]
ADDR is the starting address of the file's text.
The optional arguments are section-name section-address pairs and
should be specified if the data and bss segments are not contiguous
with the text.  SECT is a section name to be loaded at SECT_ADDR.

So ADDR is not the starting address (reboot_code_buffer) but you must also add
to it the VMA of the .text section of FILE (see `readelf -WS FILE').


Regards,
Jan



More information about the Gdb mailing list