This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC/RFA] gdb.cp/classes.exp: Don't try to print local variable out of scope
- From: mec dot gnu at mindspring dot com (Michael Elizabeth Chastain)
- To: gdb-patches at sources dot redhat dot com, vinschen at redhat dot com
- Date: Tue, 9 Mar 2004 11:15:07 -0500 (EST)
- Subject: Re: [RFC/RFA] gdb.cp/classes.exp: Don't try to print local variable out of scope
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.
That means my intutition is faulty. :(
> I tested the whole gdb.cp testsuite on linux-x-sh with and without the
> patch and the only difference in the testsuite output where the tests
> directly affected by this change:
I still want to add a copyright notice to misc.cc, and then clone the
file, and then make the change only in classes.cc. I think it's a bit
better for every test script to have a dedicated unique test program.
Michael C