0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib/std/debug/Dwarf.zig
Matthew Lugg 1436d488b9 std.debug.Dwarf: basic support for DW_LNE_ZIG_set_decl
This makes stack traces with `-fincremental`, um, sort of work:

```
thread 29999 panic: this is the RIGHT panic
/home/mlugg/panic.zig:15:25: 0x7a1907 in bar (panic.zig)
        1, 2, 3, 123 => @panic("this is the RIGHT panic"),
                        ^
/home/mlugg/panic.zig:7:12: 0x7a138c in foo (panic.zig)
        bar(123);
           ^
/home/mlugg/panic.zig:2:8: 0x7a12fe in main (panic.zig)
    foo(true);
       ^
/home/mlugg/zig/master/lib/std/start.zig:779:64: 0x7a0e3b in callMain (std.zig)

                                                               ^
/home/mlugg/zig/master/lib/std/Target.zig:1651:5: 0x7a0861 in _start (std.zig)
        pub inline fn isSparc(arch: Arch) bool {
    ^
Aborted                    ./panic
```

The last two frames are clearly incorrect. However, we actually agree
with lldb-zig about those source locations, so it seems like that's a
bug in the compiler's `link.Dwarf2` implementation.
2026-09-04 20:57:35 +02:00

1692 lines
62 KiB