GDB & DDD

This page autogenerated as placeholder

DDD (Data Display Debugger)

Purpose:

  • DDD is a graphical front-end for command-line debuggers like GDB.

  • It provides an interactive UI with visualizations for breakpoints, memory, and variables.

Key Features: ✔ Graphical user interface for GDB. ✔ Displays memory contents visually. ✔ Supports debugging of C, C++, Java, Python, Perl, etc. ✔ Allows setting breakpoints, stepping through code, and inspecting variables.

Common Commands:

  • ddd myprogram → Launch DDD with myprogram.

  • Use GUI buttons or enter GDB commands in the command window.

  • Right-click variables to inspect or modify values.

  • Supports mouse-based breakpoints and stepping.


GDB (GNU Debugger)

Purpose:

  • GDB is a powerful command-line debugger for programs written in C, C++, and other languages.

Key Features: ✔ Allows program execution control (breakpoints, stepping). ✔ Inspects variables and memory. ✔ Supports core dump analysis and remote debugging.

Common Commands:

  • gdb myprogram → Start debugging myprogram.

  • break main → Set a breakpoint at main.

  • run (or r) → Run the program.

  • next (or n) → Step over a line of code.

  • step (or s) → Step into a function.

  • print var (or p var) → Print the value of var.

  • bt → Backtrace (view call stack).

  • quit (or q) → Exit GDB.

DDD vs. GDB

Feature
DDD (GUI)
GDB (CLI)

Interface

Graphical

Command-line

Usability

Easier for beginners

Powerful but requires memorizing commands

Breakpoints

Mouse-based

Text commands

Visual Debugging

Yes

No

🔹 Use DDD for a visual debugging experience. 🔹 Use GDB for direct, scriptable, and advanced debugging.


Quick Tip: If you already know GDB, DDD is just a graphical wrapper around it—commands work the same!

🚀 Happy Debugging! 🚀

Last updated