japaric / cargo-call-stack

Whole program static stack analysis
Apache License 2.0
560 stars 50 forks source link

Allow analysis of debug builds, not just release builds. #82

Open hydra opened 1 year ago

hydra commented 1 year ago

I have a use-case where I need to know how much MCU memory to devote to stack usage for code compiled in debug mode.

The tool currently always builds in release mode as it adds the --release argument to the rustc invocation.

Please can this restriction be changed? Maybe by way of a new command line argument that defaults to release mode? More specifically the cargo profile needs to be supported along with custom profiles.

See: https://doc.rust-lang.org/cargo/reference/profiles.html#custom-profiles

It seems there is some conditional code already that adds the --release argument, but the value it depends on is hard-coded.

See: https://github.com/japaric/cargo-call-stack/blob/main/src/main.rs#L120 and https://github.com/japaric/cargo-call-stack/blob/main/src/main.rs#L174-L176