Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.
/ rrcfg-tools Public archive

Tools for configuring and interacting with rr.

License

Notifications You must be signed in to change notification settings

farre/rrcfg-tools

Repository files navigation

Disclaimer

This project has been abandoned in favor of midas, the Visual Studio Code Debug Adapter.

rrcfg-tools README

This extension adds functionality for configuring, starting, and interacting with the C/C++ extension while running rr.

News

We are currently working on another extension that in the end will replace this extension. The development of that extension can be followed at midas on GitHub

Features

  • Configuring basic rr settings.
  • Snippets for creating a C/C++ extension launch configuration
  • Tasks for starting and stopping rr debugging.
  • Short-cuts for rr commands.
  • Extended UI for rr commands.

Requirements

To use this extension rr needs to be installed.

Extension Settings

This extension provides the following VS Code settings:

  • rrcfg-tools.hostname: the hostname where rr is running
  • rrcfg-tools.port: the port where rr listens
  • rrcfg-tools.bin: the full path to the directory of the binary to be debugged
  • rrcfg-tools.cwd: the full path to the binary to be debugged
  • rrcfg-tools.path: the full path to rr
  • rrcfg-tools.trace-path-pick: how to select traces

Extension Commands

This extension provides the following VS Code commands for rr:

  • rrcfg-tools.reverse-continue
  • rrcfg-tools.reverse-step
  • rrcfg-tools.reverse-next
  • rrcfg-tools.reverse-finish

all of which map to the corresponding rr.

The extension also provides the following VS Code Commands:

  • rrcfg-tools.watch: sets a watchpoint. Whether or not this is a hardware watchpoint or software, depends on your system

Extension Tasks

This extension provides the following VS Code tasks:

  • rrcfg-tools: start: starts rr and begins debugging. Intended to be used as a preLaunchTask for C/C++ extension.
  • rrcfg-tools: stop: stops rr and ends debugging. Intended to be used as a postDebugTask for C/C++ extension.

Extension Snippets

This extension provides the following VS Code configuratoinSnippet:

  • rrcfg configuration for cppdbg: Template for generate a C/C++ extension launch.json configuration compatible with running rr from this extension.

Extension Short-Cuts

This extension provides the following default VS Code short-cuts:

  • Ctrl-F1: set watchpoint
  • Ctrl-F5: reverse-continue
  • Ctrl-F10: reverse-next
  • Ctrl-F11: reverse-step
  • Ctrl-Shift-F11: reverse-finish

Like any VS Code command, these can be set to arbitrary keyboard inputs.

Installation

Download the latest rrcfg-tools-x.y.z.vsix from release and install extension from file or install it directly from the Marketplace.

Configuring a project using the extension and start a debug session

The process of adding rr debugging is streamlined using this extension. The steps are as following:

  1. Go to the Run and Debug view and create a launch.json file if there isn't any. If you already have a launch.json you can skip this step.
  2. Go to the launch.json file in the .vscode directory and add a configuration by pressing Add Configuration... or by pressing Ctrl-Space while having the cursor in the file. Select the configuration rrcfg configuration for cppdbg.
  3. In the settings for rrcfg-tools add Workspace settings for all extension settings. hostname and port have sane defaults, currently the only valid hostname is 'localhost'. rrcfg-tools.bin needs to contain the full path to the binary and rrcfg-tools.cwd needs to contain the full path to the directory where the binary resides.
    1. Optionally configure path to rr if it isn't in $PATH.
    2. Optionally configure how to select traces.
  4. Record something using rr!
  5. Go to the Run and Debug view, from the drop down choose rr, the press F5 or Start Debugging
  6. Depending on how traces are selected, you will either be prompted to write the path to a trace or select one from a list.
  7. A quick pick drop down will ask for the process to debug.

This will start a debug session using C/C++ extension while running rr but with rr as debugger. The regular UI and short-cuts work as expected, and the extended UI lets you interact with rr as well as the added short-cuts.

Known Issues

Currently these limitations are known:

  • rrcfg-tools.hostname actually doesn't do much.
  • Most likely only works for Linux, but doesn't check that.
  • Adding a new launch.json and choosing rrcfg configuration for cppdbg doesn't work.

Release Notes

See the Changelog.

Contributors

farre, theIDinside, dmitry-j-mikhin

About

Tools for configuring and interacting with rr.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •