I'm developing an iPhone application using mixed Obj-C and C++. It seems that sometimes the values of various fields are totally bogus as reported by gdb when stepping from an Obj-C file to a C++ file. For instance, in a method:
int count = 1;
for (int i = 0; i < count; ++i) {
int x = 0; // put a breakpoint here to see how many times it gets hit.
}
in this example, sometimes gdb will report a value for 'count' that is other than '1'. it might be 126346 for example. but, stepping through the code, the loop is only iterated once, indicating that the value of 'count' actually was the expected value.
I'm new to Xcode. I probably just missing something basic. But it sucks to doubt your tools. Has anyone else seen oddness in this area? Solved it?