This is the mail archive of the gdb@sources.redhat.com 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]

Accessing variables in .sdata


Hi all,

I've been trying to characterize the types of variables I
can't access when using a linker script during the construction
of our bootable image. The linker script in question is a 
slightly modified one from ppcboot and I can't see any 
fundamental problems with the script.

I've been dumping the map file during the link and comparing
the one that the linker internally generates to the one that
results from our supplied linker map. I'm seeing a different
location for the .text,.bss,.data segments and some other 
ordering differences, but again nothing fundamentally wrong. 

But my problem persists. If I use a linker script and try to
print the value of a variable in a .sdata I'm presented with
the gdb error "Cannot access memory at address 0x...". Where
address 0xABCD.. is no where near where the map file says 
that section and variable should be found. It's like gdb is
missing the offset of the sections.

I've also tried using add-symbol-file to force gdb to recognize
the start address for the various sections, but at best I see
the error address moving around. 

I've been told from people around the office that if they load
the symbol file multiple times the error address changes and
they can breakpoint functions, but not usually inside a 
function.

I've been searching the mailing lists and the problem described
in: http://mail.gnu.org/archive/html/bug-gdb/2001-02/msg00015.html
Sounds very similar, but I've been wrong before. 

Any ideas ?

Bruce

-- 
Bruce Ashfield         | "Thou shalt not follow the NULL pointer, for
                       |  chaos and madness await thee at its end."
                       |       - unknown


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