Skip to content
C++

C++ Debuggers

GDB, LLDB, rr (time-travel), and WinDbg — compared across platform support, IDE integration, scripting, and reverse execution.

Quick pick

GDB — default on Linux, embedded, remote targets.
LLDB — macOS/iOS native, better VS Code integration.
rr — Heisenbugs, flaky tests, race conditions.
WinDbg — Windows kernel, crash dumps, TTD.

Feature comparison

FeatureGDBLLDBrrWinDbg
Reverse/time-travel
Python scripting
STL pretty-printers
RTOS thread awareness
Core dump analysis
Remote debugging
Linux
macOSHomebrew
WindowsMinGW/MSYS2Limited
EmbeddedVia LLDB-server
GDB
GNU Debugger
GDB 15 · GPL v3

The universal Linux debugger. Runs everywhere, understands everything, scripted via Python.

Strengths

  • Universal — works on every Linux architecture
  • Python scripting API — automate complex debug sessions
  • STL pretty-printers for readable std::vector / std::map
  • Remote debugging via gdbserver
  • RTOS awareness (FreeRTOS, Zephyr threads)
  • Core dump analysis

Weaknesses

  • CLI-centric — IDE integration varies in quality
  • Slower than LLDB for large symbol sets
  • No time-travel (use rr on top of GDB for that)
Full guide
LLDB
LLVM Debugger
LLDB 19 · Apache 2.0

Faster startup, better C++ expression evaluation, macOS/iOS native, VS Code default via CodeLLDB.

Strengths

  • Faster startup and symbol loading than GDB
  • Superior C++ expression evaluation (Clang frontend)
  • Native macOS/iOS debugger (Xcode uses LLDB)
  • Python scripting + SBDebugger API
  • CodeLLDB: best VS Code debug experience
  • Better DWARF parsing speed

Weaknesses

  • Windows support is limited (use WinDbg on Windows)
  • Fewer RTOS plugins than GDB
  • Some GDB commands differ in syntax
Full guide
rr
Mozilla rr
rr 5.8 · MIT

Record once, replay deterministically forever. The only practical tool for Heisenbugs.

Strengths

  • Time-travel debugging — step backwards through execution
  • Deterministic replay — reproduce flaky bugs 100%
  • Works as a GDB front-end — GDB commands still work
  • Pernosco integration for team collaborative debugging
  • No code changes required — record any binary

Weaknesses

  • Linux-only (requires hardware perf counters)
  • Recording overhead (~1.5-3× slower)
  • No multi-process or GPU debugging
  • Incompatible with some hardware-level events
Full guide
WinDbg
Windows Debugger
WinDbg Preview · Proprietary (free)

Essential for Windows kernel debugging, crash dumps, and COM/WinRT. Nothing else comes close on Windows.

Strengths

  • Only real option for Windows kernel debugging
  • TTD (Time Travel Debugging) built-in
  • Best Windows crash dump analysis
  • DML extensions for rich output
  • JavaScript scripting (WinDbg Preview)

Weaknesses

  • Windows-only
  • Steep learning curve for WinDbg scripting
  • Not useful for Linux/macOS targets
Full guide

Essential commands cheatsheet

GDB

CommandAction
b mainBreakpoint at main
r [args]Run with args
n / sNext / step-into
finFinish current function
btBacktrace (call stack)
p exprPrint expression
watch varWatchpoint on var
info threadsList threads
thread NSwitch to thread N
x/10xw &arrExamine memory

rr (time-travel)

CommandAction
rr record ./appRecord execution
rr replayStart replay (opens GDB)
reverse-continueRun backwards to prev event
reverse-nextStep backward
reverse-stepStep-into backward
reverse-finishReturn to caller (backwards)
watch -l varWatchpoint: any write to var
rr psList recorded traces

Deep-dive guides