Compile the following program: g++ -g test.cpp -o test #include <stdio.h> int main(int argc, char *argv[]) { for (int i=0;i<10;i++) { int test = i; printf("%d\n",test); } } Try running the program in gdb, break it at the printf-line. Try inspecting the variables i and test. This does not work on my plain RH7.0-box.
Daniel, could you take a look at this? I've confirmed the problem... I'm not sure that gdb tries to handle locally instatiated variables, though.
I compiled the same program on a RH6.2-box (using egcs-2.91.66). Debugging that executable under RH7.0 works fine, so it looks like it's g++'s fault.
Looks like it... Jakub?
Richard Henderson fixed this in http://gcc.gnu.org/ml/gcc-patches/2000-12/msg01445.html It will appear in gcc-2.96-70
*** Bug 22671 has been marked as a duplicate of this bug. ***