| ... | @@ -261,14 +261,23 @@ const DbgInfoReloc = struct { | ... | @@ -261,14 +261,23 @@ const DbgInfoReloc = struct { |
| 261 | | 261 | |
| 262 | .ptr_stack_offset, | 262 | .ptr_stack_offset, |
| 263 | .stack_offset, | 263 | .stack_offset, |
| 264 | => |off| { | 264 | .stack_argument_offset, |
| | 265 | => |offset| { |
| | 266 | const adjusted_offset = switch (reloc.mcv) { |
| | 267 | .ptr_stack_offset, |
| | 268 | .stack_offset, |
| | 269 | => -@intCast(i32, offset), |
| | 270 | .stack_argument_offset => @intCast(i32, function.saved_regs_stack_space + offset), |
| | 271 | else => unreachable, |
| | 272 | }; |
| | 273 | |
| 265 | try dbg_info.ensureUnusedCapacity(7); | 274 | try dbg_info.ensureUnusedCapacity(7); |
| 266 | const fixup = dbg_info.items.len; | 275 | const fixup = dbg_info.items.len; |
| 267 | dbg_info.appendSliceAssumeCapacity(&[2]u8{ // DW.AT.location, DW.FORM.exprloc | 276 | dbg_info.appendSliceAssumeCapacity(&[2]u8{ // DW.AT.location, DW.FORM.exprloc |
| 268 | 1, // we will backpatch it after we encode the displacement in LEB128 | 277 | 1, // we will backpatch it after we encode the displacement in LEB128 |
| 269 | Register.x29.dwarfLocOpDeref(), // frame pointer | 278 | Register.x29.dwarfLocOpDeref(), // frame pointer |
| 270 | }); | 279 | }); |
| 271 | leb128.writeILEB128(dbg_info.writer(), -@intCast(i32, off)) catch unreachable; | 280 | leb128.writeILEB128(dbg_info.writer(), adjusted_offset) catch unreachable; |
| 272 | dbg_info.items[fixup] += @intCast(u8, dbg_info.items.len - fixup - 2); | 281 | dbg_info.items[fixup] += @intCast(u8, dbg_info.items.len - fixup - 2); |
| 273 | }, | 282 | }, |
| 274 | | 283 | |
| ... | @@ -353,8 +362,6 @@ const DbgInfoReloc = struct { | ... | @@ -353,8 +362,6 @@ const DbgInfoReloc = struct { |
| 353 | }); | 362 | }); |
| 354 | }, | 363 | }, |
| 355 | | 364 | |
| 356 | .stack_argument_offset => unreachable, | | |
| 357 | | | |
| 358 | else => { | 365 | else => { |
| 359 | try dbg_info.ensureUnusedCapacity(2); | 366 | try dbg_info.ensureUnusedCapacity(2); |
| 360 | dbg_info.appendSliceAssumeCapacity(&[2]u8{ // DW.AT.location, DW.FORM.exprloc | 367 | dbg_info.appendSliceAssumeCapacity(&[2]u8{ // DW.AT.location, DW.FORM.exprloc |