[RFC/RFA] gdb.cp/classes.exp: Don't try to print local variable out of scope
Andrew Cagney
cagney@gnu.org
Tue Mar 9 20:38:00 GMT 2004
> 1 void foo ()
> 2 {
> 3 int i = 1;
> 4 {
> 5 int i = 2;
> 6 bar(i);
> 7 }
> 8 bar (i);
> 9 }
>
> cv> Is line 7 still in the scope of the inner definition of variable `i'?
> cv> Which `i' should be printed at that point?
>
> My intuition says that the inner "i" is in scope at line 7.
Yes, the inner "i" should be in scope. That line, which hasn't yet been
executed, will destory the inner block. I think that is covered by the
GCC-O0 rule?
Andrew
More information about the Gdb-patches
mailing list