-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Suppress debuginfo on naked function arguments #74105
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@bors r+ rollup |
📌 Commit 6b59cac has been approved by |
Suppress debuginfo on naked function arguments A function that has no prologue cannot be reasonably expected to support debuginfo. In fact, the existing code (before this patch) would generate invalid instructions that caused crashes. We can solve this easily by just not emitting the debuginfo in this case. Fixes rust-lang#42779 cc rust-lang#32408
Suppress debuginfo on naked function arguments A function that has no prologue cannot be reasonably expected to support debuginfo. In fact, the existing code (before this patch) would generate invalid instructions that caused crashes. We can solve this easily by just not emitting the debuginfo in this case. Fixes rust-lang#42779 cc rust-lang#32408
Suppress debuginfo on naked function arguments A function that has no prologue cannot be reasonably expected to support debuginfo. In fact, the existing code (before this patch) would generate invalid instructions that caused crashes. We can solve this easily by just not emitting the debuginfo in this case. Fixes rust-lang#42779 cc rust-lang#32408
Suppress debuginfo on naked function arguments A function that has no prologue cannot be reasonably expected to support debuginfo. In fact, the existing code (before this patch) would generate invalid instructions that caused crashes. We can solve this easily by just not emitting the debuginfo in this case. Fixes rust-lang#42779 cc rust-lang#32408
Suppress debuginfo on naked function arguments A function that has no prologue cannot be reasonably expected to support debuginfo. In fact, the existing code (before this patch) would generate invalid instructions that caused crashes. We can solve this easily by just not emitting the debuginfo in this case. Fixes rust-lang#42779 cc rust-lang#32408
// Emit function argument debuginfo only for non-naked functions. | ||
// See: https://github.com/rust-lang/rust/issues/42779 | ||
if naked { | ||
continue; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good idea, wouldn't be safer to just disable all debuginfo generation for #[naked]
functions in codegen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this PR doesn't add a mir-opt
test showing the lack of MIR debuginfo (but which we might not want anyway).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eddyb We don't want to suppress the debuginfo describing the calling contract of the function, just the internal function operations. The lldb can reference this information to show the contents of (for example) the first argument in %rdi
. But if you think we need to implement this another way, I'm not particular.
Suppress debuginfo on naked function arguments A function that has no prologue cannot be reasonably expected to support debuginfo. In fact, the existing code (before this patch) would generate invalid instructions that caused crashes. We can solve this easily by just not emitting the debuginfo in this case. Fixes rust-lang#42779 cc rust-lang#32408
@Manishearth Can you help me out? I'm not sure what to do here. I suspect there is some problem with the test. But I have no idea how to set up arm-android to test it. |
I'm sorry, I have no idea |
@Manishearth I spent ~6 hours today trying to get an |
I'm not the reviewer, you have to convince @matthewjasper or someone else on the compiler team that this is acceptable |
The hang appears to happen in master as well, r=me with an issue opened and referenced in the test for this. |
@matthewjasper I'm not clear what you're asking for. Do you want me to open an issue about |
Yes |
A function that has no prologue cannot be reasonably expected to support debuginfo. In fact, the existing code (before this patch) would generate invalid instructions that caused crashes. We can solve this easily by just not emitting the debuginfo in this case. Fixes rust-lang#42779 cc rust-lang#32408
@matthewjasper Done. Thanks! |
Can someone please remove |
@bors r+ |
📌 Commit 2567074 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
Don't spill operands onto the stack in naked functions Currently, the code spills operands onto the stack for the purpose of debuginfo. However, naked functions can only contain an asm block. Therefore, attempting to spill the operands on the stack is undefined behavior. Fixes rust-lang#42779 cc rust-lang#32408 Note that this PR reverts rust-lang#74105 which ultimately didn't fix the problem. cc @haraldh @Amanieu @matthewjasper
A function that has no prologue cannot be reasonably expected to support
debuginfo. In fact, the existing code (before this patch) would generate
invalid instructions that caused crashes. We can solve this easily by
just not emitting the debuginfo in this case.
Fixes #42779
cc #32408