knurling-rs / probe-run

Run embedded programs just like native ones
Apache License 2.0
643 stars 75 forks source link

add --shorten-paths #203

Closed japaric closed 3 years ago

japaric commented 3 years ago

this flags compresses the paths to crates.io dependencies from full paths to the format [$cratename-$crateversion]/src/module/file.rs

cc #66


before:

$ cargo rb hello
(..)
stack backtrace:
(..)
   4: main
        at src/bin/hello.rs:6:1
   5: ResetTrampoline
        at /home/japaric/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.6.13/src/lib.rs:547:26
   6: Reset
        at /home/japaric/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.6.13/src/lib.rs:550:13

after:

$ cargo rb hello
(..)
stack backtrace:
(..)
   4: main
        at src/bin/hello.rs:6:1
   5: ResetTrampoline
        at [cortex-m-rt-0.6.13]/src/lib.rs:547:26
   6: Reset
        at [cortex-m-rt-0.6.13]/src/lib.rs:550:13

currently only paths in the backtrace are modify (because that was the easiest thing to implement / test)

TODO:

jonas-schievink commented 3 years ago

We might want to give this option a shorter name, something like --shorten-paths maybe. This option could then be extended to cover paths to the standard library without having to add another one.

japaric commented 3 years ago

bors r=jonas-schievink

bors[bot] commented 3 years ago

Build succeeded: