mirror of
https://codeberg.org/ziglang/zig
synced 2026-11-18 07:05:05 +00:00
Fixes #31797 I finally had time to work on this. I've implemented it so that, when an adjacent dSYM exist and its uuid match that of the current binary, we load its DWARF and use that for all getDwarfForAddress requests. All of this is done eagerly at `MachOFile.load` for simplicity rather than later and lazier. Happy to change that to whatever you think is best. This implementation is quite minimal and makes dSYM support "best-effort" as in, it treats dSYM parsing error as non-fatal and fallbacks using the current stabs/ofiles mechanism. You can test it that way on macOS: ``` zig build-exe panic.zig dsymutil panic -o panic.dSYM strip -S panic ./panic ``` with panic.zig: ``` pub fn main() void { @panic("panic"); } ``` Before: ``` thread 57569166 panic: panic ???:?:?: 0x103071c2b in _panic.main (/private/tmp/panic) ???:?:?: 0x103071bb3 in _main (/private/tmp/panic) ???:?:?: 0x180d5ab97 in start (/usr/lib/dyld) fish: Job 1, './panic' terminated by signal SIGABRT (Abort) ``` After: ``` thread 57569653 panic: panic /private/tmp/panic.zig:2:5: 0x1029d771b in main (panic) @panic("panic"); ^ /Users/cerisier/code/codeberg.org/ziglang/zig/lib/std/start.zig:698:59: 0x1029d76a3 in callMain (panic) if (fn_info.params.len == 0) return wrapMain(root.main()); ^ ???:?:?: 0x180d5ab97 in start (/usr/lib/dyld) fish: Job 1, './panic' terminated by signal SIGABRT (Abort) ``` Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35582 Reviewed-by: mlugg <mlugg@noreply.codeberg.org>
706 lines
26 KiB
706 lines
26 KiB