| ... | @@ -194,7 +194,7 @@ pub const DeclState = struct { | ... | @@ -194,7 +194,7 @@ pub const DeclState = struct { |
| 194 | dbg_info_buffer.appendAssumeCapacity(0); | 194 | dbg_info_buffer.appendAssumeCapacity(0); |
| 195 | // DW.AT.type, DW.FORM.ref4 | 195 | // DW.AT.type, DW.FORM.ref4 |
| 196 | var index = dbg_info_buffer.items.len; | 196 | var index = dbg_info_buffer.items.len; |
| 197 | try dbg_info_buffer.resize(index + 4); | 197 | try dbg_info_buffer.writer().writeByteNTimes(0, 4); |
| 198 | try self.addTypeRelocGlobal(atom_index, Type.bool, @intCast(index)); | 198 | try self.addTypeRelocGlobal(atom_index, Type.bool, @intCast(index)); |
| 199 | // DW.AT.data_member_location, DW.FORM.udata | 199 | // DW.AT.data_member_location, DW.FORM.udata |
| 200 | try dbg_info_buffer.ensureUnusedCapacity(6); | 200 | try dbg_info_buffer.ensureUnusedCapacity(6); |
| ... | @@ -206,7 +206,7 @@ pub const DeclState = struct { | ... | @@ -206,7 +206,7 @@ pub const DeclState = struct { |
| 206 | dbg_info_buffer.appendAssumeCapacity(0); | 206 | dbg_info_buffer.appendAssumeCapacity(0); |
| 207 | // DW.AT.type, DW.FORM.ref4 | 207 | // DW.AT.type, DW.FORM.ref4 |
| 208 | index = dbg_info_buffer.items.len; | 208 | index = dbg_info_buffer.items.len; |
| 209 | try dbg_info_buffer.resize(index + 4); | 209 | try dbg_info_buffer.writer().writeByteNTimes(0, 4); |
| 210 | try self.addTypeRelocGlobal(atom_index, payload_ty, @intCast(index)); | 210 | try self.addTypeRelocGlobal(atom_index, payload_ty, @intCast(index)); |
| 211 | // DW.AT.data_member_location, DW.FORM.udata | 211 | // DW.AT.data_member_location, DW.FORM.udata |
| 212 | const offset = abi_size - payload_ty.abiSize(mod); | 212 | const offset = abi_size - payload_ty.abiSize(mod); |
| ... | @@ -235,7 +235,7 @@ pub const DeclState = struct { | ... | @@ -235,7 +235,7 @@ pub const DeclState = struct { |
| 235 | dbg_info_buffer.appendAssumeCapacity(0); | 235 | dbg_info_buffer.appendAssumeCapacity(0); |
| 236 | // DW.AT.type, DW.FORM.ref4 | 236 | // DW.AT.type, DW.FORM.ref4 |
| 237 | var index = dbg_info_buffer.items.len; | 237 | var index = dbg_info_buffer.items.len; |
| 238 | try dbg_info_buffer.resize(index + 4); | 238 | try dbg_info_buffer.writer().writeByteNTimes(0, 4); |
| 239 | const ptr_ty = ty.slicePtrFieldType(mod); | 239 | const ptr_ty = ty.slicePtrFieldType(mod); |
| 240 | try self.addTypeRelocGlobal(atom_index, ptr_ty, @intCast(index)); | 240 | try self.addTypeRelocGlobal(atom_index, ptr_ty, @intCast(index)); |
| 241 | // DW.AT.data_member_location, DW.FORM.udata | 241 | // DW.AT.data_member_location, DW.FORM.udata |
| ... | @@ -248,7 +248,7 @@ pub const DeclState = struct { | ... | @@ -248,7 +248,7 @@ pub const DeclState = struct { |
| 248 | dbg_info_buffer.appendAssumeCapacity(0); | 248 | dbg_info_buffer.appendAssumeCapacity(0); |
| 249 | // DW.AT.type, DW.FORM.ref4 | 249 | // DW.AT.type, DW.FORM.ref4 |
| 250 | index = dbg_info_buffer.items.len; | 250 | index = dbg_info_buffer.items.len; |
| 251 | try dbg_info_buffer.resize(index + 4); | 251 | try dbg_info_buffer.writer().writeByteNTimes(0, 4); |
| 252 | try self.addTypeRelocGlobal(atom_index, Type.usize, @intCast(index)); | 252 | try self.addTypeRelocGlobal(atom_index, Type.usize, @intCast(index)); |
| 253 | // DW.AT.data_member_location, DW.FORM.udata | 253 | // DW.AT.data_member_location, DW.FORM.udata |
| 254 | try dbg_info_buffer.ensureUnusedCapacity(2); | 254 | try dbg_info_buffer.ensureUnusedCapacity(2); |
| ... | @@ -260,7 +260,7 @@ pub const DeclState = struct { | ... | @@ -260,7 +260,7 @@ pub const DeclState = struct { |
| 260 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.ptr_type)); | 260 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.ptr_type)); |
| 261 | // DW.AT.type, DW.FORM.ref4 | 261 | // DW.AT.type, DW.FORM.ref4 |
| 262 | const index = dbg_info_buffer.items.len; | 262 | const index = dbg_info_buffer.items.len; |
| 263 | try dbg_info_buffer.resize(index + 4); | 263 | try dbg_info_buffer.writer().writeByteNTimes(0, 4); |
| 264 | try self.addTypeRelocGlobal(atom_index, ty.childType(mod), @intCast(index)); | 264 | try self.addTypeRelocGlobal(atom_index, ty.childType(mod), @intCast(index)); |
| 265 | } | 265 | } |
| 266 | }, | 266 | }, |
| ... | @@ -271,13 +271,13 @@ pub const DeclState = struct { | ... | @@ -271,13 +271,13 @@ pub const DeclState = struct { |
| 271 | try dbg_info_buffer.writer().print("{}\x00", .{ty.fmt(mod)}); | 271 | try dbg_info_buffer.writer().print("{}\x00", .{ty.fmt(mod)}); |
| 272 | // DW.AT.type, DW.FORM.ref4 | 272 | // DW.AT.type, DW.FORM.ref4 |
| 273 | var index = dbg_info_buffer.items.len; | 273 | var index = dbg_info_buffer.items.len; |
| 274 | try dbg_info_buffer.resize(index + 4); | 274 | try dbg_info_buffer.writer().writeByteNTimes(0, 4); |
| 275 | try self.addTypeRelocGlobal(atom_index, ty.childType(mod), @intCast(index)); | 275 | try self.addTypeRelocGlobal(atom_index, ty.childType(mod), @intCast(index)); |
| 276 | // DW.AT.subrange_type | 276 | // DW.AT.subrange_type |
| 277 | try dbg_info_buffer.append(@intFromEnum(AbbrevCode.array_dim)); | 277 | try dbg_info_buffer.append(@intFromEnum(AbbrevCode.array_dim)); |
| 278 | // DW.AT.type, DW.FORM.ref4 | 278 | // DW.AT.type, DW.FORM.ref4 |
| 279 | index = dbg_info_buffer.items.len; | 279 | index = dbg_info_buffer.items.len; |
| 280 | try dbg_info_buffer.resize(index + 4); | 280 | try dbg_info_buffer.writer().writeByteNTimes(0, 4); |
| 281 | try self.addTypeRelocGlobal(atom_index, Type.usize, @intCast(index)); | 281 | try self.addTypeRelocGlobal(atom_index, Type.usize, @intCast(index)); |
| 282 | // DW.AT.count, DW.FORM.udata | 282 | // DW.AT.count, DW.FORM.udata |
| 283 | const len = ty.arrayLenIncludingSentinel(mod); | 283 | const len = ty.arrayLenIncludingSentinel(mod); |
| ... | @@ -304,7 +304,7 @@ pub const DeclState = struct { | ... | @@ -304,7 +304,7 @@ pub const DeclState = struct { |
| 304 | try dbg_info_buffer.writer().print("{d}\x00", .{field_index}); | 304 | try dbg_info_buffer.writer().print("{d}\x00", .{field_index}); |
| 305 | // DW.AT.type, DW.FORM.ref4 | 305 | // DW.AT.type, DW.FORM.ref4 |
| 306 | const index = dbg_info_buffer.items.len; | 306 | const index = dbg_info_buffer.items.len; |
| 307 | try dbg_info_buffer.resize(index + 4); | 307 | try dbg_info_buffer.writer().writeByteNTimes(0, 4); |
| 308 | try self.addTypeRelocGlobal(atom_index, Type.fromInterned(field_ty), @intCast(index)); | 308 | try self.addTypeRelocGlobal(atom_index, Type.fromInterned(field_ty), @intCast(index)); |
| 309 | // DW.AT.data_member_location, DW.FORM.udata | 309 | // DW.AT.data_member_location, DW.FORM.udata |
| 310 | const field_off = ty.structFieldOffset(field_index, mod); | 310 | const field_off = ty.structFieldOffset(field_index, mod); |
| ... | @@ -331,7 +331,7 @@ pub const DeclState = struct { | ... | @@ -331,7 +331,7 @@ pub const DeclState = struct { |
| 331 | try dbg_info_buffer.writer().print("{d}\x00", .{field_index}); | 331 | try dbg_info_buffer.writer().print("{d}\x00", .{field_index}); |
| 332 | // DW.AT.type, DW.FORM.ref4 | 332 | // DW.AT.type, DW.FORM.ref4 |
| 333 | const index = dbg_info_buffer.items.len; | 333 | const index = dbg_info_buffer.items.len; |
| 334 | try dbg_info_buffer.resize(index + 4); | 334 | try dbg_info_buffer.writer().writeByteNTimes(0, 4); |
| 335 | try self.addTypeRelocGlobal(atom_index, Type.fromInterned(field_ty), @intCast(index)); | 335 | try self.addTypeRelocGlobal(atom_index, Type.fromInterned(field_ty), @intCast(index)); |
| 336 | // DW.AT.data_member_location, DW.FORM.udata | 336 | // DW.AT.data_member_location, DW.FORM.udata |
| 337 | try leb128.writeULEB128(dbg_info_buffer.writer(), field_off); | 337 | try leb128.writeULEB128(dbg_info_buffer.writer(), field_off); |
| ... | @@ -352,7 +352,7 @@ pub const DeclState = struct { | ... | @@ -352,7 +352,7 @@ pub const DeclState = struct { |
| 352 | dbg_info_buffer.appendAssumeCapacity(0); | 352 | dbg_info_buffer.appendAssumeCapacity(0); |
| 353 | // DW.AT.type, DW.FORM.ref4 | 353 | // DW.AT.type, DW.FORM.ref4 |
| 354 | const index = dbg_info_buffer.items.len; | 354 | const index = dbg_info_buffer.items.len; |
| 355 | try dbg_info_buffer.resize(index + 4); | 355 | try dbg_info_buffer.writer().writeByteNTimes(0, 4); |
| 356 | try self.addTypeRelocGlobal(atom_index, Type.fromInterned(field_ty), @intCast(index)); | 356 | try self.addTypeRelocGlobal(atom_index, Type.fromInterned(field_ty), @intCast(index)); |
| 357 | // DW.AT.data_member_location, DW.FORM.udata | 357 | // DW.AT.data_member_location, DW.FORM.udata |
| 358 | try leb128.writeULEB128(dbg_info_buffer.writer(), field_off); | 358 | try leb128.writeULEB128(dbg_info_buffer.writer(), field_off); |
| ... | @@ -425,7 +425,7 @@ pub const DeclState = struct { | ... | @@ -425,7 +425,7 @@ pub const DeclState = struct { |
| 425 | dbg_info_buffer.appendAssumeCapacity(0); | 425 | dbg_info_buffer.appendAssumeCapacity(0); |
| 426 | // DW.AT.type, DW.FORM.ref4 | 426 | // DW.AT.type, DW.FORM.ref4 |
| 427 | const inner_union_index = dbg_info_buffer.items.len; | 427 | const inner_union_index = dbg_info_buffer.items.len; |
| 428 | try dbg_info_buffer.resize(inner_union_index + 4); | 428 | try dbg_info_buffer.writer().writeByteNTimes(0, 4); |
| 429 | try self.addTypeRelocLocal(atom_index, @intCast(inner_union_index), 5); | 429 | try self.addTypeRelocLocal(atom_index, @intCast(inner_union_index), 5); |
| 430 | // DW.AT.data_member_location, DW.FORM.udata | 430 | // DW.AT.data_member_location, DW.FORM.udata |
| 431 | try leb128.writeULEB128(dbg_info_buffer.writer(), payload_offset); | 431 | try leb128.writeULEB128(dbg_info_buffer.writer(), payload_offset); |
| ... | @@ -452,7 +452,7 @@ pub const DeclState = struct { | ... | @@ -452,7 +452,7 @@ pub const DeclState = struct { |
| 452 | try dbg_info_buffer.append(0); | 452 | try dbg_info_buffer.append(0); |
| 453 | // DW.AT.type, DW.FORM.ref4 | 453 | // DW.AT.type, DW.FORM.ref4 |
| 454 | const index = dbg_info_buffer.items.len; | 454 | const index = dbg_info_buffer.items.len; |
| 455 | try dbg_info_buffer.resize(index + 4); | 455 | try dbg_info_buffer.writer().writeByteNTimes(0, 4); |
| 456 | try self.addTypeRelocGlobal(atom_index, Type.fromInterned(field_ty), @intCast(index)); | 456 | try self.addTypeRelocGlobal(atom_index, Type.fromInterned(field_ty), @intCast(index)); |
| 457 | // DW.AT.data_member_location, DW.FORM.udata | 457 | // DW.AT.data_member_location, DW.FORM.udata |
| 458 | try dbg_info_buffer.append(0); | 458 | try dbg_info_buffer.append(0); |
| ... | @@ -469,7 +469,7 @@ pub const DeclState = struct { | ... | @@ -469,7 +469,7 @@ pub const DeclState = struct { |
| 469 | dbg_info_buffer.appendAssumeCapacity(0); | 469 | dbg_info_buffer.appendAssumeCapacity(0); |
| 470 | // DW.AT.type, DW.FORM.ref4 | 470 | // DW.AT.type, DW.FORM.ref4 |
| 471 | const index = dbg_info_buffer.items.len; | 471 | const index = dbg_info_buffer.items.len; |
| 472 | try dbg_info_buffer.resize(index + 4); | 472 | try dbg_info_buffer.writer().writeByteNTimes(0, 4); |
| 473 | try self.addTypeRelocGlobal(atom_index, Type.fromInterned(union_obj.enum_tag_ty), @intCast(index)); | 473 | try self.addTypeRelocGlobal(atom_index, Type.fromInterned(union_obj.enum_tag_ty), @intCast(index)); |
| 474 | // DW.AT.data_member_location, DW.FORM.udata | 474 | // DW.AT.data_member_location, DW.FORM.udata |
| 475 | try leb128.writeULEB128(dbg_info_buffer.writer(), tag_offset); | 475 | try leb128.writeULEB128(dbg_info_buffer.writer(), tag_offset); |
| ... | @@ -505,7 +505,7 @@ pub const DeclState = struct { | ... | @@ -505,7 +505,7 @@ pub const DeclState = struct { |
| 505 | dbg_info_buffer.appendAssumeCapacity(0); | 505 | dbg_info_buffer.appendAssumeCapacity(0); |
| 506 | // DW.AT.type, DW.FORM.ref4 | 506 | // DW.AT.type, DW.FORM.ref4 |
| 507 | const index = dbg_info_buffer.items.len; | 507 | const index = dbg_info_buffer.items.len; |
| 508 | try dbg_info_buffer.resize(index + 4); | 508 | try dbg_info_buffer.writer().writeByteNTimes(0, 4); |
| 509 | try self.addTypeRelocGlobal(atom_index, payload_ty, @intCast(index)); | 509 | try self.addTypeRelocGlobal(atom_index, payload_ty, @intCast(index)); |
| 510 | // DW.AT.data_member_location, DW.FORM.udata | 510 | // DW.AT.data_member_location, DW.FORM.udata |
| 511 | try leb128.writeULEB128(dbg_info_buffer.writer(), payload_off); | 511 | try leb128.writeULEB128(dbg_info_buffer.writer(), payload_off); |
| ... | @@ -520,7 +520,7 @@ pub const DeclState = struct { | ... | @@ -520,7 +520,7 @@ pub const DeclState = struct { |
| 520 | dbg_info_buffer.appendAssumeCapacity(0); | 520 | dbg_info_buffer.appendAssumeCapacity(0); |
| 521 | // DW.AT.type, DW.FORM.ref4 | 521 | // DW.AT.type, DW.FORM.ref4 |
| 522 | const index = dbg_info_buffer.items.len; | 522 | const index = dbg_info_buffer.items.len; |
| 523 | try dbg_info_buffer.resize(index + 4); | 523 | try dbg_info_buffer.writer().writeByteNTimes(0, 4); |
| 524 | try self.addTypeRelocGlobal(atom_index, error_ty, @intCast(index)); | 524 | try self.addTypeRelocGlobal(atom_index, error_ty, @intCast(index)); |
| 525 | // DW.AT.data_member_location, DW.FORM.udata | 525 | // DW.AT.data_member_location, DW.FORM.udata |
| 526 | try leb128.writeULEB128(dbg_info_buffer.writer(), error_off); | 526 | try leb128.writeULEB128(dbg_info_buffer.writer(), error_off); |
| ... | @@ -661,7 +661,7 @@ pub const DeclState = struct { | ... | @@ -661,7 +661,7 @@ pub const DeclState = struct { |
| 661 | | 661 | |
| 662 | try dbg_info.ensureUnusedCapacity(5 + name_with_null.len); | 662 | try dbg_info.ensureUnusedCapacity(5 + name_with_null.len); |
| 663 | const index = dbg_info.items.len; | 663 | const index = dbg_info.items.len; |
| 664 | try dbg_info.resize(index + 4); // dw.at.type, dw.form.ref4 | 664 | try dbg_info.writer().writeByteNTimes(0, 4); |
| 665 | try self.addTypeRelocGlobal(atom_index, ty, @intCast(index)); // DW.AT.type, DW.FORM.ref4 | 665 | try self.addTypeRelocGlobal(atom_index, ty, @intCast(index)); // DW.AT.type, DW.FORM.ref4 |
| 666 | dbg_info.appendSliceAssumeCapacity(name_with_null); // DW.AT.name, DW.FORM.string | 666 | dbg_info.appendSliceAssumeCapacity(name_with_null); // DW.AT.name, DW.FORM.string |
| 667 | } | 667 | } |
| ... | @@ -877,7 +877,7 @@ pub const DeclState = struct { | ... | @@ -877,7 +877,7 @@ pub const DeclState = struct { |
| 877 | | 877 | |
| 878 | try dbg_info.ensureUnusedCapacity(5 + name_with_null.len); | 878 | try dbg_info.ensureUnusedCapacity(5 + name_with_null.len); |
| 879 | const index = dbg_info.items.len; | 879 | const index = dbg_info.items.len; |
| 880 | try dbg_info.resize(index + 4); // dw.at.type, dw.form.ref4 | 880 | try dbg_info.writer().writeByteNTimes(0, 4); // dw.at.type, dw.form.ref4 |
| 881 | try self.addTypeRelocGlobal(atom_index, child_ty, @intCast(index)); | 881 | try self.addTypeRelocGlobal(atom_index, child_ty, @intCast(index)); |
| 882 | dbg_info.appendSliceAssumeCapacity(name_with_null); // DW.AT.name, DW.FORM.string | 882 | dbg_info.appendSliceAssumeCapacity(name_with_null); // DW.AT.name, DW.FORM.string |
| 883 | } | 883 | } |