| ... | @@ -140,11 +140,11 @@ pub const DeclState = struct { | ... | @@ -140,11 +140,11 @@ pub const DeclState = struct { |
| 140 | switch (ty.zigTypeTag(mod)) { | 140 | switch (ty.zigTypeTag(mod)) { |
| 141 | .NoReturn => unreachable, | 141 | .NoReturn => unreachable, |
| 142 | .Void => { | 142 | .Void => { |
| 143 | try dbg_info_buffer.append(@intFromEnum(AbbrevKind.pad1)); | 143 | try dbg_info_buffer.append(@intFromEnum(AbbrevCode.zero_bit_type)); |
| 144 | }, | 144 | }, |
| 145 | .Bool => { | 145 | .Bool => { |
| 146 | try dbg_info_buffer.ensureUnusedCapacity(12); | 146 | try dbg_info_buffer.ensureUnusedCapacity(12); |
| 147 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.base_type)); | 147 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.base_type)); |
| 148 | // DW.AT.encoding, DW.FORM.data1 | 148 | // DW.AT.encoding, DW.FORM.data1 |
| 149 | dbg_info_buffer.appendAssumeCapacity(DW.ATE.boolean); | 149 | dbg_info_buffer.appendAssumeCapacity(DW.ATE.boolean); |
| 150 | // DW.AT.byte_size, DW.FORM.udata | 150 | // DW.AT.byte_size, DW.FORM.udata |
| ... | @@ -155,7 +155,7 @@ pub const DeclState = struct { | ... | @@ -155,7 +155,7 @@ pub const DeclState = struct { |
| 155 | .Int => { | 155 | .Int => { |
| 156 | const info = ty.intInfo(mod); | 156 | const info = ty.intInfo(mod); |
| 157 | try dbg_info_buffer.ensureUnusedCapacity(12); | 157 | try dbg_info_buffer.ensureUnusedCapacity(12); |
| 158 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.base_type)); | 158 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.base_type)); |
| 159 | // DW.AT.encoding, DW.FORM.data1 | 159 | // DW.AT.encoding, DW.FORM.data1 |
| 160 | dbg_info_buffer.appendAssumeCapacity(switch (info.signedness) { | 160 | dbg_info_buffer.appendAssumeCapacity(switch (info.signedness) { |
| 161 | .signed => DW.ATE.signed, | 161 | .signed => DW.ATE.signed, |
| ... | @@ -169,7 +169,7 @@ pub const DeclState = struct { | ... | @@ -169,7 +169,7 @@ pub const DeclState = struct { |
| 169 | .Optional => { | 169 | .Optional => { |
| 170 | if (ty.isPtrLikeOptional(mod)) { | 170 | if (ty.isPtrLikeOptional(mod)) { |
| 171 | try dbg_info_buffer.ensureUnusedCapacity(12); | 171 | try dbg_info_buffer.ensureUnusedCapacity(12); |
| 172 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.base_type)); | 172 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.base_type)); |
| 173 | // DW.AT.encoding, DW.FORM.data1 | 173 | // DW.AT.encoding, DW.FORM.data1 |
| 174 | dbg_info_buffer.appendAssumeCapacity(DW.ATE.address); | 174 | dbg_info_buffer.appendAssumeCapacity(DW.ATE.address); |
| 175 | // DW.AT.byte_size, DW.FORM.udata | 175 | // DW.AT.byte_size, DW.FORM.udata |
| ... | @@ -180,7 +180,7 @@ pub const DeclState = struct { | ... | @@ -180,7 +180,7 @@ pub const DeclState = struct { |
| 180 | // Non-pointer optionals are structs: struct { .maybe = *, .val = * } | 180 | // Non-pointer optionals are structs: struct { .maybe = *, .val = * } |
| 181 | const payload_ty = ty.optionalChild(mod); | 181 | const payload_ty = ty.optionalChild(mod); |
| 182 | // DW.AT.structure_type | 182 | // DW.AT.structure_type |
| 183 | try dbg_info_buffer.append(@intFromEnum(AbbrevKind.struct_type)); | 183 | try dbg_info_buffer.append(@intFromEnum(AbbrevCode.struct_type)); |
| 184 | // DW.AT.byte_size, DW.FORM.udata | 184 | // DW.AT.byte_size, DW.FORM.udata |
| 185 | const abi_size = ty.abiSize(mod); | 185 | const abi_size = ty.abiSize(mod); |
| 186 | try leb128.writeULEB128(dbg_info_buffer.writer(), abi_size); | 186 | try leb128.writeULEB128(dbg_info_buffer.writer(), abi_size); |
| ... | @@ -188,7 +188,7 @@ pub const DeclState = struct { | ... | @@ -188,7 +188,7 @@ pub const DeclState = struct { |
| 188 | try dbg_info_buffer.writer().print("{}\x00", .{ty.fmt(mod)}); | 188 | try dbg_info_buffer.writer().print("{}\x00", .{ty.fmt(mod)}); |
| 189 | // DW.AT.member | 189 | // DW.AT.member |
| 190 | try dbg_info_buffer.ensureUnusedCapacity(7); | 190 | try dbg_info_buffer.ensureUnusedCapacity(7); |
| 191 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.struct_member)); | 191 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.struct_member)); |
| 192 | // DW.AT.name, DW.FORM.string | 192 | // DW.AT.name, DW.FORM.string |
| 193 | dbg_info_buffer.appendSliceAssumeCapacity("maybe"); | 193 | dbg_info_buffer.appendSliceAssumeCapacity("maybe"); |
| 194 | dbg_info_buffer.appendAssumeCapacity(0); | 194 | dbg_info_buffer.appendAssumeCapacity(0); |
| ... | @@ -200,7 +200,7 @@ pub const DeclState = struct { | ... | @@ -200,7 +200,7 @@ pub const DeclState = struct { |
| 200 | try dbg_info_buffer.ensureUnusedCapacity(6); | 200 | try dbg_info_buffer.ensureUnusedCapacity(6); |
| 201 | dbg_info_buffer.appendAssumeCapacity(0); | 201 | dbg_info_buffer.appendAssumeCapacity(0); |
| 202 | // DW.AT.member | 202 | // DW.AT.member |
| 203 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.struct_member)); | 203 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.struct_member)); |
| 204 | // DW.AT.name, DW.FORM.string | 204 | // DW.AT.name, DW.FORM.string |
| 205 | dbg_info_buffer.appendSliceAssumeCapacity("val"); | 205 | dbg_info_buffer.appendSliceAssumeCapacity("val"); |
| 206 | dbg_info_buffer.appendAssumeCapacity(0); | 206 | dbg_info_buffer.appendAssumeCapacity(0); |
| ... | @@ -222,14 +222,14 @@ pub const DeclState = struct { | ... | @@ -222,14 +222,14 @@ pub const DeclState = struct { |
| 222 | const ptr_bytes: u8 = @intCast(@divExact(ptr_bits, 8)); | 222 | const ptr_bytes: u8 = @intCast(@divExact(ptr_bits, 8)); |
| 223 | // DW.AT.structure_type | 223 | // DW.AT.structure_type |
| 224 | try dbg_info_buffer.ensureUnusedCapacity(2); | 224 | try dbg_info_buffer.ensureUnusedCapacity(2); |
| 225 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.struct_type)); | 225 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.struct_type)); |
| 226 | // DW.AT.byte_size, DW.FORM.udata | 226 | // DW.AT.byte_size, DW.FORM.udata |
| 227 | try leb128.writeULEB128(dbg_info_buffer.writer(), ty.abiSize(mod)); | 227 | try leb128.writeULEB128(dbg_info_buffer.writer(), ty.abiSize(mod)); |
| 228 | // DW.AT.name, DW.FORM.string | 228 | // DW.AT.name, DW.FORM.string |
| 229 | try dbg_info_buffer.writer().print("{}\x00", .{ty.fmt(mod)}); | 229 | try dbg_info_buffer.writer().print("{}\x00", .{ty.fmt(mod)}); |
| 230 | // DW.AT.member | 230 | // DW.AT.member |
| 231 | try dbg_info_buffer.ensureUnusedCapacity(5); | 231 | try dbg_info_buffer.ensureUnusedCapacity(5); |
| 232 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.struct_member)); | 232 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.struct_member)); |
| 233 | // DW.AT.name, DW.FORM.string | 233 | // DW.AT.name, DW.FORM.string |
| 234 | dbg_info_buffer.appendSliceAssumeCapacity("ptr"); | 234 | dbg_info_buffer.appendSliceAssumeCapacity("ptr"); |
| 235 | dbg_info_buffer.appendAssumeCapacity(0); | 235 | dbg_info_buffer.appendAssumeCapacity(0); |
| ... | @@ -242,7 +242,7 @@ pub const DeclState = struct { | ... | @@ -242,7 +242,7 @@ pub const DeclState = struct { |
| 242 | try dbg_info_buffer.ensureUnusedCapacity(6); | 242 | try dbg_info_buffer.ensureUnusedCapacity(6); |
| 243 | dbg_info_buffer.appendAssumeCapacity(0); | 243 | dbg_info_buffer.appendAssumeCapacity(0); |
| 244 | // DW.AT.member | 244 | // DW.AT.member |
| 245 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.struct_member)); | 245 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.struct_member)); |
| 246 | // DW.AT.name, DW.FORM.string | 246 | // DW.AT.name, DW.FORM.string |
| 247 | dbg_info_buffer.appendSliceAssumeCapacity("len"); | 247 | dbg_info_buffer.appendSliceAssumeCapacity("len"); |
| 248 | dbg_info_buffer.appendAssumeCapacity(0); | 248 | dbg_info_buffer.appendAssumeCapacity(0); |
| ... | @@ -257,7 +257,7 @@ pub const DeclState = struct { | ... | @@ -257,7 +257,7 @@ pub const DeclState = struct { |
| 257 | dbg_info_buffer.appendAssumeCapacity(0); | 257 | dbg_info_buffer.appendAssumeCapacity(0); |
| 258 | } else { | 258 | } else { |
| 259 | try dbg_info_buffer.ensureUnusedCapacity(5); | 259 | try dbg_info_buffer.ensureUnusedCapacity(5); |
| 260 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.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.resize(index + 4); |
| ... | @@ -266,7 +266,7 @@ pub const DeclState = struct { | ... | @@ -266,7 +266,7 @@ pub const DeclState = struct { |
| 266 | }, | 266 | }, |
| 267 | .Array => { | 267 | .Array => { |
| 268 | // DW.AT.array_type | 268 | // DW.AT.array_type |
| 269 | try dbg_info_buffer.append(@intFromEnum(AbbrevKind.array_type)); | 269 | try dbg_info_buffer.append(@intFromEnum(AbbrevCode.array_type)); |
| 270 | // DW.AT.name, DW.FORM.string | 270 | // DW.AT.name, DW.FORM.string |
| 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 |
| ... | @@ -274,7 +274,7 @@ pub const DeclState = struct { | ... | @@ -274,7 +274,7 @@ pub const DeclState = struct { |
| 274 | try dbg_info_buffer.resize(index + 4); | 274 | try dbg_info_buffer.resize(index + 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(AbbrevKind.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.resize(index + 4); |
| ... | @@ -287,7 +287,7 @@ pub const DeclState = struct { | ... | @@ -287,7 +287,7 @@ pub const DeclState = struct { |
| 287 | }, | 287 | }, |
| 288 | .Struct => { | 288 | .Struct => { |
| 289 | // DW.AT.structure_type | 289 | // DW.AT.structure_type |
| 290 | try dbg_info_buffer.append(@intFromEnum(AbbrevKind.struct_type)); | 290 | try dbg_info_buffer.append(@intFromEnum(AbbrevCode.struct_type)); |
| 291 | // DW.AT.byte_size, DW.FORM.udata | 291 | // DW.AT.byte_size, DW.FORM.udata |
| 292 | try leb128.writeULEB128(dbg_info_buffer.writer(), ty.abiSize(mod)); | 292 | try leb128.writeULEB128(dbg_info_buffer.writer(), ty.abiSize(mod)); |
| 293 | | 293 | |
| ... | @@ -299,7 +299,7 @@ pub const DeclState = struct { | ... | @@ -299,7 +299,7 @@ pub const DeclState = struct { |
| 299 | | 299 | |
| 300 | for (fields.types.get(ip), 0..) |field_ty, field_index| { | 300 | for (fields.types.get(ip), 0..) |field_ty, field_index| { |
| 301 | // DW.AT.member | 301 | // DW.AT.member |
| 302 | try dbg_info_buffer.append(@intFromEnum(AbbrevKind.struct_member)); | 302 | try dbg_info_buffer.append(@intFromEnum(AbbrevCode.struct_member)); |
| 303 | // DW.AT.name, DW.FORM.string | 303 | // DW.AT.name, DW.FORM.string |
| 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 |
| ... | @@ -325,7 +325,7 @@ pub const DeclState = struct { | ... | @@ -325,7 +325,7 @@ pub const DeclState = struct { |
| 325 | for (struct_type.field_types.get(ip), struct_type.offsets.get(ip), 0..) |field_ty, field_off, field_index| { | 325 | for (struct_type.field_types.get(ip), struct_type.offsets.get(ip), 0..) |field_ty, field_off, field_index| { |
| 326 | if (!Type.fromInterned(field_ty).hasRuntimeBits(mod)) continue; | 326 | if (!Type.fromInterned(field_ty).hasRuntimeBits(mod)) continue; |
| 327 | // DW.AT.member | 327 | // DW.AT.member |
| 328 | try dbg_info_buffer.append(@intFromEnum(AbbrevKind.struct_member)); | 328 | try dbg_info_buffer.append(@intFromEnum(AbbrevCode.struct_member)); |
| 329 | // DW.AT.name, DW.FORM.string | 329 | // DW.AT.name, DW.FORM.string |
| 330 | try dbg_info_buffer.writer().print("{d}\x00", .{field_index}); | 330 | try dbg_info_buffer.writer().print("{d}\x00", .{field_index}); |
| 331 | // DW.AT.type, DW.FORM.ref4 | 331 | // DW.AT.type, DW.FORM.ref4 |
| ... | @@ -345,7 +345,7 @@ pub const DeclState = struct { | ... | @@ -345,7 +345,7 @@ pub const DeclState = struct { |
| 345 | const field_name = ip.stringToSlice(field_name_ip); | 345 | const field_name = ip.stringToSlice(field_name_ip); |
| 346 | // DW.AT.member | 346 | // DW.AT.member |
| 347 | try dbg_info_buffer.ensureUnusedCapacity(field_name.len + 2); | 347 | try dbg_info_buffer.ensureUnusedCapacity(field_name.len + 2); |
| 348 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.struct_member)); | 348 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.struct_member)); |
| 349 | // DW.AT.name, DW.FORM.string | 349 | // DW.AT.name, DW.FORM.string |
| 350 | dbg_info_buffer.appendSliceAssumeCapacity(field_name); | 350 | dbg_info_buffer.appendSliceAssumeCapacity(field_name); |
| 351 | dbg_info_buffer.appendAssumeCapacity(0); | 351 | dbg_info_buffer.appendAssumeCapacity(0); |
| ... | @@ -367,7 +367,7 @@ pub const DeclState = struct { | ... | @@ -367,7 +367,7 @@ pub const DeclState = struct { |
| 367 | }, | 367 | }, |
| 368 | .Enum => { | 368 | .Enum => { |
| 369 | // DW.AT.enumeration_type | 369 | // DW.AT.enumeration_type |
| 370 | try dbg_info_buffer.append(@intFromEnum(AbbrevKind.enum_type)); | 370 | try dbg_info_buffer.append(@intFromEnum(AbbrevCode.enum_type)); |
| 371 | // DW.AT.byte_size, DW.FORM.udata | 371 | // DW.AT.byte_size, DW.FORM.udata |
| 372 | try leb128.writeULEB128(dbg_info_buffer.writer(), ty.abiSize(mod)); | 372 | try leb128.writeULEB128(dbg_info_buffer.writer(), ty.abiSize(mod)); |
| 373 | // DW.AT.name, DW.FORM.string | 373 | // DW.AT.name, DW.FORM.string |
| ... | @@ -379,7 +379,7 @@ pub const DeclState = struct { | ... | @@ -379,7 +379,7 @@ pub const DeclState = struct { |
| 379 | const field_name = ip.stringToSlice(field_name_index); | 379 | const field_name = ip.stringToSlice(field_name_index); |
| 380 | // DW.AT.enumerator | 380 | // DW.AT.enumerator |
| 381 | try dbg_info_buffer.ensureUnusedCapacity(field_name.len + 2 + @sizeOf(u64)); | 381 | try dbg_info_buffer.ensureUnusedCapacity(field_name.len + 2 + @sizeOf(u64)); |
| 382 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.enum_variant)); | 382 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.enum_variant)); |
| 383 | // DW.AT.name, DW.FORM.string | 383 | // DW.AT.name, DW.FORM.string |
| 384 | dbg_info_buffer.appendSliceAssumeCapacity(field_name); | 384 | dbg_info_buffer.appendSliceAssumeCapacity(field_name); |
| 385 | dbg_info_buffer.appendAssumeCapacity(0); | 385 | dbg_info_buffer.appendAssumeCapacity(0); |
| ... | @@ -409,7 +409,7 @@ pub const DeclState = struct { | ... | @@ -409,7 +409,7 @@ pub const DeclState = struct { |
| 409 | const is_tagged = layout.tag_size > 0; | 409 | const is_tagged = layout.tag_size > 0; |
| 410 | if (is_tagged) { | 410 | if (is_tagged) { |
| 411 | // DW.AT.structure_type | 411 | // DW.AT.structure_type |
| 412 | try dbg_info_buffer.append(@intFromEnum(AbbrevKind.struct_type)); | 412 | try dbg_info_buffer.append(@intFromEnum(AbbrevCode.struct_type)); |
| 413 | // DW.AT.byte_size, DW.FORM.udata | 413 | // DW.AT.byte_size, DW.FORM.udata |
| 414 | try leb128.writeULEB128(dbg_info_buffer.writer(), layout.abi_size); | 414 | try leb128.writeULEB128(dbg_info_buffer.writer(), layout.abi_size); |
| 415 | // DW.AT.name, DW.FORM.string | 415 | // DW.AT.name, DW.FORM.string |
| ... | @@ -418,7 +418,7 @@ pub const DeclState = struct { | ... | @@ -418,7 +418,7 @@ pub const DeclState = struct { |
| 418 | | 418 | |
| 419 | // DW.AT.member | 419 | // DW.AT.member |
| 420 | try dbg_info_buffer.ensureUnusedCapacity(9); | 420 | try dbg_info_buffer.ensureUnusedCapacity(9); |
| 421 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.struct_member)); | 421 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.struct_member)); |
| 422 | // DW.AT.name, DW.FORM.string | 422 | // DW.AT.name, DW.FORM.string |
| 423 | dbg_info_buffer.appendSliceAssumeCapacity("payload"); | 423 | dbg_info_buffer.appendSliceAssumeCapacity("payload"); |
| 424 | dbg_info_buffer.appendAssumeCapacity(0); | 424 | dbg_info_buffer.appendAssumeCapacity(0); |
| ... | @@ -431,7 +431,7 @@ pub const DeclState = struct { | ... | @@ -431,7 +431,7 @@ pub const DeclState = struct { |
| 431 | } | 431 | } |
| 432 | | 432 | |
| 433 | // DW.AT.union_type | 433 | // DW.AT.union_type |
| 434 | try dbg_info_buffer.append(@intFromEnum(AbbrevKind.union_type)); | 434 | try dbg_info_buffer.append(@intFromEnum(AbbrevCode.union_type)); |
| 435 | // DW.AT.byte_size, DW.FORM.udata, | 435 | // DW.AT.byte_size, DW.FORM.udata, |
| 436 | try leb128.writeULEB128(dbg_info_buffer.writer(), layout.payload_size); | 436 | try leb128.writeULEB128(dbg_info_buffer.writer(), layout.payload_size); |
| 437 | // DW.AT.name, DW.FORM.string | 437 | // DW.AT.name, DW.FORM.string |
| ... | @@ -445,7 +445,7 @@ pub const DeclState = struct { | ... | @@ -445,7 +445,7 @@ pub const DeclState = struct { |
| 445 | for (union_obj.field_types.get(ip), union_obj.field_names.get(ip)) |field_ty, field_name| { | 445 | for (union_obj.field_types.get(ip), union_obj.field_names.get(ip)) |field_ty, field_name| { |
| 446 | if (!Type.fromInterned(field_ty).hasRuntimeBits(mod)) continue; | 446 | if (!Type.fromInterned(field_ty).hasRuntimeBits(mod)) continue; |
| 447 | // DW.AT.member | 447 | // DW.AT.member |
| 448 | try dbg_info_buffer.append(@intFromEnum(AbbrevKind.struct_member)); | 448 | try dbg_info_buffer.append(@intFromEnum(AbbrevCode.struct_member)); |
| 449 | // DW.AT.name, DW.FORM.string | 449 | // DW.AT.name, DW.FORM.string |
| 450 | try dbg_info_buffer.appendSlice(ip.stringToSlice(field_name)); | 450 | try dbg_info_buffer.appendSlice(ip.stringToSlice(field_name)); |
| 451 | try dbg_info_buffer.append(0); | 451 | try dbg_info_buffer.append(0); |
| ... | @@ -462,7 +462,7 @@ pub const DeclState = struct { | ... | @@ -462,7 +462,7 @@ pub const DeclState = struct { |
| 462 | if (is_tagged) { | 462 | if (is_tagged) { |
| 463 | // DW.AT.member | 463 | // DW.AT.member |
| 464 | try dbg_info_buffer.ensureUnusedCapacity(5); | 464 | try dbg_info_buffer.ensureUnusedCapacity(5); |
| 465 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.struct_member)); | 465 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.struct_member)); |
| 466 | // DW.AT.name, DW.FORM.string | 466 | // DW.AT.name, DW.FORM.string |
| 467 | dbg_info_buffer.appendSliceAssumeCapacity("tag"); | 467 | dbg_info_buffer.appendSliceAssumeCapacity("tag"); |
| 468 | dbg_info_buffer.appendAssumeCapacity(0); | 468 | dbg_info_buffer.appendAssumeCapacity(0); |
| ... | @@ -488,7 +488,7 @@ pub const DeclState = struct { | ... | @@ -488,7 +488,7 @@ pub const DeclState = struct { |
| 488 | const error_off = if (error_align.compare(.gte, payload_align)) 0 else payload_ty.abiSize(mod); | 488 | const error_off = if (error_align.compare(.gte, payload_align)) 0 else payload_ty.abiSize(mod); |
| 489 | | 489 | |
| 490 | // DW.AT.structure_type | 490 | // DW.AT.structure_type |
| 491 | try dbg_info_buffer.append(@intFromEnum(AbbrevKind.struct_type)); | 491 | try dbg_info_buffer.append(@intFromEnum(AbbrevCode.struct_type)); |
| 492 | // DW.AT.byte_size, DW.FORM.udata | 492 | // DW.AT.byte_size, DW.FORM.udata |
| 493 | try leb128.writeULEB128(dbg_info_buffer.writer(), abi_size); | 493 | try leb128.writeULEB128(dbg_info_buffer.writer(), abi_size); |
| 494 | // DW.AT.name, DW.FORM.string | 494 | // DW.AT.name, DW.FORM.string |
| ... | @@ -498,7 +498,7 @@ pub const DeclState = struct { | ... | @@ -498,7 +498,7 @@ pub const DeclState = struct { |
| 498 | if (!payload_ty.isNoReturn(mod)) { | 498 | if (!payload_ty.isNoReturn(mod)) { |
| 499 | // DW.AT.member | 499 | // DW.AT.member |
| 500 | try dbg_info_buffer.ensureUnusedCapacity(7); | 500 | try dbg_info_buffer.ensureUnusedCapacity(7); |
| 501 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.struct_member)); | 501 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.struct_member)); |
| 502 | // DW.AT.name, DW.FORM.string | 502 | // DW.AT.name, DW.FORM.string |
| 503 | dbg_info_buffer.appendSliceAssumeCapacity("value"); | 503 | dbg_info_buffer.appendSliceAssumeCapacity("value"); |
| 504 | dbg_info_buffer.appendAssumeCapacity(0); | 504 | dbg_info_buffer.appendAssumeCapacity(0); |
| ... | @@ -513,7 +513,7 @@ pub const DeclState = struct { | ... | @@ -513,7 +513,7 @@ pub const DeclState = struct { |
| 513 | { | 513 | { |
| 514 | // DW.AT.member | 514 | // DW.AT.member |
| 515 | try dbg_info_buffer.ensureUnusedCapacity(5); | 515 | try dbg_info_buffer.ensureUnusedCapacity(5); |
| 516 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.struct_member)); | 516 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.struct_member)); |
| 517 | // DW.AT.name, DW.FORM.string | 517 | // DW.AT.name, DW.FORM.string |
| 518 | dbg_info_buffer.appendSliceAssumeCapacity("err"); | 518 | dbg_info_buffer.appendSliceAssumeCapacity("err"); |
| 519 | dbg_info_buffer.appendAssumeCapacity(0); | 519 | dbg_info_buffer.appendAssumeCapacity(0); |
| ... | @@ -530,7 +530,7 @@ pub const DeclState = struct { | ... | @@ -530,7 +530,7 @@ pub const DeclState = struct { |
| 530 | }, | 530 | }, |
| 531 | else => { | 531 | else => { |
| 532 | log.debug("TODO implement .debug_info for type '{}'", .{ty.fmt(self.mod)}); | 532 | log.debug("TODO implement .debug_info for type '{}'", .{ty.fmt(self.mod)}); |
| 533 | try dbg_info_buffer.append(@intFromEnum(AbbrevKind.pad1)); | 533 | try dbg_info_buffer.append(@intFromEnum(AbbrevCode.zero_bit_type)); |
| 534 | }, | 534 | }, |
| 535 | } | 535 | } |
| 536 | } | 536 | } |
| ... | @@ -565,7 +565,7 @@ pub const DeclState = struct { | ... | @@ -565,7 +565,7 @@ pub const DeclState = struct { |
| 565 | switch (loc) { | 565 | switch (loc) { |
| 566 | .register => |reg| { | 566 | .register => |reg| { |
| 567 | try dbg_info.ensureUnusedCapacity(4); | 567 | try dbg_info.ensureUnusedCapacity(4); |
| 568 | dbg_info.appendAssumeCapacity(@intFromEnum(AbbrevKind.parameter)); | 568 | dbg_info.appendAssumeCapacity(@intFromEnum(AbbrevCode.parameter)); |
| 569 | // DW.AT.location, DW.FORM.exprloc | 569 | // DW.AT.location, DW.FORM.exprloc |
| 570 | var expr_len = std.io.countingWriter(std.io.null_writer); | 570 | var expr_len = std.io.countingWriter(std.io.null_writer); |
| 571 | if (reg < 32) { | 571 | if (reg < 32) { |
| ... | @@ -587,7 +587,7 @@ pub const DeclState = struct { | ... | @@ -587,7 +587,7 @@ pub const DeclState = struct { |
| 587 | const reg_bytes: u8 = @intCast(@divExact(reg_bits, 8)); | 587 | const reg_bytes: u8 = @intCast(@divExact(reg_bits, 8)); |
| 588 | const abi_size = ty.abiSize(self.mod); | 588 | const abi_size = ty.abiSize(self.mod); |
| 589 | try dbg_info.ensureUnusedCapacity(10); | 589 | try dbg_info.ensureUnusedCapacity(10); |
| 590 | dbg_info.appendAssumeCapacity(@intFromEnum(AbbrevKind.parameter)); | 590 | dbg_info.appendAssumeCapacity(@intFromEnum(AbbrevCode.parameter)); |
| 591 | // DW.AT.location, DW.FORM.exprloc | 591 | // DW.AT.location, DW.FORM.exprloc |
| 592 | var expr_len = std.io.countingWriter(std.io.null_writer); | 592 | var expr_len = std.io.countingWriter(std.io.null_writer); |
| 593 | for (regs, 0..) |reg, reg_i| { | 593 | for (regs, 0..) |reg, reg_i| { |
| ... | @@ -620,7 +620,7 @@ pub const DeclState = struct { | ... | @@ -620,7 +620,7 @@ pub const DeclState = struct { |
| 620 | }, | 620 | }, |
| 621 | .stack => |info| { | 621 | .stack => |info| { |
| 622 | try dbg_info.ensureUnusedCapacity(9); | 622 | try dbg_info.ensureUnusedCapacity(9); |
| 623 | dbg_info.appendAssumeCapacity(@intFromEnum(AbbrevKind.parameter)); | 623 | dbg_info.appendAssumeCapacity(@intFromEnum(AbbrevCode.parameter)); |
| 624 | // DW.AT.location, DW.FORM.exprloc | 624 | // DW.AT.location, DW.FORM.exprloc |
| 625 | var expr_len = std.io.countingWriter(std.io.null_writer); | 625 | var expr_len = std.io.countingWriter(std.io.null_writer); |
| 626 | if (info.fp_register < 32) { | 626 | if (info.fp_register < 32) { |
| ... | @@ -649,7 +649,7 @@ pub const DeclState = struct { | ... | @@ -649,7 +649,7 @@ pub const DeclState = struct { |
| 649 | // where each argument is encoded as | 649 | // where each argument is encoded as |
| 650 | // <opcode> i:uleb128 | 650 | // <opcode> i:uleb128 |
| 651 | dbg_info.appendSliceAssumeCapacity(&.{ | 651 | dbg_info.appendSliceAssumeCapacity(&.{ |
| 652 | @intFromEnum(AbbrevKind.parameter), | 652 | @intFromEnum(AbbrevCode.parameter), |
| 653 | DW.OP.WASM_location, | 653 | DW.OP.WASM_location, |
| 654 | DW.OP.WASM_local, | 654 | DW.OP.WASM_local, |
| 655 | }); | 655 | }); |
| ... | @@ -676,7 +676,7 @@ pub const DeclState = struct { | ... | @@ -676,7 +676,7 @@ pub const DeclState = struct { |
| 676 | const dbg_info = &self.dbg_info; | 676 | const dbg_info = &self.dbg_info; |
| 677 | const atom_index = self.di_atom_decls.get(owner_decl).?; | 677 | const atom_index = self.di_atom_decls.get(owner_decl).?; |
| 678 | const name_with_null = name.ptr[0 .. name.len + 1]; | 678 | const name_with_null = name.ptr[0 .. name.len + 1]; |
| 679 | try dbg_info.append(@intFromEnum(AbbrevKind.variable)); | 679 | try dbg_info.append(@intFromEnum(AbbrevCode.variable)); |
| 680 | const gpa = self.dwarf.allocator; | 680 | const gpa = self.dwarf.allocator; |
| 681 | const mod = self.mod; | 681 | const mod = self.mod; |
| 682 | const target = mod.getTarget(); | 682 | const target = mod.getTarget(); |
| ... | @@ -991,8 +991,10 @@ pub const ExprlocRelocation = struct { | ... | @@ -991,8 +991,10 @@ pub const ExprlocRelocation = struct { |
| 991 | | 991 | |
| 992 | pub const PtrWidth = enum { p32, p64 }; | 992 | pub const PtrWidth = enum { p32, p64 }; |
| 993 | | 993 | |
| 994 | pub const AbbrevKind = enum(u8) { | 994 | pub const AbbrevCode = enum(u8) { |
| 995 | compile_unit = 1, | 995 | null, |
| | 996 | padding, |
| | 997 | compile_unit, |
| 996 | subprogram, | 998 | subprogram, |
| 997 | subprogram_retvoid, | 999 | subprogram_retvoid, |
| 998 | base_type, | 1000 | base_type, |
| ... | @@ -1002,7 +1004,7 @@ pub const AbbrevKind = enum(u8) { | ... | @@ -1002,7 +1004,7 @@ pub const AbbrevKind = enum(u8) { |
| 1002 | enum_type, | 1004 | enum_type, |
| 1003 | enum_variant, | 1005 | enum_variant, |
| 1004 | union_type, | 1006 | union_type, |
| 1005 | pad1, | 1007 | zero_bit_type, |
| 1006 | parameter, | 1008 | parameter, |
| 1007 | variable, | 1009 | variable, |
| 1008 | array_type, | 1010 | array_type, |
| ... | @@ -1162,7 +1164,7 @@ pub fn initDeclState(self: *Dwarf, mod: *Module, decl_index: InternPool.DeclInde | ... | @@ -1162,7 +1164,7 @@ pub fn initDeclState(self: *Dwarf, mod: *Module, decl_index: InternPool.DeclInde |
| 1162 | const fn_ret_type = decl.ty.fnReturnType(mod); | 1164 | const fn_ret_type = decl.ty.fnReturnType(mod); |
| 1163 | const fn_ret_has_bits = fn_ret_type.hasRuntimeBits(mod); | 1165 | const fn_ret_has_bits = fn_ret_type.hasRuntimeBits(mod); |
| 1164 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum( | 1166 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum( |
| 1165 | @as(AbbrevKind, if (fn_ret_has_bits) .subprogram else .subprogram_retvoid), | 1167 | @as(AbbrevCode, if (fn_ret_has_bits) .subprogram else .subprogram_retvoid), |
| 1166 | )); | 1168 | )); |
| 1167 | // These get overwritten after generating the machine code. These values are | 1169 | // These get overwritten after generating the machine code. These values are |
| 1168 | // "relocations" and have to be in this fixed place so that functions can be | 1170 | // "relocations" and have to be in this fixed place so that functions can be |
| ... | @@ -1806,7 +1808,14 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void { | ... | @@ -1806,7 +1808,14 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void { |
| 1806 | // we can simply append these bytes. | 1808 | // we can simply append these bytes. |
| 1807 | // zig fmt: off | 1809 | // zig fmt: off |
| 1808 | const abbrev_buf = [_]u8{ | 1810 | const abbrev_buf = [_]u8{ |
| 1809 | @intFromEnum(AbbrevKind.compile_unit), | 1811 | @intFromEnum(AbbrevCode.padding), |
| | 1812 | @as(u8, 0x80) | @as(u7, @truncate(DW.TAG.ZIG_padding >> 0)), |
| | 1813 | @as(u8, 0x80) | @as(u7, @truncate(DW.TAG.ZIG_padding >> 7)), |
| | 1814 | @as(u8, 0x00) | @as(u7, @intCast(DW.TAG.ZIG_padding >> 14)), |
| | 1815 | DW.CHILDREN.no, |
| | 1816 | 0, 0, |
| | 1817 | |
| | 1818 | @intFromEnum(AbbrevCode.compile_unit), |
| 1810 | DW.TAG.compile_unit, | 1819 | DW.TAG.compile_unit, |
| 1811 | DW.CHILDREN.yes, | 1820 | DW.CHILDREN.yes, |
| 1812 | DW.AT.stmt_list, DW.FORM.sec_offset, | 1821 | DW.AT.stmt_list, DW.FORM.sec_offset, |
| ... | @@ -1818,7 +1827,7 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void { | ... | @@ -1818,7 +1827,7 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void { |
| 1818 | DW.AT.language, DW.FORM.data2, | 1827 | DW.AT.language, DW.FORM.data2, |
| 1819 | 0, 0, | 1828 | 0, 0, |
| 1820 | | 1829 | |
| 1821 | @intFromEnum(AbbrevKind.subprogram), | 1830 | @intFromEnum(AbbrevCode.subprogram), |
| 1822 | DW.TAG.subprogram, | 1831 | DW.TAG.subprogram, |
| 1823 | DW.CHILDREN.yes, | 1832 | DW.CHILDREN.yes, |
| 1824 | DW.AT.low_pc, DW.FORM.addr, | 1833 | DW.AT.low_pc, DW.FORM.addr, |
| ... | @@ -1828,7 +1837,7 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void { | ... | @@ -1828,7 +1837,7 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void { |
| 1828 | DW.AT.linkage_name, DW.FORM.string, | 1837 | DW.AT.linkage_name, DW.FORM.string, |
| 1829 | 0, 0, | 1838 | 0, 0, |
| 1830 | | 1839 | |
| 1831 | @intFromEnum(AbbrevKind.subprogram_retvoid), | 1840 | @intFromEnum(AbbrevCode.subprogram_retvoid), |
| 1832 | DW.TAG.subprogram, | 1841 | DW.TAG.subprogram, |
| 1833 | DW.CHILDREN.yes, | 1842 | DW.CHILDREN.yes, |
| 1834 | DW.AT.low_pc, DW.FORM.addr, | 1843 | DW.AT.low_pc, DW.FORM.addr, |
| ... | @@ -1837,25 +1846,25 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void { | ... | @@ -1837,25 +1846,25 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void { |
| 1837 | DW.AT.linkage_name, DW.FORM.string, | 1846 | DW.AT.linkage_name, DW.FORM.string, |
| 1838 | 0, 0, | 1847 | 0, 0, |
| 1839 | | 1848 | |
| 1840 | @intFromEnum(AbbrevKind.base_type), | 1849 | @intFromEnum(AbbrevCode.base_type), |
| 1841 | DW.TAG.base_type, DW.CHILDREN.no, | 1850 | DW.TAG.base_type, DW.CHILDREN.no, |
| 1842 | DW.AT.encoding, DW.FORM.data1, | 1851 | DW.AT.encoding, DW.FORM.data1, |
| 1843 | DW.AT.byte_size, DW.FORM.udata, | 1852 | DW.AT.byte_size, DW.FORM.udata, |
| 1844 | DW.AT.name, DW.FORM.string, | 1853 | DW.AT.name, DW.FORM.string, |
| 1845 | 0, 0, | 1854 | 0, 0, |
| 1846 | | 1855 | |
| 1847 | @intFromEnum(AbbrevKind.ptr_type), | 1856 | @intFromEnum(AbbrevCode.ptr_type), |
| 1848 | DW.TAG.pointer_type, DW.CHILDREN.no, | 1857 | DW.TAG.pointer_type, DW.CHILDREN.no, |
| 1849 | DW.AT.type, DW.FORM.ref4, | 1858 | DW.AT.type, DW.FORM.ref4, |
| 1850 | 0, 0, | 1859 | 0, 0, |
| 1851 | | 1860 | |
| 1852 | @intFromEnum(AbbrevKind.struct_type), | 1861 | @intFromEnum(AbbrevCode.struct_type), |
| 1853 | DW.TAG.structure_type, DW.CHILDREN.yes, | 1862 | DW.TAG.structure_type, DW.CHILDREN.yes, |
| 1854 | DW.AT.byte_size, DW.FORM.udata, | 1863 | DW.AT.byte_size, DW.FORM.udata, |
| 1855 | DW.AT.name, DW.FORM.string, | 1864 | DW.AT.name, DW.FORM.string, |
| 1856 | 0, 0, | 1865 | 0, 0, |
| 1857 | | 1866 | |
| 1858 | @intFromEnum(AbbrevKind.struct_member), | 1867 | @intFromEnum(AbbrevCode.struct_member), |
| 1859 | DW.TAG.member, | 1868 | DW.TAG.member, |
| 1860 | DW.CHILDREN.no, | 1869 | DW.CHILDREN.no, |
| 1861 | DW.AT.name, DW.FORM.string, | 1870 | DW.AT.name, DW.FORM.string, |
| ... | @@ -1863,31 +1872,31 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void { | ... | @@ -1863,31 +1872,31 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void { |
| 1863 | DW.AT.data_member_location, DW.FORM.udata, | 1872 | DW.AT.data_member_location, DW.FORM.udata, |
| 1864 | 0, 0, | 1873 | 0, 0, |
| 1865 | | 1874 | |
| 1866 | @intFromEnum(AbbrevKind.enum_type), | 1875 | @intFromEnum(AbbrevCode.enum_type), |
| 1867 | DW.TAG.enumeration_type, | 1876 | DW.TAG.enumeration_type, |
| 1868 | DW.CHILDREN.yes, | 1877 | DW.CHILDREN.yes, |
| 1869 | DW.AT.byte_size, DW.FORM.udata, | 1878 | DW.AT.byte_size, DW.FORM.udata, |
| 1870 | DW.AT.name, DW.FORM.string, | 1879 | DW.AT.name, DW.FORM.string, |
| 1871 | 0, 0, | 1880 | 0, 0, |
| 1872 | | 1881 | |
| 1873 | @intFromEnum(AbbrevKind.enum_variant), | 1882 | @intFromEnum(AbbrevCode.enum_variant), |
| 1874 | DW.TAG.enumerator, DW.CHILDREN.no, | 1883 | DW.TAG.enumerator, DW.CHILDREN.no, |
| 1875 | DW.AT.name, DW.FORM.string, | 1884 | DW.AT.name, DW.FORM.string, |
| 1876 | DW.AT.const_value, DW.FORM.data8, | 1885 | DW.AT.const_value, DW.FORM.data8, |
| 1877 | 0, 0, | 1886 | 0, 0, |
| 1878 | | 1887 | |
| 1879 | @intFromEnum(AbbrevKind.union_type), | 1888 | @intFromEnum(AbbrevCode.union_type), |
| 1880 | DW.TAG.union_type, DW.CHILDREN.yes, | 1889 | DW.TAG.union_type, DW.CHILDREN.yes, |
| 1881 | DW.AT.byte_size, DW.FORM.udata, | 1890 | DW.AT.byte_size, DW.FORM.udata, |
| 1882 | DW.AT.name, DW.FORM.string, | 1891 | DW.AT.name, DW.FORM.string, |
| 1883 | 0, 0, | 1892 | 0, 0, |
| 1884 | | 1893 | |
| 1885 | @intFromEnum(AbbrevKind.pad1), | 1894 | @intFromEnum(AbbrevCode.zero_bit_type), |
| 1886 | DW.TAG.unspecified_type, | 1895 | DW.TAG.unspecified_type, |
| 1887 | DW.CHILDREN.no, | 1896 | DW.CHILDREN.no, |
| 1888 | 0, 0, | 1897 | 0, 0, |
| 1889 | | 1898 | |
| 1890 | @intFromEnum(AbbrevKind.parameter), | 1899 | @intFromEnum(AbbrevCode.parameter), |
| 1891 | DW.TAG.formal_parameter, | 1900 | DW.TAG.formal_parameter, |
| 1892 | DW.CHILDREN.no, | 1901 | DW.CHILDREN.no, |
| 1893 | DW.AT.location, DW.FORM.exprloc, | 1902 | DW.AT.location, DW.FORM.exprloc, |
| ... | @@ -1895,7 +1904,7 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void { | ... | @@ -1895,7 +1904,7 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void { |
| 1895 | DW.AT.name, DW.FORM.string, | 1904 | DW.AT.name, DW.FORM.string, |
| 1896 | 0, 0, | 1905 | 0, 0, |
| 1897 | | 1906 | |
| 1898 | @intFromEnum(AbbrevKind.variable), | 1907 | @intFromEnum(AbbrevCode.variable), |
| 1899 | DW.TAG.variable, | 1908 | DW.TAG.variable, |
| 1900 | DW.CHILDREN.no, | 1909 | DW.CHILDREN.no, |
| 1901 | DW.AT.location, DW.FORM.exprloc, | 1910 | DW.AT.location, DW.FORM.exprloc, |
| ... | @@ -1903,14 +1912,14 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void { | ... | @@ -1903,14 +1912,14 @@ pub fn writeDbgAbbrev(self: *Dwarf) !void { |
| 1903 | DW.AT.name, DW.FORM.string, | 1912 | DW.AT.name, DW.FORM.string, |
| 1904 | 0, 0, | 1913 | 0, 0, |
| 1905 | | 1914 | |
| 1906 | @intFromEnum(AbbrevKind.array_type), | 1915 | @intFromEnum(AbbrevCode.array_type), |
| 1907 | DW.TAG.array_type, | 1916 | DW.TAG.array_type, |
| 1908 | DW.CHILDREN.yes, | 1917 | DW.CHILDREN.yes, |
| 1909 | DW.AT.name, DW.FORM.string, | 1918 | DW.AT.name, DW.FORM.string, |
| 1910 | DW.AT.type, DW.FORM.ref4, | 1919 | DW.AT.type, DW.FORM.ref4, |
| 1911 | 0, 0, | 1920 | 0, 0, |
| 1912 | | 1921 | |
| 1913 | @intFromEnum(AbbrevKind.array_dim), | 1922 | @intFromEnum(AbbrevCode.array_dim), |
| 1914 | DW.TAG.subrange_type, | 1923 | DW.TAG.subrange_type, |
| 1915 | DW.CHILDREN.no, | 1924 | DW.CHILDREN.no, |
| 1916 | DW.AT.type, DW.FORM.ref4, | 1925 | DW.AT.type, DW.FORM.ref4, |
| ... | @@ -2007,7 +2016,7 @@ pub fn writeDbgInfoHeader(self: *Dwarf, zcu: *Module, low_pc: u64, high_pc: u64) | ... | @@ -2007,7 +2016,7 @@ pub fn writeDbgInfoHeader(self: *Dwarf, zcu: *Module, low_pc: u64, high_pc: u64) |
| 2007 | const comp_dir_strp = try self.strtab.insert(self.allocator, compile_unit_dir); | 2016 | const comp_dir_strp = try self.strtab.insert(self.allocator, compile_unit_dir); |
| 2008 | const producer_strp = try self.strtab.insert(self.allocator, link.producer_string); | 2017 | const producer_strp = try self.strtab.insert(self.allocator, link.producer_string); |
| 2009 | | 2018 | |
| 2010 | di_buf.appendAssumeCapacity(@intFromEnum(AbbrevKind.compile_unit)); | 2019 | di_buf.appendAssumeCapacity(@intFromEnum(AbbrevCode.compile_unit)); |
| 2011 | self.writeOffsetAssumeCapacity(&di_buf, 0); // DW.AT.stmt_list, DW.FORM.sec_offset | 2020 | self.writeOffsetAssumeCapacity(&di_buf, 0); // DW.AT.stmt_list, DW.FORM.sec_offset |
| 2012 | self.writeAddrAssumeCapacity(&di_buf, low_pc); | 2021 | self.writeAddrAssumeCapacity(&di_buf, low_pc); |
| 2013 | self.writeAddrAssumeCapacity(&di_buf, high_pc); | 2022 | self.writeAddrAssumeCapacity(&di_buf, high_pc); |
| ... | @@ -2226,7 +2235,7 @@ fn pwriteDbgInfoNops( | ... | @@ -2226,7 +2235,7 @@ fn pwriteDbgInfoNops( |
| 2226 | const tracy = trace(@src()); | 2235 | const tracy = trace(@src()); |
| 2227 | defer tracy.end(); | 2236 | defer tracy.end(); |
| 2228 | | 2237 | |
| 2229 | const page_of_nops = [1]u8{@intFromEnum(AbbrevKind.pad1)} ** 4096; | 2238 | const page_of_nops = [1]u8{@intFromEnum(AbbrevCode.padding)} ** 4096; |
| 2230 | var vecs: [32]std.os.iovec_const = undefined; | 2239 | var vecs: [32]std.os.iovec_const = undefined; |
| 2231 | var vec_index: usize = 0; | 2240 | var vec_index: usize = 0; |
| 2232 | { | 2241 | { |
| ... | @@ -2298,9 +2307,9 @@ fn writeDbgInfoNopsToArrayList( | ... | @@ -2298,9 +2307,9 @@ fn writeDbgInfoNopsToArrayList( |
| 2298 | buffer.items.len, | 2307 | buffer.items.len, |
| 2299 | offset + content.len + next_padding_size + 1, | 2308 | offset + content.len + next_padding_size + 1, |
| 2300 | )); | 2309 | )); |
| 2301 | @memset(buffer.items[offset - prev_padding_size .. offset], @intFromEnum(AbbrevKind.pad1)); | 2310 | @memset(buffer.items[offset - prev_padding_size .. offset], @intFromEnum(AbbrevCode.padding)); |
| 2302 | @memcpy(buffer.items[offset..][0..content.len], content); | 2311 | @memcpy(buffer.items[offset..][0..content.len], content); |
| 2303 | @memset(buffer.items[offset + content.len ..][0..next_padding_size], @intFromEnum(AbbrevKind.pad1)); | 2312 | @memset(buffer.items[offset + content.len ..][0..next_padding_size], @intFromEnum(AbbrevCode.padding)); |
| 2304 | | 2313 | |
| 2305 | if (trailing_zero) { | 2314 | if (trailing_zero) { |
| 2306 | buffer.items[offset + content.len + next_padding_size] = 0; | 2315 | buffer.items[offset + content.len + next_padding_size] = 0; |
| ... | @@ -2842,7 +2851,7 @@ fn addDbgInfoErrorSetNames( | ... | @@ -2842,7 +2851,7 @@ fn addDbgInfoErrorSetNames( |
| 2842 | const target_endian = target.cpu.arch.endian(); | 2851 | const target_endian = target.cpu.arch.endian(); |
| 2843 | | 2852 | |
| 2844 | // DW.AT.enumeration_type | 2853 | // DW.AT.enumeration_type |
| 2845 | try dbg_info_buffer.append(@intFromEnum(AbbrevKind.enum_type)); | 2854 | try dbg_info_buffer.append(@intFromEnum(AbbrevCode.enum_type)); |
| 2846 | // DW.AT.byte_size, DW.FORM.udata | 2855 | // DW.AT.byte_size, DW.FORM.udata |
| 2847 | const abi_size = Type.anyerror.abiSize(mod); | 2856 | const abi_size = Type.anyerror.abiSize(mod); |
| 2848 | try leb128.writeULEB128(dbg_info_buffer.writer(), abi_size); | 2857 | try leb128.writeULEB128(dbg_info_buffer.writer(), abi_size); |
| ... | @@ -2853,7 +2862,7 @@ fn addDbgInfoErrorSetNames( | ... | @@ -2853,7 +2862,7 @@ fn addDbgInfoErrorSetNames( |
| 2853 | // DW.AT.enumerator | 2862 | // DW.AT.enumerator |
| 2854 | const no_error = "(no error)"; | 2863 | const no_error = "(no error)"; |
| 2855 | try dbg_info_buffer.ensureUnusedCapacity(no_error.len + 2 + @sizeOf(u64)); | 2864 | try dbg_info_buffer.ensureUnusedCapacity(no_error.len + 2 + @sizeOf(u64)); |
| 2856 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.enum_variant)); | 2865 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.enum_variant)); |
| 2857 | // DW.AT.name, DW.FORM.string | 2866 | // DW.AT.name, DW.FORM.string |
| 2858 | dbg_info_buffer.appendSliceAssumeCapacity(no_error); | 2867 | dbg_info_buffer.appendSliceAssumeCapacity(no_error); |
| 2859 | dbg_info_buffer.appendAssumeCapacity(0); | 2868 | dbg_info_buffer.appendAssumeCapacity(0); |
| ... | @@ -2865,7 +2874,7 @@ fn addDbgInfoErrorSetNames( | ... | @@ -2865,7 +2874,7 @@ fn addDbgInfoErrorSetNames( |
| 2865 | const error_name = mod.intern_pool.stringToSlice(error_name_ip); | 2874 | const error_name = mod.intern_pool.stringToSlice(error_name_ip); |
| 2866 | // DW.AT.enumerator | 2875 | // DW.AT.enumerator |
| 2867 | try dbg_info_buffer.ensureUnusedCapacity(error_name.len + 2 + @sizeOf(u64)); | 2876 | try dbg_info_buffer.ensureUnusedCapacity(error_name.len + 2 + @sizeOf(u64)); |
| 2868 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevKind.enum_variant)); | 2877 | dbg_info_buffer.appendAssumeCapacity(@intFromEnum(AbbrevCode.enum_variant)); |
| 2869 | // DW.AT.name, DW.FORM.string | 2878 | // DW.AT.name, DW.FORM.string |
| 2870 | dbg_info_buffer.appendSliceAssumeCapacity(error_name); | 2879 | dbg_info_buffer.appendSliceAssumeCapacity(error_name); |
| 2871 | dbg_info_buffer.appendAssumeCapacity(0); | 2880 | dbg_info_buffer.appendAssumeCapacity(0); |