diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-11-30 22:00:00 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-30 22:00:00 -0500 |
| commit | 951dc451d6d49fca499e9a722a3f543d6e8bf7c1 (patch) | |
| tree | 766ef5f8c68186d3622b00f2e5e9546214e4fc48 /lib/std/debug.zig | |
| parent | 11b8d3ce9d7bc8e3ab16813fd5415c9d45dbb232 (diff) | |
| parent | cdeafe777a2fe707674cb44e4aa7b5a1b8319ec5 (diff) | |
| download | zig-951dc451d6d49fca499e9a722a3f543d6e8bf7c1.tar.gz zig-951dc451d6d49fca499e9a722a3f543d6e8bf7c1.zip | |
Merge pull request #3808 from LemonBoy/i386-for-ya
linux-i386 support
Diffstat (limited to 'lib/std/debug.zig')
| -rw-r--r-- | lib/std/debug.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 3c842f3ac1..c822cf57df 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -2417,6 +2417,12 @@ extern fn handleSegfaultLinux(sig: i32, info: *const os.siginfo_t, ctx_ptr: *con std.debug.warn("Segmentation fault at address 0x{x}\n", addr); switch (builtin.arch) { + .i386 => { + const ctx = @ptrCast(*const os.ucontext_t, @alignCast(@alignOf(os.ucontext_t), ctx_ptr)); + const ip = @intCast(usize, ctx.mcontext.gregs[os.REG_EIP]); + const bp = @intCast(usize, ctx.mcontext.gregs[os.REG_EBP]); + dumpStackTraceFromBase(bp, ip); + }, .x86_64 => { const ctx = @ptrCast(*const os.ucontext_t, @alignCast(@alignOf(os.ucontext_t), ctx_ptr)); const ip = @intCast(usize, ctx.mcontext.gregs[os.REG_RIP]); |
