cmyr / cargo-instruments

A cargo plugin to generate Xcode Instruments trace files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

--release flag doesn't work (how do we ensure debug symbols are on?)

cmyr opened this issue · comments

hadn't intended to leave this in; I didn't get around to figuring out how to programatically enable debug symbols.

I set the release profile as below but do not see any function name symbols.

[profile.release]
opt-level = 3
lto = true
debug=true

I'm confused by this issue's title and description.

I have the same problem as @rohitjoshi, adding what's recommended in the readme to the release profile doesn't help.

Do I need to do anything else? Like set stripping off? Or splitting?

How can I test if debug symbols are generated? How do I debug this?

yes, this issue is very confusing, I'm going to close it.

When I use --release on a binary with no profile, I currently do get a profile that includes some mangled names. Having debug=true in the profile doesn't seem to change anything.

The major problem for me, though, is that it seems like maybe the rate of sample collection has changed significantly? Maybe with the move to M1, or maybe with an instruments rewrite? For relatively short programs I'm regularly seeing executions that complete but produce almost empty profiles. If I do something like run the program in a loop, then I see some number of symbols.

In any case, I'm closing this, and if anyone has specific issues regarding --release we can discuss them in new issues.

This currently works for me after some experimentation:

[profile.release]
debug = true
incremental = true
split-debuginfo = 'packed'
strip = 'none'