authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-03-05 17:54:29+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-03-05 17:55:01+01:00
log9a027d9ee33277220b8a8a5eb3d4edd575083366
tree1400d902950c7ca5ea3a627a06806229880f4f61
parent0a9088bd0684a517961b35bff458962174099677

macho: fix incorrect line and pc advancement


1 files changed, 0 insertions(+), 12 deletions(-)

src/link/MachO/DebugSymbols.zig-12
...@@ -1126,18 +1126,6 @@ pub fn commitDeclDebugInfo(...@@ -1126,18 +1126,6 @@ pub fn commitDeclDebugInfo(
1126 mem.writeIntLittle(u32, ptr, @intCast(u32, text_block.size));1126 mem.writeIntLittle(u32, ptr, @intCast(u32, text_block.size));
1127 }1127 }
11281128
1129 {
1130 // Advance line and PC.
1131 // TODO encapsulate logic in a helper function.
1132 try dbg_line_buffer.append(DW.LNS.advance_pc);
1133 try leb.writeULEB128(dbg_line_buffer.writer(), text_block.size);
1134
1135 try dbg_line_buffer.append(DW.LNS.advance_line);
1136 const func = decl.val.castTag(.function).?.data;
1137 const line_off = @intCast(u28, func.rbrace_line - func.lbrace_line);
1138 try leb.writeULEB128(dbg_line_buffer.writer(), line_off);
1139 }
1140
1141 try dbg_line_buffer.appendSlice(&[_]u8{ DW.LNS.extended_op, 1, DW.LNE.end_sequence });1129 try dbg_line_buffer.appendSlice(&[_]u8{ DW.LNS.extended_op, 1, DW.LNE.end_sequence });
11421130
1143 // Now we have the full contents and may allocate a region to store it.1131 // Now we have the full contents and may allocate a region to store it.