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 {...@@ -92,12 +92,10 @@ pub fn getModuleSlide(si: *SelfInfo, io: Io, address: usize) Error!usize {
92}92}
9393
94pub const can_unwind: bool = s: {94pub 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.
97 const archs: []const std.Target.Cpu.Arch = switch (builtin.target.os.tag) {95 const archs: []const std.Target.Cpu.Arch = switch (builtin.target.os.tag) {
98 // Not supported yet: arm
99 .haiku => &.{96 .haiku => &.{
100 .aarch64,97 .aarch64,
98 .arm,
101 .riscv64,99 .riscv64,
102 .x86,100 .x86,
103 .x86_64,101 .x86_64,
...@@ -106,12 +104,14 @@ pub const can_unwind: bool = s: {...@@ -106,12 +104,14 @@ pub const can_unwind: bool = s: {
106 .x86,104 .x86,
107 .x86_64,105 .x86_64,
108 },106 },
109 // Not supported yet: arm/armeb/thumb/thumbeb, hppa, hppa64, microblaze/microblazeel107 // Not supported yet: hppa, hppa64, microblaze/microblazeel, sh/sheb
110 .linux => &.{108 .linux => &.{
111 .aarch64,109 .aarch64,
112 .aarch64_be,110 .aarch64_be,
113 .alpha,111 .alpha,
114 .arc,112 .arc,
113 .arm,
114 .armeb,
115 .csky,115 .csky,
116 .loongarch32,116 .loongarch32,
117 .loongarch64,117 .loongarch64,
...@@ -124,6 +124,8 @@ pub const can_unwind: bool = s: {...@@ -124,6 +124,8 @@ pub const can_unwind: bool = s: {
124 .riscv32,124 .riscv32,
125 .riscv64,125 .riscv64,
126 .s390x,126 .s390x,
127 .thumb,
128 .thumbeb,
127 .x86,129 .x86,
128 .x86_64,130 .x86_64,
129 },131 },
...@@ -136,18 +138,20 @@ pub const can_unwind: bool = s: {...@@ -136,18 +138,20 @@ pub const can_unwind: bool = s: {
136 .dragonfly => &.{138 .dragonfly => &.{
137 .x86_64,139 .x86_64,
138 },140 },
139 // Not supported yet: arm
140 .freebsd => &.{141 .freebsd => &.{
141 .aarch64,142 .aarch64,
143 .arm,
142 .riscv64,144 .riscv64,
143 .x86,145 .x86,
144 .x86_64,146 .x86_64,
145 },147 },
146 // Not supported yet: arm/armeb, hppa, mips64/mips64el, sh/sheb148 // Not supported yet: hppa, mips64/mips64el, sh/sheb
147 .netbsd => &.{149 .netbsd => &.{
148 .aarch64,150 .aarch64,
149 .aarch64_be,151 .aarch64_be,
150 .alpha,152 .alpha,
153 .arm,
154 .armeb,
151 .m68k,155 .m68k,
152 .mips,156 .mips,
153 .mipsel,157 .mipsel,
...@@ -156,9 +160,10 @@ pub const can_unwind: bool = s: {...@@ -156,9 +160,10 @@ pub const can_unwind: bool = s: {
156 .x86,160 .x86,
157 .x86_64,161 .x86_64,
158 },162 },
159 // Not supported yet: arm, hppa, sh163 // Not supported yet: hppa, sh
160 .openbsd => &.{164 .openbsd => &.{
161 .aarch64,165 .aarch64,
166 .arm,
162 .m88k,167 .m88k,
163 .mips64,168 .mips64,
164 .mips64el,169 .mips64el,
test/src/StackTrace.zig+3-2
...@@ -72,6 +72,8 @@ fn addCaseTarget(...@@ -72,6 +72,8 @@ fn addCaseTarget(
72 .mips64el,72 .mips64el,
73 .sh,73 .sh,
74 .sheb,74 .sheb,
75 .xtensa,
76 .xtensaeb,
75 => .useless,77 => .useless,
76 .hexagon,78 .hexagon,
77 .powerpc,79 .powerpc,
...@@ -87,8 +89,7 @@ fn addCaseTarget(...@@ -87,8 +89,7 @@ fn addCaseTarget(
87 const supports_unwind_tables = switch (target.result.os.tag) {89 const supports_unwind_tables = switch (target.result.os.tag) {
88 // x86-windows just has no way to do stack unwinding other then using frame pointers.90 // x86-windows just has no way to do stack unwinding other then using frame pointers.
89 .windows => target.result.cpu.arch != .x86,91 .windows => target.result.cpu.arch != .x86,
90 // We do not yet implement support for the AArch32 exception table section `.ARM.exidx`.92 else => true,
91 else => !target.result.cpu.arch.isArm(),
92 };93 };
9394
94 const use_llvm_vals: []const bool = if (both_backends) &.{ true, false } else &.{true};95 const use_llvm_vals: []const bool = if (both_backends) &.{ true, false } else &.{true};