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]

Re: problem with debugging local scoped symbols on MIPS


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


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