Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
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 |
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.