I have an ncurses
program that I'd like to interactively debug using CLion. The problem is that when I run the program in CLion to debug it, the inbuilt console where the program is run doesn't display the output of the ncurses
program properly.
I'd like to have the program run in my systems terminal so I can see the output properly whilst debugging the program with CLions debugger.
Is there any way to do this?
The best way to accomplish this is to use GDB now it can be really frustrating to get started so Ill show you how I accomplished it in linux
gdbserver localhost:1234 ./myFile
tcp:127.0.0.1:1234
/location/to/file/myFile
(same file as in 1.) in both Remote and Locationyou might need to try to restart the gdbserver one more time for this to work but if you did all the steps above you should see a debug prompt come up and on the terminal you should see your project running.
There are some limitations with this for example you always have to run gdbserver localhost:1234 ./myFile
command on your terminal for it to work.
Some Video/documentation that helped me:
I hope this helped :)
In other debuggers, you would do this by running the ncurses
application in a terminal, and attaching the debugger to the process using ncurses
.
Doing that avoids interference between ncurses
(which changes the terminal I/O modes) and the debugger's command-line.
The attach feature is a recently released feature of the CLions debugger:
Further reading:
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