-
-
Notifications
You must be signed in to change notification settings - Fork 267
macOS debuginfo: add support for using atos
to get file:line info in backtraces.
#4291
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
macOS debuginfo: add support for using atos
to get file:line info in backtraces.
#4291
Conversation
…n backtraces. Resolves issue ldc-developers#3864
Note that this fixes debuginfo for vanilla LLVM on macOS. In other words, we no longer need the debuginfo hack for macOS, so |
Where can I grab a binary for this on ARM so I can test? |
@schveiguy using Wetransfer.com: https://we.tl/t-kibu0jpfkI |
I see line numbers now! But I'm trying to reproduce the link thing with the release 1.30.0 compiler, and it isn't failing... so I'm not sure how to really test that... |
maybe you have the |
I made sure to unset that variable before compiling. And I did test with 1.28.0 and it failed. |
I don't have a mac nor use macOS so I can't test this, but perhaps, if this patch fixes the issue, it can be upstreamed? |
Hm, for me, the 1.30.0 release from Github does error when linking:
|
@jacob-carlborg I think I did what you suggested :) |
@kinke With this merged, we can remove the hack from our LLVM branch, right? |
…gment as a debug section (not regular)
I've added a commit that sets the LDC-specific LLVM option to vanilla LLVM's default behavior. |
@JohanEngelen I would prefer to not be dependent on an external tool, Note, with this change a |
Preferences aside, this is apparently the standard workflow on macOS for C/C++ and other languages. We should at least enable that workflow before considering to extend it. I don't know of a way to make it work other than dSYM or object files (including debug info gives link errors), without changing macOS's system linker or defining our own debuginfo format. It fortunately does not require running I use Note: You can still get the old behavior (using compile flag with LDC built with the hacked LLVM version), and then the user can deal with the linker errors himself. |
Will a shared library made with LDC load if there is none of that? (and no debug info either). druntime is never initialized. |
I haven't updated to MacOS 13, have you? |
You don't need any of that to run a program. Jacob means that you need dSYM or object files if you want file:line information. If dSYM files or object files are not available, then you get the same output as now: no file:line information upon exception backtrace. |
…re (preserving the standard truncation).
I'm still on Monterey 12.6 |
Will be merging in the next days if no objections. |
Resolves issue #3864
I thought this requires running
dsymutil
(see #4006), but apparently it does not.Tested on macOS Monterey 12.6, Apple M1, with the following: