From c16aa3a6774badb3087d849fa28dc7a7356fee5e Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Fri, 6 Nov 2026 11:54:16 -0500 Subject: [PATCH] test/*-traces: add and pass some incremental targets --- lib/std/debug/Dwarf.zig | 8 +++++--- test/error_traces/matrix.zon | 8 ++++++++ test/stack_traces/matrix.zon | 30 ++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/lib/std/debug/Dwarf.zig b/lib/std/debug/Dwarf.zig index a4139c1985..f10bb56c49 100644 --- a/lib/std/debug/Dwarf.zig +++ b/lib/std/debug/Dwarf.zig @@ -1153,7 +1153,7 @@ fn runLineNumberProgram(d: *Dwarf, gpa: Allocator, endian: Endian, compile_unit: .size = size, }); }, - DW.LNE.ZIG_set_decl => { + DW.LNE.ZIG_set_decl, DW.LNE.ZIG_set_source_decl => { const decl_die_offset = try readFormatSizedInt(&fr, unit_header.format, endian); var di_fr: Reader = .fixed(d.section(.debug_info) orelse continue); di_fr.seek = @intCast(decl_die_offset); @@ -1166,8 +1166,10 @@ fn runLineNumberProgram(d: *Dwarf, gpa: Allocator, endian: Endian, compile_unit: addr_size_bytes, compile_unit.version, )) orelse continue; - if (die.getAttr(AT.low_pc)) |_| { - prog.address = try die.getAttrAddr(d, endian, AT.low_pc, compile_unit); + if (sub_op == DW.LNE.ZIG_set_decl) { + if (die.getAttr(AT.low_pc)) |_| { + prog.address = try die.getAttrAddr(d, endian, AT.low_pc, compile_unit); + } } if (die.getAttr(AT.decl_line)) |decl_line| { prog.line = try decl_line.getUInt(i64); diff --git a/test/error_traces/matrix.zon b/test/error_traces/matrix.zon index da4e7130fc..615af1d326 100644 --- a/test/error_traces/matrix.zon +++ b/test/error_traces/matrix.zon @@ -227,6 +227,14 @@ .backend = .selfhosted, .linker = .new, }, + .{ + .cpu = .{ .x86_64 = .{} }, + .os = .{ .linux = .{} }, + .abi = .{ .none = .{} }, + .cache_mode = .incremental, + .backend = .selfhosted, + .linker = .new, + }, .{ .cpu = .{ .x86_64 = .{} }, .os = .{ .linux = .{} }, diff --git a/test/stack_traces/matrix.zon b/test/stack_traces/matrix.zon index 8d2d9b671d..7631b72a92 100644 --- a/test/stack_traces/matrix.zon +++ b/test/stack_traces/matrix.zon @@ -2289,6 +2289,36 @@ .frame_pointers = .omit, .unwind_tables = .async, }, + .{ + .cpu = .{ .x86_64 = .{} }, + .os = .{ .linux = .{} }, + .abi = .{ .none = .{} }, + .cache_mode = .incremental, + .backend = .selfhosted, + .linker = .new, + .frame_pointers = .keep, + .unwind_tables = .none, + }, + .{ + .cpu = .{ .x86_64 = .{} }, + .os = .{ .linux = .{} }, + .abi = .{ .none = .{} }, + .cache_mode = .incremental, + .backend = .selfhosted, + .linker = .new, + .frame_pointers = .keep, + .unwind_tables = .async, + }, + .{ + .cpu = .{ .x86_64 = .{} }, + .os = .{ .linux = .{} }, + .abi = .{ .none = .{} }, + .cache_mode = .incremental, + .backend = .selfhosted, + .linker = .new, + .frame_pointers = .omit, + .unwind_tables = .async, + }, .{ .cpu = .{ .x86_64 = .{} }, .os = .{ .linux = .{} },