Commit 9a027d9ee3

Jakub Konka <kubkon@jakubkonka.com>
2022-03-05 17:54:29
macho: fix incorrect line and pc advancement
1 parent 0a9088b
Changed files (1)
src
link
src/link/MachO/DebugSymbols.zig
@@ -1126,18 +1126,6 @@ pub fn commitDeclDebugInfo(
                 mem.writeIntLittle(u32, ptr, @intCast(u32, text_block.size));
             }
 
-            {
-                // Advance line and PC.
-                // TODO encapsulate logic in a helper function.
-                try dbg_line_buffer.append(DW.LNS.advance_pc);
-                try leb.writeULEB128(dbg_line_buffer.writer(), text_block.size);
-
-                try dbg_line_buffer.append(DW.LNS.advance_line);
-                const func = decl.val.castTag(.function).?.data;
-                const line_off = @intCast(u28, func.rbrace_line - func.lbrace_line);
-                try leb.writeULEB128(dbg_line_buffer.writer(), line_off);
-            }
-
             try dbg_line_buffer.appendSlice(&[_]u8{ DW.LNS.extended_op, 1, DW.LNE.end_sequence });
 
             // Now we have the full contents and may allocate a region to store it.