This is the mail archive of the
mailing list for the GDB project.
problem with debugging local scoped symbols on MIPS
- From: Don Bowman <don at sandvine dot com>
- To: "'gdb at sources dot redhat dot com'" <gdb at sources dot redhat dot com>
- Date: Thu, 31 Jan 2002 17:17:10 -0500
- Subject: problem with debugging local scoped symbols on MIPS
I'm not sure if this is a problem with GDB or GCC or GAS,
so any help would be appreciated.
I take a very simple file:
extern "C" void printf(const char *, ...);
extern "C" void testFunc()
i = 1;
for (int j = 0; j < 2; j++)
printf("%d %d\n", i, j);
and compile it with gcc 3.0.3 and gas 2.11.2 for MIPS (mips-wrs-vxworks).
This is a little-endian ELF mips platform. I'm cross-compiling
from cygwin (but I don't think that matters).
Now, in gdb, the 'i' variable is all good, but 'j' doesn't
exist as far as gdb knows. info locals just shows 'i',
regardless of which line I'm on. Now, from the shell of
gdb, if I do 'p j', I get something like "$1 = 106". Next
time I run it I get "$2 = 106". I don't know what this means.
gdb is configured for mips-wrs-vxworks (again cross from cygwin).
The .stab stuff is below. I removed all the assembly and other
things. I see that "j" is noticed, 5 lines from the bottom.
But gdb seems to have no knowledge. Any suggestions on where
I should look? I've tried -ggdb, -gstabs, -gstabs+, -gcoff, but
I get the same affect.