Overview
The Ghidra Debugger is a collection of plugins comprising Ghidra’s Dynamic Analysis Framework. It provides a platform for connecting to and controlling third-party debuggers, enabling dynamic analysis of native user-mode applications.Ghidra is not a debugger itself—it relies on existing back-end debuggers (GDB, LLDB, WinDbg) and their APIs, wire protocols, and command-line interfaces.
Supported Platforms
The debugger officially supports:- Linux: x86-64 and arm64 via GDB
- macOS: x86-64 and Apple Silicon (arm64) via LLDB
- Windows: x86-64 via Windows Debugger (
dbgeng.dll)
Core Capabilities
Trace Recording
Once a target is launched in the back end, the debugger records the target into a Ghidra Trace database:- Logs all observations made by the framework or user
- Displays target state in real-time in the UI
- Supports rewinding to view historical machine state
- Can be saved, loaded, and analyzed after session termination
- Supports version control via Ghidra Server (no conflict merging)
Program Mapping
A system of mappings automatically tracks relationships between:- Imported Ghidra Program databases
- Modules recorded in traces
Ghidra synchronizes the cursor between dynamic and static listings, making existing static analysis readily available during debugging sessions.
- Stack and heap space
- Runtime-modified sections (.bss, .data)
- All observed information is recorded for immediate or offline analysis
Getting Started
Launch Configuration
Open Your Program
Open (or import) your program into the Debugger tool from the Ghidra Project Window.
Import Default Tool
If needed, select Tools → Import Default Tools… and choose
defaultTools/Debugger.tool.First-Time Setup
The first time you launch a program, you may be asked to:- Select a specific launcher for your platform
- Configure launcher-specific options
Key Components
Terminal Window
Provides command-line access to the native debugger:- Linux: GDB command line interface
- macOS: LLDB command line interface
- Windows: WinDbg/kd command set
Model Window
Displays a directory of objects in the debugging session using a structure determined by the back-end plugin. Provides:- Overview of debugger and target state
- Useful diagnostic commands
- Architecture information
Dynamic Listing
Analogous to the static listing, but displays:- Live bytes from target memory
- All valid memory including stacks and heaps
- Real-time disassembly and data types
- Synchronized cursor with static listing
Control Toolbar
The main toolbar provides standard debugging controls:Resume
Continue execution
Step
Step through code
Interrupt
Break execution
Additional Windows
Breakpoints
Breakpoints
Set and manage breakpoints from the Breakpoints window or directly in the Listing.
Registers
Registers
View and edit register values for the current thread.
Stack
Stack
Inspect the call stack for the selected thread.
Threads
Threads
Select and switch between active threads. The selected thread is typically synced with the back-end debugger’s active thread.
Debug Console
Debug Console
Central location for activity reporting, errors, and suggested actions. Check here first when troubleshooting.
Advanced Features
Time Travel Debugging
Navigate through execution history:- Rewind to previous states during or after a session
- View recorded machine state at any point in time
- Analyze execution flow retroactively
Control Modes
During or after a session:- Live Mode: Interact with running target
- Trace History: Navigate recorded execution
- Emulation Mode: Simulate execution paths
Back-End Debugger Agents
Ghidra includes multiple debugger agent plugins:| Agent | Platform | Description |
|---|---|---|
| Debugger-agent-gdb | Linux | GDB integration |
| Debugger-agent-lldb | macOS | LLDB integration |
| Debugger-agent-dbgeng | Windows | WinDbg integration |
| Debugger-agent-x64dbg | Windows | x64dbg support |
| Debugger-agent-jpda | JVM | Java debugging |
| Debugger-agent-drgn | Linux | drgn integration |
Plugin Categories
Debugger plugins fall into four categories:- Target Manipulation: Managing connections and interacting with targets
- Trace Manipulation: Viewing and manipulating trace databases and machine state
- Global Manipulation: Aggregating information from multiple targets or traces
- Services: Background plugins that add actions and manage information
Troubleshooting
Pay Attention to Errors
If things don’t seem right, check:- Debug Console: Primary location for error messages
- Terminal: Back-end debugger output
- Application Log: Ghidra’s log file
Common Issues
- Verify the Debugger package is enabled: File → Configure → Debugger
- Ensure all required plugins begin with “Debugger” or “TraceRmi”
- Check that the executable path matches the local filesystem
- Allow time for initialization on some platforms
Tool Configuration
To verify and configure plugins:- Select File → Configure
- Choose Configure All Plugins
- Verify all Debugger-related plugins are selected
- Adjust window layout via Window menu if needed
The default Debugger tool is pre-configured with plugins relevant to both dynamic and static analysis.
Source Code References
- Main implementation:
~/workspace/source/Ghidra/Debug/Debugger/ - Help documentation:
Debugger/src/main/help/help/topics/Debugger/ - API framework:
Debugger-api/ - Trace modeling:
Framework-TraceModeling/
Next Steps
Version Tracking
Compare and track changes across program versions
BSim
Search for similar functions using behavioral analysis
