[bug] problem printing local vars in shared lib function

Michael Snyder msnyder@vmware.com
Mon Oct 27 23:10:00 GMT 2008

Does this sound familiar to anybody?  X86_64...

I have a local shared library function, built with -g,
gdb has its symbols and can list it, step into it, step
within it etc.

I can print the values of the function parameters, but
not the values of local (automatic) variables.  These
are not statics but autos on the stack.

GDB complains that the memory is inaccessible when
I use "print", but if I use "examine" ('x'), it works
fine and displays the value.

Doesn't seem to matter what the type of the variable is.

Stack variables in the main executable program (ie. not
in the shared library) work fine.

I've even tried this with -gstabs as opposed to dwarf.
Same symptom.

Executable: GNU gdb 6.8-debian
OS: Ubuntu Hardy (8.0.4) x86_64, kernel 2.6.24-19-generic

More information about the Gdb mailing list