Skip to content

Debugging With GDB

View A Backtrace For All Threads With GDB

    Debugging multi-threaded programs can be really tricky. GDB, however, will always do its best to rescue you from whatever horrible bug you’re currently looking at. Today I wanted to show you a really nice command for viewing all the threads in your program.

    Log GDB Output To A File

      Did you know that you can log specific output (or even the entire session) from within GDB to a text file?

      Access GDB Directly In Eclipse Luna

        This isn’t a new feature, but it’s really useful when you’re debugging in eclipse, especially if you’re using the more advance or obscure features in GDB.

        Basically, when you are debugging any program, there is a way to talk directly to GDB without using the point-and-click interface of Eclipse.

        It’s called the GDB console.

        It’s also really easy to find. When you are next running a debug session, just click on the console icon that is displayed in the console tab. The console usually shows your program output, but there is more than just one console!

        Debugging For Beginners

          This post was also published at O’Reilly Programming – you can read it here.

          I read an interesting article today, called Debugging for Beginners, over at O’Reilly Programming.

          You all know how much I love GDB (huh? you didn’t? seriously?), so I always like to take a look at different approaches to finding those elusive problems that plague all programmers (even those with decades of experience) from time to time.

          Eclipse CDT + GDB: Setting Watchpoints (Juno)

            I was trying to watch a variable in Eclipse today and just could not find how to set it up. No matter what I did the Toggle Watchpoint option remained greyed out. A watchpoint is… 

            GDB Core Dump Files

              What’s a Core Dump? It’s a file created when your program terminates abnormally. It contains a snapshot of the program’s state at the time of the failure. What does it look like? On Linux it…