Skip to content

GDB MI adapter: support rr timestamp navigation and bookmarking #1025

@xusheng6

Description

@xusheng6

Summary

When using the GDB MI adapter with rr (record and replay debugger), it would be useful to support:

  1. Displaying the current timestamp — rr exposes the current event number via the when command, which prints the current FrameTime (a monotonically increasing event sequence number). This could be shown in the UI so the user always knows where they are in the trace.

  2. Navigating to a given timestamp — rr supports seeking to an event number via run <event_number> (e.g., run 12345). Under the hood, this finds the nearest checkpoint and replays forward, so it's fast — not a full replay from the start. This enables direct time travel to any point in the recorded execution.

  3. Bookmarking timestamps — rr has a checkpoint/restart system that lets users save and restore positions in the trace:

    • checkpoint — saves the current position by deep-forking (cloning) the entire replay session. Returns an integer ID, e.g., Checkpoint 3 at main.cc:42.
    • restart <id> — seeks to a previously saved checkpoint by restoring the cloned session. e.g., restart 3.
    • delete checkpoint <id> — removes a saved checkpoint.
    • info checkpoints — lists all checkpoints with their ID, event time, and source location.

    These are rr-specific GDB extension commands (sent via qRRCmd packets over the GDB remote protocol), not built-in GDB commands.

rr command reference

Command Description
when Print current event number (FrameTime)
run <N> Seek to event number N
checkpoint Save current position, returns an ID
restart <id> Restore to checkpoint by ID
delete checkpoint <id> Remove a checkpoint
info checkpoints List all checkpoints (ID, event time, location)

Suggested UI

  • Show current event number (from when) in the debugger status bar or toolbar
  • Provide a "Go to event" input for direct navigation
  • A bookmarks panel listing saved checkpoints, with ability to create/delete/jump to them

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions