aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorStephen Gregoratto <dev@sgregoratto.me>2021-08-31 22:21:23 +1000
committerAndrew Kelley <andrew@ziglang.org>2021-09-24 14:06:16 -0400
commit87fd502fb68f8f488e6eba6b1f7d70902d6bfe5a (patch)
treee6fa3a1c4b83deb7f03fa191456ef2c4fac5cf3b /lib/std/debug.zig
parenta032fd01e88be2c6e8d0cfb0ccd3d9859c9dffdc (diff)
downloadzig-87fd502fb68f8f488e6eba6b1f7d70902d6bfe5a.tar.gz
zig-87fd502fb68f8f488e6eba6b1f7d70902d6bfe5a.zip
Initial bringup of the Solaris/Illumos port
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index 8517703566..6e2cef1f0c 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -654,6 +654,7 @@ pub fn openSelfDebugInfo(allocator: *mem.Allocator) anyerror!DebugInfo {
.openbsd,
.macos,
.windows,
+ .solaris,
=> return DebugInfo.init(allocator),
else => return error.UnsupportedDebugInfo,
}
@@ -1420,7 +1421,7 @@ pub const ModuleDebugInfo = switch (native_os) {
};
}
},
- .linux, .netbsd, .freebsd, .dragonfly, .openbsd, .haiku => struct {
+ .linux, .netbsd, .freebsd, .dragonfly, .openbsd, .haiku, .solaris => struct {
base_address: usize,
dwarf: DW.DwarfInfo,
mapped_memory: []const u8,
@@ -1468,7 +1469,7 @@ fn getDebugInfoAllocator() *mem.Allocator {
/// Whether or not the current target can print useful debug information when a segfault occurs.
pub const have_segfault_handling_support = switch (native_os) {
- .linux, .netbsd => true,
+ .linux, .netbsd, .solaris => true,
.windows => true,
.freebsd, .openbsd => @hasDecl(os.system, "ucontext_t"),
else => false,
@@ -1535,6 +1536,7 @@ fn handleSegfaultLinux(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const c_v
.freebsd => @ptrToInt(info.addr),
.netbsd => @ptrToInt(info.info.reason.fault.addr),
.openbsd => @ptrToInt(info.data.fault.addr),
+ .solaris => @ptrToInt(info.reason.fault.addr),
else => unreachable,
};
@@ -1559,13 +1561,13 @@ fn handleSegfaultLinux(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const c_v
.x86_64 => {
const ctx = @ptrCast(*const os.ucontext_t, @alignCast(@alignOf(os.ucontext_t), ctx_ptr));
const ip = switch (native_os) {
- .linux, .netbsd => @intCast(usize, ctx.mcontext.gregs[os.REG.RIP]),
+ .linux, .netbsd, .solaris => @intCast(usize, ctx.mcontext.gregs[os.REG.RIP]),
.freebsd => @intCast(usize, ctx.mcontext.rip),
.openbsd => @intCast(usize, ctx.sc_rip),
else => unreachable,
};
const bp = switch (native_os) {
- .linux, .netbsd => @intCast(usize, ctx.mcontext.gregs[os.REG.RBP]),
+ .linux, .netbsd, .solaris => @intCast(usize, ctx.mcontext.gregs[os.REG.RBP]),
.openbsd => @intCast(usize, ctx.sc_rbp),
.freebsd => @intCast(usize, ctx.mcontext.rbp),
else => unreachable,