This is the mail archive of the
mailing list for the GDB project.
problem printing global variables in a shared library
- From: "Rajeev Bhaskaran" <rajeevb at gmail dot com>
- To: gdb at sourceware dot org
- Date: Sat, 31 Mar 2007 12:12:46 +0530
- Subject: problem printing global variables in a shared library
I am using gdb 6.5 to debug programs on linux 2.6.14-7, PQ3(MPC8555E) processor.
The global variables(initialized) in a shared library are printed
incorrectly(junk) by gdb print command.
Printing the same variables from program being debugged using printf,
displays the correct value.
The same problem is noticed while printing values of "errno" global variable.
If the global variable in shared library is declared as a static type,
it is displayed correctly by gdb.
Code optimization is turned off while debugging. No problems with
global variables in an executable.
Problem is seen during remote debugging(with gdbserver) as well as
during direct debugging on target with gdb.
Please help. Any clues on what could i be doing wrong ?