A Python-based graphical debugger frontend for the GNU Debugger (GDB), inspired by the classic Data Display Debugger (DDD).
- Source Code Viewer: Syntax-highlighted source code display with current execution line highlighting
- Breakpoint Management: Set, remove, and manage breakpoints with conditions
- Variable Inspection: View and inspect local and global variables
- Watch Expressions: Monitor specific expressions during execution
- Memory Visualization: View and analyze memory contents with hex dump and disassembly
- Execution Control: Run, pause, step over, step into, step out, and continue execution
- Call Stack: View and navigate the call stack
- GDB Integration: Seamless integration with GDB using MI (Machine Interface)
- Python 3.8 or higher
- GDB (GNU Debugger) installed and available in PATH
- Windows, Linux, or macOS
-
Clone the repository:
git clone <repository-url> cd ddd
-
Install dependencies:
pip install -r requirements.txt
-
Install the package:
pip install -e .
# Start DDD Clone without loading a program
ddd-clone
# Start DDD Clone with a specific program
ddd-clone /path/to/programfrom ddd_clone.main import main
# Start the application
main()- Launch DDD Clone
- Use "File" → "Open Program" to load an executable
- The source code will be displayed in the main window
- Click in the left margin of the source code viewer to set a breakpoint
- Right-click on a breakpoint to set conditions or remove it
- Use the "Breakpoints" tab to manage all breakpoints
- Run (F5): Start program execution
- Pause: Interrupt running program
- Step Over (F10): Execute current line, stepping over function calls
- Step Into (F11): Step into function calls
- Step Out (Shift+F11): Step out of current function
- Continue (F5): Continue execution until next breakpoint
- Local variables are automatically displayed in the "Variables" tab
- Add watch expressions in the "Watch" tab to monitor specific values
- Expand complex variables (structs, arrays) to view their members
- Use the memory viewer to examine memory contents
- Generate hex dumps of memory regions
- Disassemble code at specific addresses
- Search for patterns in memory
- GDB Controller: Manages GDB process and communication
- Main Window: Primary GUI with source code and debug panels
- Source Viewer: Displays source code with syntax highlighting
- Breakpoint Manager: Handles breakpoint operations
- Variable Inspector: Manages variable inspection and watch expressions
- Memory Viewer: Provides memory analysis capabilities
ddd/
├── README.md # Project documentation
├── CLAUDE.md # Project instructions for Claude Code
├── requirements.txt # Python dependencies
├── setup.py # Package installation configuration
├── ddd_clone/ # Main application package
│ ├── __init__.py
│ ├── main.py
│ ├── gui/ # GUI components
│ │ ├── __init__.py
│ │ ├── main_window.py
│ │ ├── source_viewer.py
│ │ ├── breakpoint_manager.py
│ │ ├── variable_inspector.py
│ │ └── memory_viewer.py
│ │ └── line_number_area.py
│ └── gdb/ # GDB integration
│ ├── __init__.py
│ └── gdb_controller.py
├── tests/ # Test suite
│ ├── __init__.py
│ ├── test_gdb_controller.py
│ ├── test_breakpoint_manager.py
│ ├── test_variable_inspector.py
│ ├── test_gui_automated.py
│ ├── test_complete.py
│ ├── test_gui.py
│ ├── test_minimal.py
│ └── test_simple.py
├── docs/ # Project documentation
│ ├── it_1.txt
│ ├── it_2.txt
│ ├── it_3.txt
│ ├── it_4.txt
│ ├── it_5.txt
│ ├── it_6.txt
│ ├── FONT_SYNC_FIX_SUMMARY.md
│ ├── GUI_TEST_COVERAGE_ANALYSIS.md
│ ├── GUI_TEST_IMPROVEMENT_SUMMARY.md
│ └── PROJECT_SUMMARY.md
└── examples/ # Example programs for testing
├── README.md
├── simple_program.c
└── simple_program.exe
# Run all tests
pytest
# Run specific test file
pytest tests/test_gdb_controller.py
# Run tests with coverage
pytest --cov=ddd_cloneThis project follows PEP 8 style guidelines. Use the provided tools:
# Format code
black ddd_clone/
# Check code style
flake8 ddd_clone/
# Type checking
mypy ddd_clone/- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
GDB not found: Ensure GDB is installed and available in your PATH.
Program won't load: Check that the executable has proper permissions and is compiled with debug symbols (-g flag).
Syntax highlighting not working: Install pygments: pip install pygments
Enable debug output by setting the environment variable:
export DDD_DEBUG=1
ddd-cloneThis project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
- Inspired by the original Data Display Debugger (DDD)
- Built with PyQt5 for the graphical interface
- Uses GDB Machine Interface for debugger integration