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: Tracing code memcpy()-ied to a new location


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


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