authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-08-22 23:20:53-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-08-22 23:20:53-04:00
logc6286eee4ba8065b4a3f37fe3668041871e1b42e
tree6dda0dbc9eb1ca77546fb960a2eba24ef3f5d07f
parentee84deda988afb36f24ecd35ebea40221c1b80d8
parent0a5291435513727a9f19570008388364f391b0d2
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #21170 from jacobly0/more-dwarf-cleanup

Dwarf: more cleanup

10 files changed, 212 insertions(+), 77 deletions(-)

ci/x86_64-linux-debug.sh+1-1
...@@ -64,7 +64,7 @@ stage3-debug/bin/zig build \...@@ -64,7 +64,7 @@ stage3-debug/bin/zig build \
6464
65stage3-debug/bin/zig build test docs \65stage3-debug/bin/zig build test docs \
66 --maxrss 21000000000 \66 --maxrss 21000000000 \
67 -Dlldb=$HOME/deps/lldb-zig/Debug-f96d3e6fc/bin/lldb \67 -Dlldb=$HOME/deps/lldb-zig/Debug-62538077d/bin/lldb \
68 -fqemu \68 -fqemu \
69 -fwasmtime \69 -fwasmtime \
70 -Dstatic-llvm \70 -Dstatic-llvm \
ci/x86_64-linux-release.sh+1-1
...@@ -64,7 +64,7 @@ stage3-release/bin/zig build \...@@ -64,7 +64,7 @@ stage3-release/bin/zig build \
6464
65stage3-release/bin/zig build test docs \65stage3-release/bin/zig build test docs \
66 --maxrss 21000000000 \66 --maxrss 21000000000 \
67 -Dlldb=$HOME/deps/lldb-zig/Release-f96d3e6fc/bin/lldb \67 -Dlldb=$HOME/deps/lldb-zig/Release-62538077d/bin/lldb \
68 -fqemu \68 -fqemu \
69 -fwasmtime \69 -fwasmtime \
70 -Dstatic-llvm \70 -Dstatic-llvm \
src/Type.zig+1-1
...@@ -202,6 +202,7 @@ pub fn print(ty: Type, writer: anytype, pt: Zcu.PerThread) @TypeOf(writer).Error...@@ -202,6 +202,7 @@ pub fn print(ty: Type, writer: anytype, pt: Zcu.PerThread) @TypeOf(writer).Error
202 .C => try writer.writeAll("[*c]"),202 .C => try writer.writeAll("[*c]"),
203 .Slice => try writer.writeAll("[]"),203 .Slice => try writer.writeAll("[]"),
204 }204 }
205 if (info.flags.is_allowzero and info.flags.size != .C) try writer.writeAll("allowzero ");
205 if (info.flags.alignment != .none or206 if (info.flags.alignment != .none or
206 info.packed_offset.host_size != 0 or207 info.packed_offset.host_size != 0 or
207 info.flags.vector_index != .none)208 info.flags.vector_index != .none)
...@@ -229,7 +230,6 @@ pub fn print(ty: Type, writer: anytype, pt: Zcu.PerThread) @TypeOf(writer).Error...@@ -229,7 +230,6 @@ pub fn print(ty: Type, writer: anytype, pt: Zcu.PerThread) @TypeOf(writer).Error
229 }230 }
230 if (info.flags.is_const) try writer.writeAll("const ");231 if (info.flags.is_const) try writer.writeAll("const ");
231 if (info.flags.is_volatile) try writer.writeAll("volatile ");232 if (info.flags.is_volatile) try writer.writeAll("volatile ");
232 if (info.flags.is_allowzero and info.flags.size != .C) try writer.writeAll("allowzero ");
233233
234 try print(Type.fromInterned(info.child), writer, pt);234 try print(Type.fromInterned(info.child), writer, pt);
235 return;235 return;
src/arch/x86_64/CodeGen.zig+28-9
...@@ -59,6 +59,7 @@ owner: Owner,...@@ -59,6 +59,7 @@ owner: Owner,
59inline_func: InternPool.Index,59inline_func: InternPool.Index,
60mod: *Package.Module,60mod: *Package.Module,
61err_msg: ?*ErrorMsg,61err_msg: ?*ErrorMsg,
62arg_index: u32,
62args: []MCValue,63args: []MCValue,
63va_info: union {64va_info: union {
64 sysv: struct {65 sysv: struct {
...@@ -71,7 +72,6 @@ va_info: union {...@@ -71,7 +72,6 @@ va_info: union {
71},72},
72ret_mcv: InstTracking,73ret_mcv: InstTracking,
73fn_type: Type,74fn_type: Type,
74arg_index: u32,
75src_loc: Zcu.LazySrcLoc,75src_loc: Zcu.LazySrcLoc,
7676
77eflags_inst: ?Air.Inst.Index = null,77eflags_inst: ?Air.Inst.Index = null,
...@@ -802,11 +802,11 @@ pub fn generate(...@@ -802,11 +802,11 @@ pub fn generate(
802 .owner = .{ .nav_index = func.owner_nav },802 .owner = .{ .nav_index = func.owner_nav },
803 .inline_func = func_index,803 .inline_func = func_index,
804 .err_msg = null,804 .err_msg = null,
805 .arg_index = undefined,
805 .args = undefined, // populated after `resolveCallingConventionValues`806 .args = undefined, // populated after `resolveCallingConventionValues`
806 .va_info = undefined, // populated after `resolveCallingConventionValues`807 .va_info = undefined, // populated after `resolveCallingConventionValues`
807 .ret_mcv = undefined, // populated after `resolveCallingConventionValues`808 .ret_mcv = undefined, // populated after `resolveCallingConventionValues`
808 .fn_type = fn_type,809 .fn_type = fn_type,
809 .arg_index = 0,
810 .src_loc = src_loc,810 .src_loc = src_loc,
811 .end_di_line = func.rbrace_line,811 .end_di_line = func.rbrace_line,
812 .end_di_column = func.rbrace_column,812 .end_di_column = func.rbrace_column,
...@@ -877,6 +877,7 @@ pub fn generate(...@@ -877,6 +877,7 @@ pub fn generate(
877 }),877 }),
878 );878 );
879 function.va_info = switch (cc) {879 function.va_info = switch (cc) {
880 else => undefined,
880 .SysV => .{ .sysv = .{881 .SysV => .{ .sysv = .{
881 .gp_count = call_info.gp_count,882 .gp_count = call_info.gp_count,
882 .fp_count = call_info.fp_count,883 .fp_count = call_info.fp_count,
...@@ -884,7 +885,6 @@ pub fn generate(...@@ -884,7 +885,6 @@ pub fn generate(
884 .reg_save_area = undefined,885 .reg_save_area = undefined,
885 } },886 } },
886 .Win64 => .{ .win64 = .{} },887 .Win64 => .{ .win64 = .{} },
887 else => undefined,
888 };888 };
889889
890 function.gen() catch |err| switch (err) {890 function.gen() catch |err| switch (err) {
...@@ -978,11 +978,11 @@ pub fn generateLazy(...@@ -978,11 +978,11 @@ pub fn generateLazy(
978 .owner = .{ .lazy_sym = lazy_sym },978 .owner = .{ .lazy_sym = lazy_sym },
979 .inline_func = undefined,979 .inline_func = undefined,
980 .err_msg = null,980 .err_msg = null,
981 .arg_index = undefined,
981 .args = undefined,982 .args = undefined,
982 .va_info = undefined,983 .va_info = undefined,
983 .ret_mcv = undefined,984 .ret_mcv = undefined,
984 .fn_type = undefined,985 .fn_type = undefined,
985 .arg_index = undefined,
986 .src_loc = src_loc,986 .src_loc = src_loc,
987 .end_di_line = undefined, // no debug info yet987 .end_di_line = undefined, // no debug info yet
988 .end_di_column = undefined, // no debug info yet988 .end_di_column = undefined, // no debug info yet
...@@ -1482,6 +1482,8 @@ fn asmOpOnly(self: *Self, tag: Mir.Inst.FixedTag) !void {...@@ -1482,6 +1482,8 @@ fn asmOpOnly(self: *Self, tag: Mir.Inst.FixedTag) !void {
1482}1482}
14831483
1484fn asmPseudo(self: *Self, ops: Mir.Inst.Ops) !void {1484fn asmPseudo(self: *Self, ops: Mir.Inst.Ops) !void {
1485 assert(std.mem.startsWith(u8, @tagName(ops), "pseudo_") and
1486 std.mem.endsWith(u8, @tagName(ops), "_none"));
1485 _ = try self.addInst(.{1487 _ = try self.addInst(.{
1486 .tag = .pseudo,1488 .tag = .pseudo,
1487 .ops = ops,1489 .ops = ops,
...@@ -2101,6 +2103,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {...@@ -2101,6 +2103,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {
2101 const ip = &mod.intern_pool;2103 const ip = &mod.intern_pool;
2102 const air_tags = self.air.instructions.items(.tag);2104 const air_tags = self.air.instructions.items(.tag);
21032105
2106 self.arg_index = 0;
2104 for (body) |inst| {2107 for (body) |inst| {
2105 wip_mir_log.debug("{}", .{self.fmtAir(inst)});2108 wip_mir_log.debug("{}", .{self.fmtAir(inst)});
2106 verbose_tracking_log.debug("{}", .{self.fmtTracking()});2109 verbose_tracking_log.debug("{}", .{self.fmtTracking()});
...@@ -2114,6 +2117,8 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {...@@ -2114,6 +2117,8 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {
2114 self.checkInvariantsAfterAirInst(inst, old_air_bookkeeping);2117 self.checkInvariantsAfterAirInst(inst, old_air_bookkeeping);
2115 }2118 }
21162119
2120 if (self.arg_index == 0) try self.airDbgVarArgs();
2121 self.arg_index = 0;
2117 for (body) |inst| {2122 for (body) |inst| {
2118 if (self.liveness.isUnused(inst) and !self.air.mustLower(inst, ip)) continue;2123 if (self.liveness.isUnused(inst) and !self.air.mustLower(inst, ip)) continue;
2119 wip_mir_log.debug("{}", .{self.fmtAir(inst)});2124 wip_mir_log.debug("{}", .{self.fmtAir(inst)});
...@@ -12055,11 +12060,25 @@ fn airArg(self: *Self, inst: Air.Inst.Index) !void {...@@ -12055,11 +12060,25 @@ fn airArg(self: *Self, inst: Air.Inst.Index) !void {
12055}12060}
1205612061
12057fn airDbgArg(self: *Self, inst: Air.Inst.Index) !void {12062fn airDbgArg(self: *Self, inst: Air.Inst.Index) !void {
12058 defer self.finishAirBookkeeping();12063 // skip zero-bit arguments as they don't have a corresponding arg instruction
12059 if (self.debug_output == .none) return;12064 var arg_index = self.arg_index;
12060 const name = self.air.instructions.items(.data)[@intFromEnum(inst)].arg.name;12065 while (self.args[arg_index] == .none) arg_index += 1;
12061 if (name != .none) try self.genLocalDebugInfo(inst, self.getResolvedInstValue(inst).short);12066 self.arg_index = arg_index + 1;
12062 if (self.liveness.isUnused(inst)) try self.processDeath(inst);12067
12068 if (self.debug_output != .none) {
12069 const name = self.air.instructions.items(.data)[@intFromEnum(inst)].arg.name;
12070 if (name != .none) try self.genLocalDebugInfo(inst, self.getResolvedInstValue(inst).short);
12071 if (self.liveness.isUnused(inst)) try self.processDeath(inst);
12072 }
12073 for (self.args[self.arg_index..]) |arg| {
12074 if (arg != .none) break;
12075 } else try self.airDbgVarArgs();
12076 self.finishAirBookkeeping();
12077}
12078
12079fn airDbgVarArgs(self: *Self) !void {
12080 if (self.pt.zcu.typeToFunc(self.fn_type).?.is_var_args)
12081 try self.asmPseudo(.pseudo_dbg_var_args_none);
12063}12082}
1206412083
12065fn genLocalDebugInfo(12084fn genLocalDebugInfo(
src/arch/x86_64/Emit.zig+7
...@@ -384,6 +384,13 @@ pub fn emitMir(emit: *Emit) Error!void {...@@ -384,6 +384,13 @@ pub fn emitMir(emit: *Emit) Error!void {
384 .none => {},384 .none => {},
385 }385 }
386 },386 },
387 .pseudo_dbg_var_args_none => {
388 switch (emit.debug_output) {
389 .dwarf => |dw| try dw.genVarArgsDebugInfo(),
390 .plan9 => {},
391 .none => {},
392 }
393 },
387 .pseudo_dead_none => {},394 .pseudo_dead_none => {},
388 },395 },
389 }396 }
src/arch/x86_64/Lower.zig+1
...@@ -279,6 +279,7 @@ pub fn lowerMir(lower: *Lower, index: Mir.Inst.Index) Error!struct {...@@ -279,6 +279,7 @@ pub fn lowerMir(lower: *Lower, index: Mir.Inst.Index) Error!struct {
279 .pseudo_dbg_local_aro,279 .pseudo_dbg_local_aro,
280 .pseudo_dbg_local_af,280 .pseudo_dbg_local_af,
281 .pseudo_dbg_local_am,281 .pseudo_dbg_local_am,
282 .pseudo_dbg_var_args_none,
282 .pseudo_dead_none,283 .pseudo_dead_none,
283 => {},284 => {},
284 else => unreachable,285 else => unreachable,
src/arch/x86_64/Mir.zig+2
...@@ -924,6 +924,8 @@ pub const Inst = struct {...@@ -924,6 +924,8 @@ pub const Inst = struct {
924 /// Local argument or variable.924 /// Local argument or variable.
925 /// Uses `ax` payload with extra data of type `Memory`.925 /// Uses `ax` payload with extra data of type `Memory`.
926 pseudo_dbg_local_am,926 pseudo_dbg_local_am,
927 /// Remaining arguments are varargs.
928 pseudo_dbg_var_args_none,
927929
928 /// Tombstone930 /// Tombstone
929 /// Emitter should skip this instruction.931 /// Emitter should skip this instruction.
src/link/Dwarf.zig+92-42
...@@ -1108,6 +1108,12 @@ pub const WipNav = struct {...@@ -1108,6 +1108,12 @@ pub const WipNav = struct {
1108 wip_nav.any_children = true;1108 wip_nav.any_children = true;
1109 }1109 }
11101110
1111 pub fn genVarArgsDebugInfo(wip_nav: *WipNav) UpdateError!void {
1112 assert(wip_nav.func != .none);
1113 try wip_nav.abbrevCode(.is_var_args);
1114 wip_nav.any_children = true;
1115 }
1116
1111 pub fn advancePCAndLine(1117 pub fn advancePCAndLine(
1112 wip_nav: *WipNav,1118 wip_nav: *WipNav,
1113 delta_line: i33,1119 delta_line: i33,
...@@ -1380,7 +1386,11 @@ pub const WipNav = struct {...@@ -1380,7 +1386,11 @@ pub const WipNav = struct {
1380 fn enumConstValue(1386 fn enumConstValue(
1381 wip_nav: *WipNav,1387 wip_nav: *WipNav,
1382 loaded_enum: InternPool.LoadedEnumType,1388 loaded_enum: InternPool.LoadedEnumType,
1383 abbrev_code: std.enums.EnumFieldStruct(std.builtin.Signedness, AbbrevCode, null),1389 abbrev_code: struct {
1390 sdata: AbbrevCode,
1391 udata: AbbrevCode,
1392 block: AbbrevCode,
1393 },
1384 field_index: usize,1394 field_index: usize,
1385 ) UpdateError!void {1395 ) UpdateError!void {
1386 const zcu = wip_nav.pt.zcu;1396 const zcu = wip_nav.pt.zcu;
...@@ -1390,20 +1400,15 @@ pub const WipNav = struct {...@@ -1390,20 +1400,15 @@ pub const WipNav = struct {
1390 .comptime_int_type => .signed,1400 .comptime_int_type => .signed,
1391 else => Type.fromInterned(loaded_enum.tag_ty).intInfo(zcu).signedness,1401 else => Type.fromInterned(loaded_enum.tag_ty).intInfo(zcu).signedness,
1392 };1402 };
1393 try wip_nav.abbrevCode(switch (signedness) {1403 if (loaded_enum.values.len > 0) {
1394 inline .signed, .unsigned => |ct_signedness| @field(abbrev_code, @tagName(ct_signedness)),1404 var big_int_space: InternPool.Key.Int.Storage.BigIntSpace = undefined;
1395 });1405 const big_int = ip.indexToKey(loaded_enum.values.get(ip)[field_index]).int.storage.toBigInt(&big_int_space);
1396 if (loaded_enum.values.len > 0) switch (ip.indexToKey(loaded_enum.values.get(ip)[field_index]).int.storage) {1406 const bits = @max(1, big_int.bitCountTwosCompForSignedness(signedness));
1397 .u64 => |value| switch (signedness) {1407 if (bits <= 64) {
1398 .signed => try sleb128(diw, value),1408 try wip_nav.abbrevCode(switch (signedness) {
1399 .unsigned => try uleb128(diw, value),1409 .signed => abbrev_code.sdata,
1400 },1410 .unsigned => abbrev_code.udata,
1401 .i64 => |value| switch (signedness) {1411 });
1402 .signed => try sleb128(diw, value),
1403 .unsigned => unreachable,
1404 },
1405 .big_int => |big_int| {
1406 const bits = big_int.bitCountTwosCompForSignedness(signedness);
1407 try wip_nav.debug_info.ensureUnusedCapacity(wip_nav.dwarf.gpa, std.math.divCeil(usize, bits, 7) catch unreachable);1412 try wip_nav.debug_info.ensureUnusedCapacity(wip_nav.dwarf.gpa, std.math.divCeil(usize, bits, 7) catch unreachable);
1408 var bit: usize = 0;1413 var bit: usize = 0;
1409 var carry: u1 = 1;1414 var carry: u1 = 1;
...@@ -1412,11 +1417,8 @@ pub const WipNav = struct {...@@ -1412,11 +1417,8 @@ pub const WipNav = struct {
1412 const limb_index = bit / limb_bits;1417 const limb_index = bit / limb_bits;
1413 const limb_shift: std.math.Log2Int(std.math.big.Limb) = @intCast(bit % limb_bits);1418 const limb_shift: std.math.Log2Int(std.math.big.Limb) = @intCast(bit % limb_bits);
1414 const low_abs_part: u7 = @truncate(big_int.limbs[limb_index] >> limb_shift);1419 const low_abs_part: u7 = @truncate(big_int.limbs[limb_index] >> limb_shift);
1415 const abs_part = if (limb_shift > limb_bits - 7) abs_part: {1420 const abs_part = if (limb_shift > limb_bits - 7 and limb_index + 1 < big_int.limbs.len) abs_part: {
1416 const next_limb: std.math.big.Limb = if (limb_index + 1 < big_int.limbs.len)1421 const high_abs_part: u7 = @truncate(big_int.limbs[limb_index + 1] << -%limb_shift);
1417 big_int.limbs[limb_index + 1]
1418 else if (big_int.positive) 0 else std.math.maxInt(std.math.big.Limb);
1419 const high_abs_part: u7 = @truncate(next_limb << -%limb_shift);
1420 break :abs_part high_abs_part | low_abs_part;1422 break :abs_part high_abs_part | low_abs_part;
1421 } else low_abs_part;1423 } else low_abs_part;
1422 const twos_comp_part = if (big_int.positive) abs_part else twos_comp_part: {1424 const twos_comp_part = if (big_int.positive) abs_part else twos_comp_part: {
...@@ -1425,11 +1427,21 @@ pub const WipNav = struct {...@@ -1425,11 +1427,21 @@ pub const WipNav = struct {
1425 };1427 };
1426 wip_nav.debug_info.appendAssumeCapacity(@as(u8, if (bit + 7 < bits) 0x80 else 0x00) | twos_comp_part);1428 wip_nav.debug_info.appendAssumeCapacity(@as(u8, if (bit + 7 < bits) 0x80 else 0x00) | twos_comp_part);
1427 }1429 }
1428 },1430 } else {
1429 .lazy_align, .lazy_size => unreachable,1431 try wip_nav.abbrevCode(abbrev_code.block);
1432 const bytes = Type.fromInterned(loaded_enum.tag_ty).abiSize(wip_nav.pt);
1433 try uleb128(diw, bytes);
1434 big_int.writeTwosComplement(try wip_nav.debug_info.addManyAsSlice(wip_nav.dwarf.gpa, @intCast(bytes)), wip_nav.dwarf.endian);
1435 }
1430 } else switch (signedness) {1436 } else switch (signedness) {
1431 .signed => try sleb128(diw, field_index),1437 .signed => {
1432 .unsigned => try uleb128(diw, field_index),1438 try wip_nav.abbrevCode(abbrev_code.sdata);
1439 try sleb128(diw, field_index);
1440 },
1441 .unsigned => {
1442 try wip_nav.abbrevCode(abbrev_code.udata);
1443 try uleb128(diw, field_index);
1444 },
1433 }1445 }
1434 }1446 }
14351447
...@@ -2267,8 +2279,9 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool...@@ -2267,8 +2279,9 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
2267 try wip_nav.refType(Type.fromInterned(loaded_enum.tag_ty));2279 try wip_nav.refType(Type.fromInterned(loaded_enum.tag_ty));
2268 for (0..loaded_enum.names.len) |field_index| {2280 for (0..loaded_enum.names.len) |field_index| {
2269 try wip_nav.enumConstValue(loaded_enum, .{2281 try wip_nav.enumConstValue(loaded_enum, .{
2270 .signed = .signed_enum_field,2282 .sdata = .signed_enum_field,
2271 .unsigned = .unsigned_enum_field,2283 .udata = .unsigned_enum_field,
2284 .block = .big_enum_field,
2272 }, field_index);2285 }, field_index);
2273 try wip_nav.strp(loaded_enum.names.get(ip)[field_index].toSlice(ip));2286 try wip_nav.strp(loaded_enum.names.get(ip)[field_index].toSlice(ip));
2274 }2287 }
...@@ -2367,8 +2380,9 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool...@@ -2367,8 +2380,9 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool
23672380
2368 for (0..loaded_union.field_types.len) |field_index| {2381 for (0..loaded_union.field_types.len) |field_index| {
2369 try wip_nav.enumConstValue(loaded_tag, .{2382 try wip_nav.enumConstValue(loaded_tag, .{
2370 .signed = .signed_tagged_union_field,2383 .sdata = .signed_tagged_union_field,
2371 .unsigned = .unsigned_tagged_union_field,2384 .udata = .unsigned_tagged_union_field,
2385 .block = .big_tagged_union_field,
2372 }, field_index);2386 }, field_index);
2373 {2387 {
2374 try wip_nav.abbrevCode(.struct_field);2388 try wip_nav.abbrevCode(.struct_field);
...@@ -2831,17 +2845,18 @@ fn updateType(...@@ -2831,17 +2845,18 @@ fn updateType(
2831 },2845 },
2832 .enum_type => {2846 .enum_type => {
2833 const loaded_enum = ip.loadEnumType(type_index);2847 const loaded_enum = ip.loadEnumType(type_index);
2834 try wip_nav.abbrevCode(.enum_type);2848 try wip_nav.abbrevCode(if (loaded_enum.names.len > 0) .enum_type else .empty_enum_type);
2835 try wip_nav.strp(name);2849 try wip_nav.strp(name);
2836 try wip_nav.refType(Type.fromInterned(loaded_enum.tag_ty));2850 try wip_nav.refType(Type.fromInterned(loaded_enum.tag_ty));
2837 for (0..loaded_enum.names.len) |field_index| {2851 for (0..loaded_enum.names.len) |field_index| {
2838 try wip_nav.enumConstValue(loaded_enum, .{2852 try wip_nav.enumConstValue(loaded_enum, .{
2839 .signed = .signed_enum_field,2853 .sdata = .signed_enum_field,
2840 .unsigned = .unsigned_enum_field,2854 .udata = .unsigned_enum_field,
2855 .block = .big_enum_field,
2841 }, field_index);2856 }, field_index);
2842 try wip_nav.strp(loaded_enum.names.get(ip)[field_index].toSlice(ip));2857 try wip_nav.strp(loaded_enum.names.get(ip)[field_index].toSlice(ip));
2843 }2858 }
2844 try uleb128(diw, @intFromEnum(AbbrevCode.null));2859 if (loaded_enum.names.len > 0) try uleb128(diw, @intFromEnum(AbbrevCode.null));
2845 },2860 },
2846 .func_type => |func_type| {2861 .func_type => |func_type| {
2847 const is_nullary = func_type.param_types.len == 0 and !func_type.is_var_args;2862 const is_nullary = func_type.param_types.len == 0 and !func_type.is_var_args;
...@@ -3049,7 +3064,7 @@ pub fn updateContainerType(dwarf: *Dwarf, pt: Zcu.PerThread, type_index: InternP...@@ -3049,7 +3064,7 @@ pub fn updateContainerType(dwarf: *Dwarf, pt: Zcu.PerThread, type_index: InternP
3049 }3064 }
3050 },3065 },
3051 .@"packed" => {3066 .@"packed" => {
3052 try wip_nav.abbrevCode(.packed_struct_type);3067 try wip_nav.abbrevCode(if (loaded_struct.field_types.len > 0) .packed_struct_type else .empty_packed_struct_type);
3053 try wip_nav.strp(name);3068 try wip_nav.strp(name);
3054 try wip_nav.refType(Type.fromInterned(loaded_struct.backingIntTypeUnordered(ip)));3069 try wip_nav.refType(Type.fromInterned(loaded_struct.backingIntTypeUnordered(ip)));
3055 var field_bit_offset: u16 = 0;3070 var field_bit_offset: u16 = 0;
...@@ -3061,27 +3076,28 @@ pub fn updateContainerType(dwarf: *Dwarf, pt: Zcu.PerThread, type_index: InternP...@@ -3061,27 +3076,28 @@ pub fn updateContainerType(dwarf: *Dwarf, pt: Zcu.PerThread, type_index: InternP
3061 try uleb128(diw, field_bit_offset);3076 try uleb128(diw, field_bit_offset);
3062 field_bit_offset += @intCast(field_type.bitSize(pt));3077 field_bit_offset += @intCast(field_type.bitSize(pt));
3063 }3078 }
3064 try uleb128(diw, @intFromEnum(AbbrevCode.null));3079 if (loaded_struct.field_types.len > 0) try uleb128(diw, @intFromEnum(AbbrevCode.null));
3065 },3080 },
3066 }3081 }
3067 },3082 },
3068 .enum_type => {3083 .enum_type => {
3069 const loaded_enum = ip.loadEnumType(type_index);3084 const loaded_enum = ip.loadEnumType(type_index);
3070 try wip_nav.abbrevCode(.enum_type);3085 try wip_nav.abbrevCode(if (loaded_enum.names.len > 0) .enum_type else .empty_enum_type);
3071 try wip_nav.strp(name);3086 try wip_nav.strp(name);
3072 try wip_nav.refType(Type.fromInterned(loaded_enum.tag_ty));3087 try wip_nav.refType(Type.fromInterned(loaded_enum.tag_ty));
3073 for (0..loaded_enum.names.len) |field_index| {3088 for (0..loaded_enum.names.len) |field_index| {
3074 try wip_nav.enumConstValue(loaded_enum, .{3089 try wip_nav.enumConstValue(loaded_enum, .{
3075 .signed = .signed_enum_field,3090 .sdata = .signed_enum_field,
3076 .unsigned = .unsigned_enum_field,3091 .udata = .unsigned_enum_field,
3092 .block = .big_enum_field,
3077 }, field_index);3093 }, field_index);
3078 try wip_nav.strp(loaded_enum.names.get(ip)[field_index].toSlice(ip));3094 try wip_nav.strp(loaded_enum.names.get(ip)[field_index].toSlice(ip));
3079 }3095 }
3080 try uleb128(diw, @intFromEnum(AbbrevCode.null));3096 if (loaded_enum.names.len > 0) try uleb128(diw, @intFromEnum(AbbrevCode.null));
3081 },3097 },
3082 .union_type => {3098 .union_type => {
3083 const loaded_union = ip.loadUnionType(type_index);3099 const loaded_union = ip.loadUnionType(type_index);
3084 try wip_nav.abbrevCode(.union_type);3100 try wip_nav.abbrevCode(if (loaded_union.field_types.len > 0) .union_type else .empty_union_type);
3085 try wip_nav.strp(name);3101 try wip_nav.strp(name);
3086 const union_layout = pt.getUnionLayout(loaded_union);3102 const union_layout = pt.getUnionLayout(loaded_union);
3087 try uleb128(diw, union_layout.abi_size);3103 try uleb128(diw, union_layout.abi_size);
...@@ -3103,8 +3119,9 @@ pub fn updateContainerType(dwarf: *Dwarf, pt: Zcu.PerThread, type_index: InternP...@@ -3103,8 +3119,9 @@ pub fn updateContainerType(dwarf: *Dwarf, pt: Zcu.PerThread, type_index: InternP
31033119
3104 for (0..loaded_union.field_types.len) |field_index| {3120 for (0..loaded_union.field_types.len) |field_index| {
3105 try wip_nav.enumConstValue(loaded_tag, .{3121 try wip_nav.enumConstValue(loaded_tag, .{
3106 .signed = .signed_tagged_union_field,3122 .sdata = .signed_tagged_union_field,
3107 .unsigned = .unsigned_tagged_union_field,3123 .udata = .unsigned_tagged_union_field,
3124 .block = .big_tagged_union_field,
3108 }, field_index);3125 }, field_index);
3109 {3126 {
3110 try wip_nav.abbrevCode(.struct_field);3127 try wip_nav.abbrevCode(.struct_field);
...@@ -3130,7 +3147,7 @@ pub fn updateContainerType(dwarf: *Dwarf, pt: Zcu.PerThread, type_index: InternP...@@ -3130,7 +3147,7 @@ pub fn updateContainerType(dwarf: *Dwarf, pt: Zcu.PerThread, type_index: InternP
3130 try uleb128(diw, loaded_union.fieldAlign(ip, field_index).toByteUnits() orelse3147 try uleb128(diw, loaded_union.fieldAlign(ip, field_index).toByteUnits() orelse
3131 field_type.abiAlignment(pt).toByteUnits().?);3148 field_type.abiAlignment(pt).toByteUnits().?);
3132 }3149 }
3133 try uleb128(diw, @intFromEnum(AbbrevCode.null));3150 if (loaded_union.field_types.len > 0) try uleb128(diw, @intFromEnum(AbbrevCode.null));
3134 },3151 },
3135 .opaque_type => {3152 .opaque_type => {
3136 try wip_nav.abbrevCode(.namespace_struct_type);3153 try wip_nav.abbrevCode(.namespace_struct_type);
...@@ -3570,6 +3587,7 @@ const AbbrevCode = enum {...@@ -3570,6 +3587,7 @@ const AbbrevCode = enum {
3570 file,3587 file,
3571 signed_enum_field,3588 signed_enum_field,
3572 unsigned_enum_field,3589 unsigned_enum_field,
3590 big_enum_field,
3573 generated_field,3591 generated_field,
3574 struct_field,3592 struct_field,
3575 struct_field_comptime,3593 struct_field_comptime,
...@@ -3578,6 +3596,7 @@ const AbbrevCode = enum {...@@ -3578,6 +3596,7 @@ const AbbrevCode = enum {
3578 tagged_union,3596 tagged_union,
3579 signed_tagged_union_field,3597 signed_tagged_union_field,
3580 unsigned_tagged_union_field,3598 unsigned_tagged_union_field,
3599 big_tagged_union_field,
3581 tagged_union_default_field,3600 tagged_union_default_field,
3582 void_type,3601 void_type,
3583 numeric_type,3602 numeric_type,
...@@ -3596,7 +3615,9 @@ const AbbrevCode = enum {...@@ -3596,7 +3615,9 @@ const AbbrevCode = enum {
3596 namespace_struct_type,3615 namespace_struct_type,
3597 struct_type,3616 struct_type,
3598 packed_struct_type,3617 packed_struct_type,
3618 empty_packed_struct_type,
3599 union_type,3619 union_type,
3620 empty_union_type,
3600 empty_inlined_func,3621 empty_inlined_func,
3601 inlined_func,3622 inlined_func,
3602 local_arg,3623 local_arg,
...@@ -3778,6 +3799,13 @@ const AbbrevCode = enum {...@@ -3778,6 +3799,13 @@ const AbbrevCode = enum {
3778 .{ .name, .strp },3799 .{ .name, .strp },
3779 },3800 },
3780 },3801 },
3802 .big_enum_field = .{
3803 .tag = .enumerator,
3804 .attrs = &.{
3805 .{ .const_value, .block },
3806 .{ .name, .strp },
3807 },
3808 },
3781 .generated_field = .{3809 .generated_field = .{
3782 .tag = .member,3810 .tag = .member,
3783 .attrs = &.{3811 .attrs = &.{
...@@ -3841,6 +3869,13 @@ const AbbrevCode = enum {...@@ -3841,6 +3869,13 @@ const AbbrevCode = enum {
3841 .{ .discr_value, .udata },3869 .{ .discr_value, .udata },
3842 },3870 },
3843 },3871 },
3872 .big_tagged_union_field = .{
3873 .tag = .variant,
3874 .children = true,
3875 .attrs = &.{
3876 .{ .discr_value, .block },
3877 },
3878 },
3844 .tagged_union_default_field = .{3879 .tagged_union_default_field = .{
3845 .tag = .variant,3880 .tag = .variant,
3846 .children = true,3881 .children = true,
...@@ -3971,6 +4006,13 @@ const AbbrevCode = enum {...@@ -3971,6 +4006,13 @@ const AbbrevCode = enum {
3971 .{ .type, .ref_addr },4006 .{ .type, .ref_addr },
3972 },4007 },
3973 },4008 },
4009 .empty_packed_struct_type = .{
4010 .tag = .structure_type,
4011 .attrs = &.{
4012 .{ .name, .strp },
4013 .{ .type, .ref_addr },
4014 },
4015 },
3974 .union_type = .{4016 .union_type = .{
3975 .tag = .union_type,4017 .tag = .union_type,
3976 .children = true,4018 .children = true,
...@@ -3980,6 +4022,14 @@ const AbbrevCode = enum {...@@ -3980,6 +4022,14 @@ const AbbrevCode = enum {
3980 .{ .alignment, .udata },4022 .{ .alignment, .udata },
3981 },4023 },
3982 },4024 },
4025 .empty_union_type = .{
4026 .tag = .union_type,
4027 .attrs = &.{
4028 .{ .name, .strp },
4029 .{ .byte_size, .udata },
4030 .{ .alignment, .udata },
4031 },
4032 },
3983 .empty_inlined_func = .{4033 .empty_inlined_func = .{
3984 .tag = .inlined_subroutine,4034 .tag = .inlined_subroutine,
3985 .attrs = &.{4035 .attrs = &.{
src/link/Elf/ZigObject.zig+61-5
...@@ -169,7 +169,6 @@ pub fn flushModule(self: *ZigObject, elf_file: *Elf, tid: Zcu.PerThread.Id) !voi...@@ -169,7 +169,6 @@ pub fn flushModule(self: *ZigObject, elf_file: *Elf, tid: Zcu.PerThread.Id) !voi
169 if (self.dwarf) |*dwarf| {169 if (self.dwarf) |*dwarf| {
170 const pt: Zcu.PerThread = .{ .zcu = elf_file.base.comp.module.?, .tid = tid };170 const pt: Zcu.PerThread = .{ .zcu = elf_file.base.comp.module.?, .tid = tid };
171 try dwarf.flushModule(pt);171 try dwarf.flushModule(pt);
172 try dwarf.resolveRelocs();
173172
174 const gpa = elf_file.base.comp.gpa;173 const gpa = elf_file.base.comp.gpa;
175 const cpu_arch = elf_file.getTarget().cpu.arch;174 const cpu_arch = elf_file.getTarget().cpu.arch;
...@@ -209,7 +208,28 @@ pub fn flushModule(self: *ZigObject, elf_file: *Elf, tid: Zcu.PerThread.Id) !voi...@@ -209,7 +208,28 @@ pub fn flushModule(self: *ZigObject, elf_file: *Elf, tid: Zcu.PerThread.Id) !voi
209208
210 const relocs = &self.relocs.items[atom_ptr.relocsShndx().?];209 const relocs = &self.relocs.items[atom_ptr.relocsShndx().?];
211 for (sect.units.items) |*unit| {210 for (sect.units.items) |*unit| {
212 try relocs.ensureUnusedCapacity(gpa, unit.cross_section_relocs.items.len);211 try relocs.ensureUnusedCapacity(gpa, unit.cross_unit_relocs.items.len +
212 unit.cross_section_relocs.items.len);
213 for (unit.cross_unit_relocs.items) |reloc| {
214 const target_unit = sect.getUnit(reloc.target_unit);
215 const r_offset = unit.off + reloc.source_off;
216 const r_addend: i64 = @intCast(target_unit.off + reloc.target_off + (if (reloc.target_entry.unwrap()) |target_entry|
217 target_unit.header_len + target_unit.getEntry(target_entry).assertNonEmpty(unit, sect, dwarf).off
218 else
219 0));
220 const r_type = relocation.dwarf.crossSectionRelocType(dwarf.format, cpu_arch);
221 log.debug(" {s} <- r_off={x}, r_add={x}, r_type={}", .{
222 self.symbol(sym_index).name(elf_file),
223 r_offset,
224 r_addend,
225 relocation.fmtRelocType(r_type, cpu_arch),
226 });
227 atom_ptr.addRelocAssumeCapacity(.{
228 .r_offset = r_offset,
229 .r_addend = r_addend,
230 .r_info = (@as(u64, @intCast(sym_index)) << 32) | r_type,
231 }, self);
232 }
213 for (unit.cross_section_relocs.items) |reloc| {233 for (unit.cross_section_relocs.items) |reloc| {
214 const target_sym_index = switch (reloc.target_sec) {234 const target_sym_index = switch (reloc.target_sec) {
215 .debug_abbrev => self.debug_abbrev_index.?,235 .debug_abbrev => self.debug_abbrev_index.?,
...@@ -246,7 +266,45 @@ pub fn flushModule(self: *ZigObject, elf_file: *Elf, tid: Zcu.PerThread.Id) !voi...@@ -246,7 +266,45 @@ pub fn flushModule(self: *ZigObject, elf_file: *Elf, tid: Zcu.PerThread.Id) !voi
246 for (unit.entries.items) |*entry| {266 for (unit.entries.items) |*entry| {
247 const entry_off = unit.off + unit.header_len + entry.off;267 const entry_off = unit.off + unit.header_len + entry.off;
248268
249 try relocs.ensureUnusedCapacity(gpa, entry.cross_section_relocs.items.len);269 try relocs.ensureUnusedCapacity(gpa, entry.cross_entry_relocs.items.len +
270 entry.cross_unit_relocs.items.len + entry.cross_section_relocs.items.len +
271 entry.external_relocs.items.len);
272 for (entry.cross_entry_relocs.items) |reloc| {
273 const r_offset = entry_off + reloc.source_off;
274 const r_addend: i64 = @intCast(unit.off + reloc.target_off + unit.header_len + unit.getEntry(reloc.target_entry).assertNonEmpty(unit, sect, dwarf).off);
275 const r_type = relocation.dwarf.crossSectionRelocType(dwarf.format, cpu_arch);
276 log.debug(" {s} <- r_off={x}, r_add={x}, r_type={}", .{
277 self.symbol(sym_index).name(elf_file),
278 r_offset,
279 r_addend,
280 relocation.fmtRelocType(r_type, cpu_arch),
281 });
282 atom_ptr.addRelocAssumeCapacity(.{
283 .r_offset = r_offset,
284 .r_addend = r_addend,
285 .r_info = (@as(u64, @intCast(sym_index)) << 32) | r_type,
286 }, self);
287 }
288 for (entry.cross_unit_relocs.items) |reloc| {
289 const target_unit = sect.getUnit(reloc.target_unit);
290 const r_offset = entry_off + reloc.source_off;
291 const r_addend: i64 = @intCast(target_unit.off + reloc.target_off + (if (reloc.target_entry.unwrap()) |target_entry|
292 target_unit.header_len + target_unit.getEntry(target_entry).assertNonEmpty(unit, sect, dwarf).off
293 else
294 0));
295 const r_type = relocation.dwarf.crossSectionRelocType(dwarf.format, cpu_arch);
296 log.debug(" {s} <- r_off={x}, r_add={x}, r_type={}", .{
297 self.symbol(sym_index).name(elf_file),
298 r_offset,
299 r_addend,
300 relocation.fmtRelocType(r_type, cpu_arch),
301 });
302 atom_ptr.addRelocAssumeCapacity(.{
303 .r_offset = r_offset,
304 .r_addend = r_addend,
305 .r_info = (@as(u64, @intCast(sym_index)) << 32) | r_type,
306 }, self);
307 }
250 for (entry.cross_section_relocs.items) |reloc| {308 for (entry.cross_section_relocs.items) |reloc| {
251 const target_sym_index = switch (reloc.target_sec) {309 const target_sym_index = switch (reloc.target_sec) {
252 .debug_abbrev => self.debug_abbrev_index.?,310 .debug_abbrev => self.debug_abbrev_index.?,
...@@ -279,8 +337,6 @@ pub fn flushModule(self: *ZigObject, elf_file: *Elf, tid: Zcu.PerThread.Id) !voi...@@ -279,8 +337,6 @@ pub fn flushModule(self: *ZigObject, elf_file: *Elf, tid: Zcu.PerThread.Id) !voi
279 .r_info = (@as(u64, @intCast(target_sym_index)) << 32) | r_type,337 .r_info = (@as(u64, @intCast(target_sym_index)) << 32) | r_type,
280 }, self);338 }, self);
281 }339 }
282
283 try relocs.ensureUnusedCapacity(gpa, entry.external_relocs.items.len);
284 for (entry.external_relocs.items) |reloc| {340 for (entry.external_relocs.items) |reloc| {
285 const target_sym = self.symbol(reloc.target_sym);341 const target_sym = self.symbol(reloc.target_sym);
286 const r_offset = entry_off + reloc.source_off;342 const r_offset = entry_off + reloc.source_off;
test/src/Debugger.zig+18-18
...@@ -205,26 +205,26 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void {...@@ -205,26 +205,26 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void {
205 \\ single_volatile: *volatile u32 = @ptrFromInt(0x1018),205 \\ single_volatile: *volatile u32 = @ptrFromInt(0x1018),
206 \\ single_const_volatile: *const volatile u32 = @ptrFromInt(0x101c),206 \\ single_const_volatile: *const volatile u32 = @ptrFromInt(0x101c),
207 \\ single_allowzero: *allowzero u32 = @ptrFromInt(0x1020),207 \\ single_allowzero: *allowzero u32 = @ptrFromInt(0x1020),
208 \\ single_const_allowzero: *const allowzero u32 = @ptrFromInt(0x1024),208 \\ single_allowzero_const: *allowzero const u32 = @ptrFromInt(0x1024),
209 \\ single_volatile_allowzero: *volatile allowzero u32 = @ptrFromInt(0x1028),209 \\ single_allowzero_volatile: *allowzero volatile u32 = @ptrFromInt(0x1028),
210 \\ single_const_volatile_allowzero: *const volatile allowzero u32 = @ptrFromInt(0x102c),210 \\ single_allowzero_const_volatile: *allowzero const volatile u32 = @ptrFromInt(0x102c),
211 \\211 \\
212 \\ many: [*]u32 = @ptrFromInt(0x2010),212 \\ many: [*]u32 = @ptrFromInt(0x2010),
213 \\ many_const: [*]const u32 = @ptrFromInt(0x2014),213 \\ many_const: [*]const u32 = @ptrFromInt(0x2014),
214 \\ many_volatile: [*]volatile u32 = @ptrFromInt(0x2018),214 \\ many_volatile: [*]volatile u32 = @ptrFromInt(0x2018),
215 \\ many_const_volatile: [*]const volatile u32 = @ptrFromInt(0x201c),215 \\ many_const_volatile: [*]const volatile u32 = @ptrFromInt(0x201c),
216 \\ many_allowzero: [*]allowzero u32 = @ptrFromInt(0x2020),216 \\ many_allowzero: [*]allowzero u32 = @ptrFromInt(0x2020),
217 \\ many_const_allowzero: [*]const allowzero u32 = @ptrFromInt(0x2024),217 \\ many_allowzero_const: [*]allowzero const u32 = @ptrFromInt(0x2024),
218 \\ many_volatile_allowzero: [*]volatile allowzero u32 = @ptrFromInt(0x2028),218 \\ many_allowzero_volatile: [*]allowzero volatile u32 = @ptrFromInt(0x2028),
219 \\ many_const_volatile_allowzero: [*]const volatile allowzero u32 = @ptrFromInt(0x202c),219 \\ many_allowzero_const_volatile: [*]allowzero const volatile u32 = @ptrFromInt(0x202c),
220 \\ slice: []u32 = array[0..1],220 \\ slice: []u32 = array[0..1],
221 \\ slice_const: []const u32 = array[0..2],221 \\ slice_const: []const u32 = array[0..2],
222 \\ slice_volatile: []volatile u32 = array[0..3],222 \\ slice_volatile: []volatile u32 = array[0..3],
223 \\ slice_const_volatile: []const volatile u32 = array[0..4],223 \\ slice_const_volatile: []const volatile u32 = array[0..4],
224 \\ slice_allowzero: []allowzero u32 = array[4..4],224 \\ slice_allowzero: []allowzero u32 = array[4..4],
225 \\ slice_const_allowzero: []const allowzero u32 = array[4..5],225 \\ slice_allowzero_const: []allowzero const u32 = array[4..5],
226 \\ slice_volatile_allowzero: []volatile allowzero u32 = array[4..6],226 \\ slice_allowzero_volatile: []allowzero volatile u32 = array[4..6],
227 \\ slice_const_volatile_allowzero: []const volatile allowzero u32 = array[4..7],227 \\ slice_allowzero_const_volatile: []allowzero const volatile u32 = array[4..7],
228 \\228 \\
229 \\ c: [*c]u32 = @ptrFromInt(0x4010),229 \\ c: [*c]u32 = @ptrFromInt(0x4010),
230 \\ c_const: [*c]const u32 = @ptrFromInt(0x4014),230 \\ c_const: [*c]const u32 = @ptrFromInt(0x4014),
...@@ -254,17 +254,17 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void {...@@ -254,17 +254,17 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void {
254 \\ (*volatile u32) single_volatile = 0x0000000000001018254 \\ (*volatile u32) single_volatile = 0x0000000000001018
255 \\ (*const volatile u32) single_const_volatile = 0x000000000000101c255 \\ (*const volatile u32) single_const_volatile = 0x000000000000101c
256 \\ (*allowzero u32) single_allowzero = 0x0000000000001020256 \\ (*allowzero u32) single_allowzero = 0x0000000000001020
257 \\ (*const allowzero u32) single_const_allowzero = 0x0000000000001024257 \\ (*allowzero const u32) single_allowzero_const = 0x0000000000001024
258 \\ (*volatile allowzero u32) single_volatile_allowzero = 0x0000000000001028258 \\ (*allowzero volatile u32) single_allowzero_volatile = 0x0000000000001028
259 \\ (*const volatile allowzero u32) single_const_volatile_allowzero = 0x000000000000102c259 \\ (*allowzero const volatile u32) single_allowzero_const_volatile = 0x000000000000102c
260 \\ ([*]u32) many = 0x0000000000002010260 \\ ([*]u32) many = 0x0000000000002010
261 \\ ([*]const u32) many_const = 0x0000000000002014261 \\ ([*]const u32) many_const = 0x0000000000002014
262 \\ ([*]volatile u32) many_volatile = 0x0000000000002018262 \\ ([*]volatile u32) many_volatile = 0x0000000000002018
263 \\ ([*]const volatile u32) many_const_volatile = 0x000000000000201c263 \\ ([*]const volatile u32) many_const_volatile = 0x000000000000201c
264 \\ ([*]allowzero u32) many_allowzero = 0x0000000000002020264 \\ ([*]allowzero u32) many_allowzero = 0x0000000000002020
265 \\ ([*]const allowzero u32) many_const_allowzero = 0x0000000000002024265 \\ ([*]allowzero const u32) many_allowzero_const = 0x0000000000002024
266 \\ ([*]volatile allowzero u32) many_volatile_allowzero = 0x0000000000002028266 \\ ([*]allowzero volatile u32) many_allowzero_volatile = 0x0000000000002028
267 \\ ([*]const volatile allowzero u32) many_const_volatile_allowzero = 0x000000000000202c267 \\ ([*]allowzero const volatile u32) many_allowzero_const_volatile = 0x000000000000202c
268 \\ ([]u32) slice = len=1 {268 \\ ([]u32) slice = len=1 {
269 \\ (u32) [0] = 3010269 \\ (u32) [0] = 3010
270 \\ }270 \\ }
...@@ -284,14 +284,14 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void {...@@ -284,14 +284,14 @@ pub fn addTestsForTarget(db: *Debugger, target: Target) void {
284 \\ (u32) [3] = 3022284 \\ (u32) [3] = 3022
285 \\ }285 \\ }
286 \\ ([]allowzero u32) slice_allowzero = len=0 {}286 \\ ([]allowzero u32) slice_allowzero = len=0 {}
287 \\ ([]const allowzero u32) slice_const_allowzero = len=1 {287 \\ ([]allowzero const u32) slice_allowzero_const = len=1 {
288 \\ (u32) [0] = 3026288 \\ (u32) [0] = 3026
289 \\ }289 \\ }
290 \\ ([]volatile allowzero u32) slice_volatile_allowzero = len=2 {290 \\ ([]allowzero volatile u32) slice_allowzero_volatile = len=2 {
291 \\ (u32) [0] = 3026291 \\ (u32) [0] = 3026
292 \\ (u32) [1] = 3030292 \\ (u32) [1] = 3030
293 \\ }293 \\ }
294 \\ ([]const volatile allowzero u32) slice_const_volatile_allowzero = len=3 {294 \\ ([]allowzero const volatile u32) slice_allowzero_const_volatile = len=3 {
295 \\ (u32) [0] = 3026295 \\ (u32) [0] = 3026
296 \\ (u32) [1] = 3030296 \\ (u32) [1] = 3030
297 \\ (u32) [2] = 3034297 \\ (u32) [2] = 3034