This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Tracing code memcpy()-ied to a new location
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Paolo Pisati <p dot pisati at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Wed, 4 May 2011 14:55:32 +0200
- Subject: Re: Tracing code memcpy()-ied to a new location
- References: <4DC02372.6040409@gmail.com> <4DC026CF.6020709@gmail.com>
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