This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Question concerning "Local Variables" window and missing variables


Hello,  

Please forgive my naivete...  I have generated a very simple C++ program
to outline my question/problem.  When I run the following with Insight,
and I pull up the "Local Variables" window,  it shows that I have
absolutely no local variables no matter where I set a breakpoint.

#include <iostream>
int main()
{
  for (int i(0); i < 10; i++)
    {
      double foo(100.);
      for (int j(10); j < 20; j++)
        {
          double goo(i*1000.);
          double hoo(j*500.);
          cout << i << "\t" << j << "\t" << goo << "\t" << hoo << endl;
        }
    }
  return 0;
}


Shouldn't one be able to *see* the variable "i" as a local from within
the scope of the i-loop (e.g. at line 6 = double foo(100.); )??? 
Likewise for "j", "goo", and "hoo" inside the j-loop.

Strangely enough, if I define foo, goo, and hoo  as doubles before the
"i" loop, then I can *see* ALL the variables (including i and j) as in
the same code (modified) below:

#include <iostream>
int main()
{
  double foo, goo, hoo;
  for (int i(0); i < 10; i++)
    {
      foo = 100.;
      int j;
      for ( j = 10 ; j < 20; j++)
        {
          goo = i*1000.;
          hoo = j*500.;
          cout << i << "\t" << j << "\t" << goo << "\t" << hoo << endl;
        }
    }
  return 0;
}



Am I missing something really simple here??? Please help.
Thanks, Donna Womble.

P.S.  I am using Insight version 5.0 with gcc version 2.96 (20000731) on
RedHat Linux 7.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]