-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Long Functions Cause Invalid DWARF, Debug/ Breaking Unavailable #78657
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
Comments
Couldn't reproduce with rustc 1.46.0 nor 1.49.0-nightly (ffa2e7a 2020-10-24). But I'm running a pretty old Xcode version (10.1 10B61). Dan, which Xcode version are you using ( |
Sorry, that's my mistake, I pushed the "fixed" version.
As for tools versions - I only have the Xcode command-line tools, here's their version -
|
Couldn't reproduce using the updated DwDemo with Xcode 10.1 on Mojave. |
Aha, here's something: Xcode 10.1: no errors Xcode 12.1: dsymutil crashes while compiling dwdemo. That crash leaves behind a malformed dwdemo.dSYM. Dan, I bet you'll see a bunch of dsymutil crashes in the Crash Reports section of Console.app. rust version seems to have no effect: 1.46.0, 1.47.0, and a recent nightly all do the same thing. There are at least two bugs here: |
Single-threaded dsymutil does not crash and seems to generate a valid dSYM file. This might be a clumsy workaround:
|
So here's what's going on. The generated The
When running with Xcode 10's tl;dr the bugs are:
|
Dan, can you file the bug report for
|
rustc shouldn't ignore dsymutil failures: #78770 |
Visited during wg-debugging triage. It looks like all of the components of the reported issue have been resolved already. Thanks @gparker42 for investigating and reporting the individual issues! Assigning to @davidtwco to re-test and confirm this is resolved. |
I can't reproduce this with the provided repository, |
Including long functions appears to cause rustc to create invalid DWARF debug files. This leaves debugging and break-pointing unavailable. Debugging fails throughout the program, not just in the long functions.
Originally uncovered while porting (someone else's!) C code, which included a function of about 5k LOC. Also reproduced with macro-generated long methods. A minimal example is available here:
https://github.com/dan-fritchman/DwDemo
Previously reported this to LLDB, whose maintainers helped point out that the DWARF files appear invalid. Building from a fresh clone of that demo repo -
The demo's macros expand to a few similar-length functions, about 5-6k LOC. Shortening them (via shortening the structure/ schema files) causes
dwarfdump
andlldb
to be happy with rustc's output -All of that was run on MacOS with the stable rust toolchain.
Thanks for all of the team's work on this project.
Please let me know if there's any further info I can provide.
The text was updated successfully, but these errors were encountered: