-
Notifications
You must be signed in to change notification settings - Fork 63
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
Support reading in object files for executables on macOS #87
Comments
There's some code to do this at https://github.com/mstange/profiler-dwarf-lookup |
Do you think it makes sense to add something to the object crate that performs the task of |
That's a great idea! |
@mstange I noticed a couple of differences in how LLVM parses the symbol entries in MachODebugMapParser:
|
Oh, the terminating I did not encounter a case where One important thing that the current |
I don't know much about macOS, but it appears that the OSO entries are what dsymutil uses. Can you run dsymutil to get a dsym and use that instead? Using the .o files seems like a niche use case. |
Running dsymutil is pretty time consuming (see rust-lang/rust#47240) so it's nice to avoid it if at all possible. Further, most tools (lldb, gdb, nm, Instruments, ...) on macOS support using the OSO entries directly without needed a dsym file. |
My current thinking is to change |
This got a fully-fleshed-out implementation in the |
|
backtrace-rs implemented this in rust-lang/backtrace-rs#377. This needs to be handled at a higher level than the |
@jrmuizel Did you file this issue about the addr2line crate API or about the addr2line CLI example in this repo? |
Ah sure, that probably isn't too hard to do (rough version at philipc@65f2154). I don't currently have a macOS system to develop on though. |
I think https://github.com/mstange/samply/tree/main/wholesym-addr2line supports this, so hoping that is sufficient now. |
By default, the linker doesn't include debug info into the resulting executable. It's either left in the .o files or put in a dsym file. In the situation where it's left in the .o files there are OSO stabs entries that give the paths of the .o files. We should read those in as needed to resolve the addresses.
The text was updated successfully, but these errors were encountered: