-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Returning an integer literal missing from the Rust output (debug build) #129
Comments
The annotated rust code is best-effort based on the debug information emitted by rustc. If rustc doesn't emit debug information for a line, then the assembly doesn't contain it, and cargo-asm cannot display it. For just reading the inline assembly, this isn't critical, since one is interested in the assembly itself, and that is completely included. The rust source code at best help you skim through it quicker. I believe tarpaulin also uses debug information to track coverage. That's a bad idea. There you are interested in the coverage of Rust code, and because debug information is unreliable, the coverage is unrelaible. That is, tarpaulin is broken by design. The only reliable way to do code coverage is to use compiler instrumentation. Rust already supports building instrumented binaries, e.g., for PGO. The output of that could be read to compute code coverage, and should be quiet reliable. |
So i'm closing this as "working as intended". If you were to use a more recent rust version, you might get better debug information, but debug information from Rust, and LLVM in general, isn't great, so don't trust it. |
That's fair, thank you for the explanation. |
Hi, first of all – thank you for a great project, it's been a great help when learning Rust. Not sure in what program or library the issue lies, so cargo-asm is my first stop. I'm using Rust 1.35.0 (3c235d560 2019-05-20) with the latest cargo-asm. With a piece of code like this:
I get the following output:
fun2
looks ok, but forfun1
I'd expect something like:An explanation why I'm even looking at the assembly output of those two functions: there's a discussion of some coverage issues over in the cargo-tarpaulin repository and I've discovered the coverage of the two functions above isn't perfect either. It's been suggested some inlining is going on so I went ahead and looked at the assembly.
The text was updated successfully, but these errors were encountered: