BUG: Re: gdb semi-broken in ydl4?

Stefan Bruda bruda at cs.ubishops.ca
Mon Dec 13 15:31:09 MST 2004


At 20:59 +0000 on 2004-12-13 Albrecht Dreß wrote:
 >
 > To answer myself, here is a very simple test case. Try the attached c  
 > code, and run it in gdb, like the following example:

I don't run YDL, but the same happens here (gdb 6.2, gcc 3.4.1, libc
2.3.3).  The culprit seems to be the optimization flag, if I compile 
your code using

    gcc -Wall -Werror -g testprog.c -o testprog

I get after line 11

    (gdb) display r
    1: r = 0x10011008 ""

whilst using the original -O I get the same thing as you do (actually
I get a `No symbol "r" in current context,' but I guess it means the
same thing in the end).  As for why is this happening my guess would
be an improved optimization for the newer compiler that mangles
variables, but your guess is as good as mine.

Hope this helps,
Stefan

-- 
If it was so, it might be; and if it were so, it would be; but as
it isn't, it ain't. That's logic.
    --Lewis Carroll, Through the Looking-Glass


More information about the yellowdog-general mailing list