Debug ncurses with GDB + GDBserver and Full Input Output

Actually, you can use this technique to debug any kind of console app where debugging on the command line interferes with the program’s output. It’s quick and easy, and unlike attaching to a running process in another shell, it allows you to debug as soon as the program starts, meaning you can catch even those fiddly bugs that only appear during set up.

If you’ve ever tried to debug an ncurses application, you’ll know how problematic it can be.

Using printf statements makes a mess of your visual output…

Debuggers get the keyboard input all mixed up in the shell…


There is a way to seamlessly debug your ncurses application and it is probably easier than you realised.

Enter gdbserver.

Read moreDebug ncurses with GDB + GDBserver and Full Input Output