I have written a simple C++ program like this:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello.";
return 0;
}
Now I want to debug it. So what will be the command for it so my control goes to every line?
You can use gdb
for this:
$ gdb hello
This will start gdb
and prompt you for what to do next. The next
command executes one line of source and stops at the next line.
I found a basic GDB tutorial that may be helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With