I'm trying to debug with LLDB on VSCode. I added a breakpoint into my library, it stops on the breakpoint but I get a call stack with unnamed symbols and I can't see any variables:
This is an example from the library, which I built with cargo build --example my_example_name
. I researched and to build in release mode, --release
should be added. So I think I built in debug mode.
I'd guess the library is being built somehow in release mode. How can I check this?
If I put the breakpoint in the example file itself, then the symbol appear when the breakpoint happens. When I put the breakpoint in the library used by the example, then no symbols appear when the breakpoint happens.
Is it possible that cargo build --example my_example
builds the example in debug mode but the library in release mode?
According to https://doc.rust-lang.org/cargo/commands/cargo-build.html, "Dependencies use the dev
/release
profiles."
To override that, you could try RUSTFLAGS=-g cargo build ...
(-g
is equivalent to -C debuginfo=2
).
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