With included debug info, my binary becomes 400 MB about. This happens because Rust includes debug info for all dependencies. Is there any way to include debug info only for my code?
[package]
name = "app"
version = "0.7.1"
edition = "2018"
[dependencies]
actix = "*"
actix-web = {version = "1.0", features = ["ssl"]}
...
tokio-core = "*"
tokio = "*"
[profile.release]
debug = true
Run to a breakpoint in code You can also select the line and then select F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert Breakpoint. The breakpoint appears as a red dot in the left margin next to the line of code. The debugger suspends execution just before the line runs.
Just My Code is a Visual Studio debugging feature that automatically steps over calls to system, framework, and other non-user code.
RelWithDebugInfo means build with debug symbols, with or without optimizations. Anyway, the debug symbols can be stripped later, both using strip and/or obj-copy. If you use strip, the output can be saved.
Edit: This functionality is now stabilized and can be used on the stable toolchain without the cargo-features
manifest key. This functionality is documented in the Cargo reference.
If you're willing to use unstable cargo features with a nightly toolchain, this is possible through the cargo profile dependencies feature, like so:
cargo-features = ["profile-overrides"]
[package]
name = "app"
version = "0.7.1"
edition = "2018"
[dependencies]
actix = "*"
actix-web = {version = "1.0", features = ["ssl"]}
...
tokio-core = "*"
tokio = "*"
[profile.release]
debug = true
// disable debug symbols for all packages except this one
[profile.release.package."*"]
debug = false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With