authorgravatar for mason@gamesbymason.comMason Remaley <mason@gamesbymason.com> 2026-04-11 22:27:23-07:00
committergravatar for mason@gamesbymason.comMason Remaley <mason@gamesbymason.com> 2026-04-12 04:01:30-07:00
log541bd6c3693cc57850dc5d78257584dd82f00ec6
tree05e39af24991da9fb7d1bf247c66c68060a107b3
parent87fb7df25794d12b2316dd41a9111e2206c00152

Updates more failing tests


3 files changed, 13 insertions(+), 5 deletions(-)

lib/std/debug.zig+1-1
......@@ -1704,7 +1704,7 @@ test "manage resources correctly" {
17041704 const t: Io.Terminal = .{ .writer = &discarding.writer, .mode = .no_color };
17051705 try printSourceAtAddress(io, &di, t, .{
17061706 .address = S.showMyTrace(),
1707 .inlines = true,
1707 .resolve_inline_callers = true,
17081708 });
17091709}
17101710
lib/std/testing/FailingAllocator.zig+2-2
......@@ -65,7 +65,7 @@ fn alloc(
6565 if (self.alloc_index == self.fail_index) {
6666 if (!self.has_induced_failure) {
6767 const st = std.debug.captureCurrentStackTrace(.{ .first_address = return_address }, &self.stack_addresses);
68 @memset(self.stack_addresses[@min(st.index, self.stack_addresses.len)..], 0);
68 @memset(self.stack_addresses[@min(st.return_addresses.len, self.stack_addresses.len)..], 0);
6969 self.has_induced_failure = true;
7070 }
7171 return null;
......@@ -138,7 +138,7 @@ pub fn getStackTrace(self: *FailingAllocator) std.debug.StackTrace {
138138 len += 1;
139139 }
140140 return .{
141 .instruction_addresses = &self.stack_addresses,
141 .return_addresses = &self.stack_addresses,
142142 .index = len,
143143 };
144144}
test/standalone/coff_dwarf/main.zig+10-2
......@@ -12,8 +12,16 @@ pub fn main(init: std.process.Init) void {
1212 var add_addr: usize = undefined;
1313 _ = add(1, 2, &add_addr);
1414
15 const symbol = di.getSymbol(io, add_addr) catch |err| fatal("failed to get symbol: {t}", .{err});
16 defer if (symbol.source_location) |sl| std.debug.getDebugInfoAllocator().free(sl.file_name);
15 const symbols = di.getSymbols(io, add_addr) catch |err| fatal("failed to get symbol: {t}", .{err});
16 const debug_gpa = std.debug.getDebugInfoAllocator();
17 defer for (symbols) |symbol| {
18 if (symbol.source_location) |sl| {
19 debug_gpa.free(sl.file_name);
20 }
21 }
22
23 if (symbols.len != 1) fatal("expected 1 symbol, found {}", .{symbols.len});
24 const symbol = symbols[0];
1725
1826 if (symbol.name == null) fatal("failed to resolve symbol name", .{});
1927 if (symbol.compile_unit_name == null) fatal("failed to resolve compile unit", .{});