authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-03-19 20:05:02+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-03-19 20:05:02+01:00
log652842637c31055d26f846e2249c9989104afe67
tree773b4343ff3a28506b69a3150b43c48c1909d1cc
parentd1b376cac92da5eb6b34899ab68ef73d5ea740b8

zld: continue on invalid/missing debug info


1 files changed, 9 insertions(+), 1 deletions(-)

src/link/MachO/Zld.zig+9-1
......@@ -2707,7 +2707,15 @@ fn writeDebugInfo(self: *Zld) !void {
27072707 };
27082708 defer debug_info.deinit(self.allocator);
27092709
2710 const compile_unit = try debug_info.inner.findCompileUnit(0x0); // We assume there is only one CU.
2710 // We assume there is only one CU.
2711 const compile_unit = debug_info.inner.findCompileUnit(0x0) catch |err| switch (err) {
2712 error.MissingDebugInfo => {
2713 // TODO audit cases with missing debug info and audit our dwarf.zig module.
2714 log.debug("invalid or missing debug info in {s}; skipping", .{object.name});
2715 continue;
2716 },
2717 else => |e| return e,
2718 };
27112719 const name = try compile_unit.die.getAttrString(&debug_info.inner, dwarf.AT_name);
27122720 const comp_dir = try compile_unit.die.getAttrString(&debug_info.inner, dwarf.AT_comp_dir);
27132721