Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 1.3 KB

debugging.md

File metadata and controls

45 lines (32 loc) · 1.3 KB

Overview

  1. Help with debugging rust code

Clion

dbg!

Libraries (External dependencies)

  1. Change local source code
  2. cargo clean
  3. build & debug with breakpoints

Macros

  1. see doc

Mutating 3rd party dependencies/libs

  1. Add the dependency normally to Cargo.toml
  2. Open one of the *.rs source files in crate
  3. Get the full path of the (Ctrl + Shift + C)
    1. eg. $HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/my-dependency-0.1.2
  4. Update Cargo.toml, change version to path
    1. eg. opentelemetry-otlp = { path = "/home/myself/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opentelemetry-otlp-0.25.0", features = ["grpc-tonic"] }
  5. Reload project from Cargo.toml
  6. Update the source code
  7. Recompile

When done ...

  1. Undo your changes in Cargo.toml
  2. rm -rf $HOME/.cargo/registry/src/index.crates*
  3. Rebuild

Other Resources

  • TODO