| ... | @@ -7189,7 +7189,6 @@ fn prelinkInner(elf: *Elf) Error!void { | ... | @@ -7189,7 +7189,6 @@ fn prelinkInner(elf: *Elf) Error!void { |
| 7189 | }) |debug_shndx| { | 7189 | }) |debug_shndx| { |
| 7190 | if (debug_shndx == .UNDEF) continue; | 7190 | if (debug_shndx == .UNDEF) continue; |
| 7191 | const debug_ni = debug_shndx.get(elf).ni; | 7191 | const debug_ni = debug_shndx.get(elf).ni; |
| 7192 | _ = debug_ni.last(&elf.mf).unwrap() orelse continue; | | |
| 7193 | const frame_format = debug_shndx.debugFrameFormat(elf); | 7192 | const frame_format = debug_shndx.debugFrameFormat(elf); |
| 7194 | const unit_padding_ni = elf.addNodeAssumeCapacity( | 7193 | const unit_padding_ni = elf.addNodeAssumeCapacity( |
| 7195 | try debug_ni.addFloatingChild(gpa, &elf.mf, .{ | 7194 | try debug_ni.addFloatingChild(gpa, &elf.mf, .{ |
| ... | @@ -8941,7 +8940,6 @@ fn updateFuncInner( | ... | @@ -8941,7 +8940,6 @@ fn updateFuncInner( |
| 8941 | .debug_frame => elf.shndx.debug_frame, | 8940 | .debug_frame => elf.shndx.debug_frame, |
| 8942 | .eh_frame => elf.shndx.eh_frame, | 8941 | .eh_frame => elf.shndx.eh_frame, |
| 8943 | }.get(elf).ni; | 8942 | }.get(elf).ni; |
| 8944 | try frame_ni.trimStart(gpa, &elf.mf); | | |
| 8945 | switch (wip_nav.frame_format) { | 8943 | switch (wip_nav.frame_format) { |
| 8946 | .debug_frame => {}, | 8944 | .debug_frame => {}, |
| 8947 | .eh_frame => { | 8945 | .eh_frame => { |
| ... | @@ -8953,11 +8951,6 @@ fn updateFuncInner( | ... | @@ -8953,11 +8951,6 @@ fn updateFuncInner( |
| 8953 | }, | 8951 | }, |
| 8954 | .dwarf2 => |debug| { | 8952 | .dwarf2 => |debug| { |
| 8955 | try debug.finishFunc(func_length); | 8953 | try debug.finishFunc(func_length); |
| 8956 | for ([3]Section.Index{ | | |
| 8957 | elf.shndx.debug_info, | | |
| 8958 | elf.shndx.debug_line, | | |
| 8959 | elf.shndx.debug_rnglists, | | |
| 8960 | }) |debug_shndx| try debug_shndx.get(elf).ni.trimStart(gpa, &elf.mf); | | |
| 8961 | const unit = debug.wip_nav.unit.get(debug.wip_nav.dwarf); | 8954 | const unit = debug.wip_nav.unit.get(debug.wip_nav.dwarf); |
| 8962 | { | 8955 | { |
| 8963 | const debug_info_ni = unit.debug_info_ni.unwrap().?; | 8956 | const debug_info_ni = unit.debug_info_ni.unwrap().?; |
| ... | @@ -10928,19 +10921,21 @@ pub fn printNode( | ... | @@ -10928,19 +10921,21 @@ pub fn printNode( |
| 10928 | const zcu = elf.base.comp.zcu.?; | 10921 | const zcu = elf.base.comp.zcu.?; |
| 10929 | const ip = &zcu.intern_pool; | 10922 | const ip = &zcu.intern_pool; |
| 10930 | const nav = ip.getNav(gi.nav(&elf.dwarf)); | 10923 | const nav = ip.getNav(gi.nav(&elf.dwarf)); |
| 10931 | try w.print("({f}, {f})", .{ | 10924 | try w.writeByte('('); |
| 10932 | Type.fromInterned(nav.resolved.?.type).fmt(.{ .zcu = zcu, .tid = tid }), | 10925 | if (nav.resolved) |resolved| try w.print("{f}, ", .{ |
| 10933 | nav.fqn.fmt(ip), | 10926 | Type.fromInterned(resolved.type).fmt(.{ .zcu = zcu, .tid = tid }), |
| 10934 | }); | 10927 | }); |
| | 10928 | try w.print("{f})", .{nav.fqn.fmt(ip)}); |
| 10935 | }, | 10929 | }, |
| 10936 | .func_frame_fde, .func_debug_info, .func_debug_line => |fi| { | 10930 | .func_frame_fde, .func_debug_info, .func_debug_line => |fi| { |
| 10937 | const zcu = elf.base.comp.zcu.?; | 10931 | const zcu = elf.base.comp.zcu.?; |
| 10938 | const ip = &zcu.intern_pool; | 10932 | const ip = &zcu.intern_pool; |
| 10939 | const nav = ip.getNav(fi.nav(&elf.dwarf)); | 10933 | const nav = ip.getNav(fi.nav(&elf.dwarf)); |
| 10940 | try w.print("({f}, {f})", .{ | 10934 | try w.writeByte('('); |
| 10941 | Type.fromInterned(nav.resolved.?.type).fmt(.{ .zcu = zcu, .tid = tid }), | 10935 | if (nav.resolved) |resolved| try w.print("{f}, ", .{ |
| 10942 | nav.fqn.fmt(ip), | 10936 | Type.fromInterned(resolved.type).fmt(.{ .zcu = zcu, .tid = tid }), |
| 10943 | }); | 10937 | }); |
| | 10938 | try w.print("{f})", .{nav.fqn.fmt(ip)}); |
| 10944 | }, | 10939 | }, |
| 10945 | .decl_debug_info => |di| { | 10940 | .decl_debug_info => |di| { |
| 10946 | const comp = elf.base.comp; | 10941 | const comp = elf.base.comp; |
| ... | @@ -10948,10 +10943,7 @@ pub fn printNode( | ... | @@ -10948,10 +10943,7 @@ pub fn printNode( |
| 10948 | const ip = &zcu.intern_pool; | 10943 | const ip = &zcu.intern_pool; |
| 10949 | const src_inst = di.srcInst(&elf.dwarf); | 10944 | const src_inst = di.srcInst(&elf.dwarf); |
| 10950 | try w.print("({f}, ", .{zcu.fileByIndex(src_inst.resolveFile(ip)).path.fmt(comp)}); | 10945 | try w.print("({f}, ", .{zcu.fileByIndex(src_inst.resolveFile(ip)).path.fmt(comp)}); |
| 10951 | if (src_inst.resolve(ip)) |inst| | 10946 | if (src_inst.resolve(ip)) |inst| try w.print("%{d}", .{inst}) else try w.writeAll("lost"); |
| 10952 | try w.print("%{d}", .{inst}) | | |
| 10953 | else | | |
| 10954 | try w.writeAll("lost"); | | |
| 10955 | try w.writeByte(')'); | 10947 | try w.writeByte(')'); |
| 10956 | }, | 10948 | }, |
| 10957 | } | 10949 | } |