gdb: this means what?

Posted by Zeno on Tue 08 Apr 2008 10:57 PM — 4 posts, 18,896 views.

USA #0
I had -O on by accident:
(gdb) f 0
#0  0x0000000000408b0b in talk_channel (ch=0x16af620, argument=0x7fffb238b73c ">.>", channel=41, verb=<value optimized out>)
    at act_comm.c:617
617         if ( (vch->pcdata && vch->pcdata->bestowments
(gdb) p vch
No symbol "vch" in current context.


So I turned it off (new core):
(gdb) p vch
$1 = (CHAR_DATA *) 0x171f9d0
Missing separate debuginfos, use: debuginfo-install e2fsprogs.x86_64 glibc.x86_64 keyutils.x86_64 krb5.x86_64 libselinux.x86_64 mysql.x86_64 openssl.x86_64 zlib.x86_64


Very confused.
Amended on Tue 08 Apr 2008 10:58 PM by Zeno
Australia Forum Administrator #1
OK, so now it found the symbol, and it is trying to print it. So you have advanced.

Have you compiled with the -g3 flag to output symbol information?

If so, you could always try running the suggested install. That might fix it.
USA #2
Hm, I had -g2 on not -g3.

Still a bit confused why it told me "No symbol "vch" in current context."

I have never had that issue in the past. If I'm in the frame, I was always able to print all local vars.
Australia Forum Administrator #3
See: http://www.gammon.com.au/forum/?id=8584&page=1

Half-way down the page I quote from the gcc manual. With optimization on "some variables you declared may not exist at all".

That is "some variables", not all variables. You were lucky last time.