authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-07-04 00:10:23+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-07-05 10:39:03+02:00
logf0fdc9098919ff65daea48b5b54154406b88d107
tree147acd863388c49164f383dc04983599919ce42a
parent7e8d4c3065f7f80464ea5ebd916e734d8448c0c4
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.debug.SelfInfo.Elf: enable DWARF unwinding for ARM

It seems like whatever bug was causing this to be unreliable is no longer present; all module tests work for me with DWARF unwinding enabled. So let's enable this for now, and if any breakage does pop up later, we can deal with it then.

2 files changed, 15 insertions(+), 9 deletions(-)

lib/std/debug/SelfInfo/Elf.zig+12-7
......@@ -92,12 +92,10 @@ pub fn getModuleSlide(si: *SelfInfo, io: Io, address: usize) Error!usize {
9292}
9393
9494pub const can_unwind: bool = s: {
95 // Notably, we are yet to support unwinding on ARM. There, unwinding is not done through
96 // `.eh_frame`, but instead with the `.ARM.exidx` section, which has a different format.
9795 const archs: []const std.Target.Cpu.Arch = switch (builtin.target.os.tag) {
98 // Not supported yet: arm
9996 .haiku => &.{
10097 .aarch64,
98 .arm,
10199 .riscv64,
102100 .x86,
103101 .x86_64,
......@@ -106,12 +104,14 @@ pub const can_unwind: bool = s: {
106104 .x86,
107105 .x86_64,
108106 },
109 // Not supported yet: arm/armeb/thumb/thumbeb, hppa, hppa64, microblaze/microblazeel
107 // Not supported yet: hppa, hppa64, microblaze/microblazeel, sh/sheb
110108 .linux => &.{
111109 .aarch64,
112110 .aarch64_be,
113111 .alpha,
114112 .arc,
113 .arm,
114 .armeb,
115115 .csky,
116116 .loongarch32,
117117 .loongarch64,
......@@ -124,6 +124,8 @@ pub const can_unwind: bool = s: {
124124 .riscv32,
125125 .riscv64,
126126 .s390x,
127 .thumb,
128 .thumbeb,
127129 .x86,
128130 .x86_64,
129131 },
......@@ -136,18 +138,20 @@ pub const can_unwind: bool = s: {
136138 .dragonfly => &.{
137139 .x86_64,
138140 },
139 // Not supported yet: arm
140141 .freebsd => &.{
141142 .aarch64,
143 .arm,
142144 .riscv64,
143145 .x86,
144146 .x86_64,
145147 },
146 // Not supported yet: arm/armeb, hppa, mips64/mips64el, sh/sheb
148 // Not supported yet: hppa, mips64/mips64el, sh/sheb
147149 .netbsd => &.{
148150 .aarch64,
149151 .aarch64_be,
150152 .alpha,
153 .arm,
154 .armeb,
151155 .m68k,
152156 .mips,
153157 .mipsel,
......@@ -156,9 +160,10 @@ pub const can_unwind: bool = s: {
156160 .x86,
157161 .x86_64,
158162 },
159 // Not supported yet: arm, hppa, sh
163 // Not supported yet: hppa, sh
160164 .openbsd => &.{
161165 .aarch64,
166 .arm,
162167 .m88k,
163168 .mips64,
164169 .mips64el,
test/src/StackTrace.zig+3-2
......@@ -72,6 +72,8 @@ fn addCaseTarget(
7272 .mips64el,
7373 .sh,
7474 .sheb,
75 .xtensa,
76 .xtensaeb,
7577 => .useless,
7678 .hexagon,
7779 .powerpc,
......@@ -87,8 +89,7 @@ fn addCaseTarget(
8789 const supports_unwind_tables = switch (target.result.os.tag) {
8890 // x86-windows just has no way to do stack unwinding other then using frame pointers.
8991 .windows => target.result.cpu.arch != .x86,
90 // We do not yet implement support for the AArch32 exception table section `.ARM.exidx`.
91 else => !target.result.cpu.arch.isArm(),
92 else => true,
9293 };
9394
9495 const use_llvm_vals: []const bool = if (both_backends) &.{ true, false } else &.{true};