mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
std.debug.SelfInfo: mark ARM unwinding as unsupported
We need to parse the `.ARM.exidx` section to be able to reliably unwind the stack on ARM.
This commit is contained in:
parent
950a9d2a10
commit
dbda011ae6
2 changed files with 9 additions and 3 deletions
|
|
@ -266,8 +266,10 @@ pub fn unwindFrame(module: *const ElfModule, gpa: Allocator, di: *DebugInfo, con
|
||||||
}
|
}
|
||||||
pub const UnwindContext = std.debug.SelfInfo.DwarfUnwindContext;
|
pub const UnwindContext = std.debug.SelfInfo.DwarfUnwindContext;
|
||||||
pub const supports_unwinding: bool = s: {
|
pub const supports_unwinding: bool = s: {
|
||||||
|
// Notably, we are yet to support unwinding on ARM. There, unwinding is not done through
|
||||||
|
// `.eh_frame`, but instead with the `.ARM.exidx` section, which has a different format.
|
||||||
const archs: []const std.Target.Cpu.Arch = switch (builtin.target.os.tag) {
|
const archs: []const std.Target.Cpu.Arch = switch (builtin.target.os.tag) {
|
||||||
.linux => &.{ .x86, .x86_64, .arm, .armeb, .thumb, .thumbeb, .aarch64, .aarch64_be },
|
.linux => &.{ .x86, .x86_64, .aarch64, .aarch64_be },
|
||||||
.netbsd => &.{ .x86, .x86_64, .aarch64, .aarch64_be },
|
.netbsd => &.{ .x86, .x86_64, .aarch64, .aarch64_be },
|
||||||
.freebsd => &.{ .x86_64, .aarch64, .aarch64_be },
|
.freebsd => &.{ .x86_64, .aarch64, .aarch64_be },
|
||||||
.openbsd => &.{.x86_64},
|
.openbsd => &.{.x86_64},
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,12 @@ fn addCaseTarget(
|
||||||
|
|
||||||
// On aarch64-macos, FP unwinding is blessed by Apple to always be reliable, and std.debug knows this.
|
// On aarch64-macos, FP unwinding is blessed by Apple to always be reliable, and std.debug knows this.
|
||||||
const fp_unwind_is_safe = target.result.cpu.arch == .aarch64 and target.result.os.tag.isDarwin();
|
const fp_unwind_is_safe = target.result.cpu.arch == .aarch64 and target.result.os.tag.isDarwin();
|
||||||
// On x86-windows, only FP unwinding is available.
|
const supports_unwind_tables = switch (target.result.os.tag) {
|
||||||
const supports_unwind_tables = target.result.os.tag != .windows or target.result.cpu.arch != .x86;
|
// x86-windows just has no way to do stack unwinding other then using frame pointers.
|
||||||
|
.windows => target.result.cpu.arch != .x86,
|
||||||
|
// We do not yet implement support for the AArch32 exception table section `.ARM.exidx`.
|
||||||
|
else => !target.result.cpu.arch.isArm(),
|
||||||
|
};
|
||||||
|
|
||||||
const use_llvm_vals: []const bool = if (both_backends) &.{ true, false } else &.{true};
|
const use_llvm_vals: []const bool = if (both_backends) &.{ true, false } else &.{true};
|
||||||
const pie_vals: []const ?bool = if (both_pie) &.{ true, false } else &.{null};
|
const pie_vals: []const ?bool = if (both_pie) &.{ true, false } else &.{null};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue