I am trying to debug C++ code using Eclipse Galileo on my MacBook Pro running Mac OS X v10.5 (Leopard). It's my first time trying this. I have a complicated C++ program I'd like to debug, but to test things out, I just tried to debug and step through the following:
#include <iostream>
using namespace std;
int main()
{
int x = 0;
cout << x << endl;
x = 54;
cout << x << endl;
return 0;
}
I clicked the debug icon, told it to use GDB (DSF) Create Process Launcher and started to step through the code. I wanted to be able to monitor the value of x, so I opened up the Variables window and watched. Initially, it was 4096 - presumably some garbage value. As soon as I hit the next line, where it had shown the value, it now shows the following error:
Failed to execute MI command:
-var-update 1 var1
Error message from debugger back end:
Variable object not found
I can't seem to figure this out or get around it. And a few Google searches turned up bone dry without even the hint of a lead.
Solution: As drhirsch pointed out below, use the Standard Create Process Launcher instead of the GDB Create Process Launcher. (This is actually a workaround and not a true solution, but it worked for at least two of us.)
In my experience the gdb/dsf launcher is still quite unusable. I can't get it to show variables too, it seems still very buggy.
Did you try the Standard Create Process Launcher? For me this works fine.