Tag Archives: debugging

A Challenge Discussion – Returning Pointers To Local Variables

Last week’s challenge was a tough one, so don’t be alarmed if you had no idea what the issue might have been. Also, it can be hard to spot problems in a functional program because you tend to concentrate on what the code is actually doing, rather than the validity of the code itself. To give […]

Log GDB Output To A File

Sometimes, especially when you’re dealing with a long stack trace, or a multi-threaded stack trace, trying to view the debug output from GDB in a terminal window can be a little awkward. Did you know that you can log specific output (or even the entire session) from within GDB to a text file? All you […]

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 […]

GDB | Auto-Load Safe-Path Declined

More GDB shenanigans today, as kindly pointed out by one of my readers – thank you Laurent! Did you know that as of GDB version 7.5 (Aug 2012), there is a new security feature in place that prevents GDB from looking in “non-trusted” directories for the super-useful .gdbinit file? [For more on the usefulness of […]