Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 4, 2025

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.

Bookmark Feature Demo

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 !tt command 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 DebuggerWidget as 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:

  1. Creating Bookmarks: Navigate to desired position → Press Ctrl+M or use Bookmarks tab → Enter description
  2. Navigation: Double-click any bookmark to instantly return to that exact trace position
  3. 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.

@CLAassistant
Copy link

CLA assistant check
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.

@Copilot Copilot AI changed the title [WIP] Offer a UI to bookmark a timestamp and then time-travel to it with a double-click Implement bookmark timestamp UI for time-travel debugging Sep 4, 2025
@Copilot Copilot AI requested a review from xusheng6 September 4, 2025 03:03
Copilot finished work on behalf of xusheng6 September 4, 2025 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Offer a UI to bookmark a timestamp and then time-travel to it with a double-click

3 participants