aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug/Dwarf/abi.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-08-02 12:00:08 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-08-02 14:14:59 -0700
commit975c185b92a7d470ea705b28f46a8004bdda3c60 (patch)
treecb0d037c9a2f38b348ae10b621db417e2f941fa1 /lib/std/debug/Dwarf/abi.zig
parent48d584e3a33a76ef4ea643905a11d311e9ed8bbf (diff)
downloadzig-975c185b92a7d470ea705b28f46a8004bdda3c60.tar.gz
zig-975c185b92a7d470ea705b28f46a8004bdda3c60.zip
fix compilation on powerpc GNU systems
...which have a ucontext_t but not a PC register. The current stack unwinding implementation does not yet support this architecture. Also fix name of `std.debug.SelfInfo.openSelf` to remove redundancy. Also removed this hook into root providing an "openSelfDebugInfo" function. Sorry, this debugging code is not of sufficient quality to offer a plugin API right now.
Diffstat (limited to 'lib/std/debug/Dwarf/abi.zig')
-rw-r--r--lib/std/debug/Dwarf/abi.zig27
1 files changed, 3 insertions, 24 deletions
diff --git a/lib/std/debug/Dwarf/abi.zig b/lib/std/debug/Dwarf/abi.zig
index e87f023d72..f153a10ba4 100644
--- a/lib/std/debug/Dwarf/abi.zig
+++ b/lib/std/debug/Dwarf/abi.zig
@@ -5,35 +5,14 @@ const mem = std.mem;
const posix = std.posix;
const Arch = std.Target.Cpu.Arch;
-pub fn supportsUnwinding(target: std.Target) bool {
- return switch (target.cpu.arch) {
- .x86 => switch (target.os.tag) {
- .linux, .netbsd, .solaris, .illumos => true,
- else => false,
- },
- .x86_64 => switch (target.os.tag) {
- .linux, .netbsd, .freebsd, .openbsd, .macos, .ios, .solaris, .illumos => true,
- else => false,
- },
- .arm => switch (target.os.tag) {
- .linux => true,
- else => false,
- },
- .aarch64 => switch (target.os.tag) {
- .linux, .netbsd, .freebsd, .macos, .ios => true,
- else => false,
- },
- else => false,
- };
-}
-
-pub fn ipRegNum(arch: Arch) u8 {
+/// Returns `null` for CPU architectures without an instruction pointer register.
+pub fn ipRegNum(arch: Arch) ?u8 {
return switch (arch) {
.x86 => 8,
.x86_64 => 16,
.arm => 15,
.aarch64 => 32,
- else => unreachable,
+ else => null,
};
}