Debugging C ++ in Codelite

I set a breakpoint next to int x and set ide to debug mode, but nothing appears in the debug window when debugging starts

should i do something else?

#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; } 
+4
source share
2 answers

There may be several reasons why a wallet does not stop:

1) Have you created your project with debugging information turned on? Make sure you select the Debug configuration, this ensures that -g is passed to gcc / g ++

2) Try turning on the debugger log: settings β†’ debugger options β†’ GNU gdb debugger β†’ Miscellaneous β†’ turning on the full debugger log this will give additional information about the interaction between code and gdb - it will also tell you why gdb could not be stopped, the log is printed in the Debugger panel on the Exit tab

Remember: codelite is just an interface for gdb, so if the codeword did not break, then gdb did not instruct it to break ...

Eran

+2
source

Your ideal forbids you to read the uninitiated value of 'int x'. I debugged it under vs2008 and the breakpoint will be automatically deleted in the cout line. and continue debugging will get the following:

enter image description here

Click "continue" to get the result in the cmd window.

enter image description here

Hope this helps you.

+1
source

Source: https://habr.com/ru/post/1437725/


All Articles