debugging c++ in codelite
Question
i am setting a break point beside the int x , and setting the ide to the debug mode,but nothing appear in the debugging window when i start debugging ???
should i do something more ?
#include <iostream>
int main()
{
using std::cin;
using std::cout;
using std::endl;
int x;
cout<<"X = "<<x<<endl<<"enter new x \n X = ";
cin>>x;
cout<<endl<<"New X = "<<x<<endl;
}
Solution
There can be several reasons for codelite not stopping:
1) Did you build your project with debugging information enabled? Make sure you select the 'Debug' configuration, this makes sure that -g is passed to gcc / g++
2) Try enabling the debugger log from: settings -> debugger settings -> GNU gdb debugger -> Misc -> enable debugger full log this will produce more information on the interaction between between codelite and gdb - it will also tell you why gdb failed to stop, the log is printed into the 'Debugger' pane, under the 'Output' tab
Remember: codelite is just an interface to gdb, so if codelite did not break, it means that gdb did not instruct it to break...
Eran
OTHER TIPS
It is your ide forbids you to read uninitiated value 'int x'. I debugged it under vs2008, and the break point will automatically be removed to cout line. and continue debugging will get this :
Press 'continue' will get output in cmd window.
I hope this bring some help to you.