This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
RE: Symbol address quirkiness
- From: "Padlar, Sunil S (STSD)" <sunil dot s at hp dot com>
- To: "Shaun Jackman" <sjackman at gmail dot com>, <gdb at sources dot redhat dot com>
- Date: Mon, 26 Jun 2006 14:07:55 +0530
- Subject: RE: Symbol address quirkiness
Hi Shaun,
You need to explicitly specify data segment offset as follows:
add-symbol-file ~/work/pathway/user/pic/hello 0x20648e0 -s .data
<address>
Regards,
Sunil S
> -----Original Message-----
> From: gdb-owner@sourceware.org
> [mailto:gdb-owner@sourceware.org] On Behalf Of Shaun Jackman
> Sent: Monday, June 26, 2006 4:28 AM
> To: gdb@sources.redhat.com
> Subject: Symbol address quirkiness
>
> I used `add-symbol-file' and specified an offset and noticed
> two quirky behaviours. Although the offset is added to the
> .text segment, it doesn't seem to be added to the .data
> segment. Also, in the example below, the symbol _impure_ptr
> moves mid-flight! If you need more information to
> trouble-shoot this, I'll by happy to provide.
>
> Cheers,
> Shaun
>
> $ arm-elf-gdb
> ...
> (gdb) symbol-file
> Discard symbol table? (y or n) y
> Hardware assisted breakpoint 2 at 0x20648e4 Error in
> re-setting breakpoint 3:
> No symbol table is loaded. Use the "file" command.
> No symbol file now.
> (gdb) add-symbol-file ~/work/pathway/user/pic/hello 0x20648e0
> add symbol table from file
> "/home/sjackman/work/pathway/user/pic/hello" at
> .text_addr = 0x20648e0
> (y or n) y
> Reading symbols from
> /home/sjackman/work/pathway/user/pic/hello...done.
>
> Hardware assisted breakpoint 2 at 0x20648e4: file
> ../../../../../../libgloss/arm/linux-crt0.S, line 14.
> (gdb) i addr _impure_ptr
> Symbol "_impure_ptr" is static storage at address 0x227c.
> (gdb) i addr impure_data
> Symbol "impure_data" is static storage at address 0x4460.
> (gdb) i addr _impure_ptr
> Symbol "_impure_ptr" is static storage at address 0x44f8.
> (gdb) i addr impure_data
> Symbol "impure_data" is static storage at address 0x4460.
> (gdb) i addr _impure_ptr
> Symbol "_impure_ptr" is static storage at address 0x44f8.
> (gdb) show version
> GNU gdb 6.5.50.20060527-cvs
> $ arm-elf-nm -S hello |grep impure
> 00002680 00000004 D _global_impure_ptr
> 0000227c 00000004 D _impure_ptr
> 00002280 00000400 d impure_data
>