std.debug.Info: make Mach-O source location resolution more resilient

`resolveAddresses` now also works if some calls to `getDwarfForAddress`
fail with `error.MissingDebugInfo`; the affected source location is set
to `.invalid`.

This makes fuzzing work with `ReleaseSafe` for Mach-O.
This commit is contained in:
Justus Klausecker
2026-03-20 17:19:28 +01:00
parent 06b85a4fd0
commit 79f8cf1326
+4
View File
@@ -99,6 +99,10 @@ pub fn resolveAddresses(
// due to split debug information. For now, we'll just resolve the addreses one by one.
for (sorted_pc_addrs, output) |pc_addr, *src_loc| {
const dwarf, const dwarf_pc_addr = mf.getDwarfForAddress(gpa, io, pc_addr) catch |err| switch (err) {
error.MissingDebugInfo => {
src_loc.* = .invalid;
continue;
},
error.InvalidMachO, error.InvalidDwarf => return error.InvalidDebugInfo,
else => |e| return e,
};