This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: problem with debugging local scoped symbols on MIPS
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Don Bowman <don at sandvine dot com>
- Cc: "'gdb at sources dot redhat dot com'" <gdb at sources dot redhat dot com>
- Date: Mon, 19 Aug 2002 11:31:37 -0400
- Subject: Re: problem with debugging local scoped symbols on MIPS
- References: <FE045D4D9F7AED4CBFF1B3B813C853371BC1AE@mail.sandvine.com>
On Thu, Jan 31, 2002 at 05:17:10PM -0500, Don Bowman wrote:
>
> 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()
> {
> int i;
> i = 1;
> for (int j = 0; j < 2; j++)
> {
> i+= 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).
FYI, with GCC 3.0.1 I get similar debug output and GDB handles "j" just
fine (mipsel-linux); it shows in info locals and its value is correct.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer