debugger
debugger copied to clipboard
Implement bookmark timestamp UI for time-travel debugging
This PR implements a comprehensive bookmark system for the Binary Ninja debugger that allows users to bookmark timestamps and navigate to them with double-click functionality, particularly useful for Time Travel Debugging (TTD) scenarios.
Key Features
BookmarksWidget UI Component
- New "Bookmarks" tab integrated into the debugger sidebar alongside Registers and Breakpoints
- QTableView displaying Description, TTD Position, Address, and Timestamp columns
- Double-click navigation to bookmarked positions with TTD support
- Context menu actions for bookmark management (Add, Remove, Jump To)
TTD Integration
- Automatically captures TTD position using
!ttcommand when creating bookmarks - Navigation attempts TTD position setting with multiple command formats (
!tt <position>,!position <position>) - Graceful fallback to address navigation if TTD positioning fails
- Compatible with different TTD implementations and regular debugging sessions
Global Bookmark Action
- "Add Bookmark" action added to Debugger menu with Ctrl+M keyboard shortcut
- Available when debugger is connected and stopped
- Quick bookmark creation from anywhere in the UI without requiring widget access
Persistent Storage
- Uses Binary Ninja metadata system for bookmark persistence (key: "debugger.bookmarks")
- Bookmarks are saved with the binary view and restored across debugging sessions
- Comprehensive error handling for serialization/deserialization
Implementation Details
The implementation follows existing debugger UI patterns, particularly mirroring the DebugBreakpointsWidget:
// BookmarkItem data structure
class BookmarkItem {
std::string m_description; // User-provided description
std::string m_ttdPosition; // TTD position (e.g., "12A:B4")
uint64_t m_address; // Memory address when bookmark was created
QDateTime m_timestamp; // When bookmark was created
};
TTD Position Handling:
- Captures position via
InvokeBackendCommand("!tt")when creating bookmarks - Navigation attempts position restoration with multiple command formats
- Smart fallback system ensures functionality even when TTD commands fail
UI Integration:
- Integrated into main
DebuggerWidgetas a new tab - Uses Qt model/view/delegate architecture for performance and consistency
- Follows Binary Ninja theming and font management patterns
- Automatic refresh when tab becomes visible to sync with global actions
User Experience
The bookmark workflow is intuitive and integrates seamlessly with existing debugger functionality:
- Creating Bookmarks: Navigate to desired position → Press Ctrl+M or use Bookmarks tab → Enter description
- Navigation: Double-click any bookmark to instantly return to that exact trace position
- Management: Use context menu or action buttons to organize bookmarks
The system provides clear visual feedback and error handling, ensuring users understand navigation results and any fallback behavior when TTD positioning is unavailable.
Fixes #704.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.