puremourning / vimspector

vimspector - A multi-language debugging system for Vim
http://puremourning.github.io/vimspector-web
Apache License 2.0
4.08k stars 171 forks source link

Update README.md for Rust source map in configuration #831

Closed stucash closed 7 months ago

stucash commented 7 months ago

Added a one-liner tutorial to demonstrate that we can achieve source map with CodeLLDB by adding an extra sourceMap item in vimspector configuration file. Source Map enables step-into functionality for Rust standard library code.

Specifically, we'll add the sourceMap item in configurations section of the .vimspector.json,

{
  "adapters": { // Some configs for adapters },
  "configurations": {
        "request": "<launch or attach>",
        "sourceMap": { "from_path" : "to_path"}
  }
} 

In Linux, we could also find the from_path by:

strings target/debug/<your-binary-name> | grep -o '^/rustc/[^/]\+/' | uniq

other than using the disassembly window.

puremourning commented 7 months ago

This change is Reviewable

stucash commented 7 months ago

Added a one-liner tutorial to demonstrate that we can achieve source map with CodeLLDB by adding an extra sourceMap item in vimspector configuration file. Source Map enables step-into functionality for Rust standard library code.

Specifically, we'll add the sourceMap item in configurations section of the .vimspector.json,

{
  "adapters": { // Some configs for adapters },
  "configurations": {
        "request": "<launch or attach>",
        "sourceMap": { "from_path" : "to_path"}
  }
} 

In Linux, we could also find the from_path by:

$ strings target/debug/<your-binary-name> | grep -o '^/rustc/[^/]\+/' | uniq

other than using the disassembly window.