Subject: Re: gdb versus threads?
To: Ben Collver <collver@peak.org>
From: Nathan J. Williams <nathanw@wasabisystems.com>
List: netbsd-users
Date: 05/29/2006 11:21:58
Ben Collver <collver@peak.org> writes:

> I am having trouble printing some variables in GDB on NetBSD/i386 3.0.
> A friendly bird told me that it may be related to threads, and that the
> -current gdb6 (not pkgsrc) sources may help.  I tried building gdb6 on
> NetBSD 3.0 from -current sources, but it did not help.

> (gdb) p pos
> Error accessing memory address 0x24: Invalid argument.
> (gdb) info address pos
> Symbol "pos" is a local variable at frame offset 36.

> Any recommendations?

It's not blantantly thread-related, but it could be (note that gdb6
has no native thread support, so that's not the problem). What do
"info registers", "info frame", and "backtrace" show you? Something
thinks that the frame has an address of 0, which is why it's looking
at 0+0x24 in memory, and that's pretty clearly wrong. Figuring out
why the debugger thinks that about the frame is important.

On a lark, do you get different results if you compile with "-gdwarf-2 -O0"?

        - Nathan