From 69001646fa81d4692ee4b3a5ce942aa2d957bbe0 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sun, 11 Apr 2010 13:48:14 +0300 Subject: [PATCH] Store the ucontext_t pointer to properly handle resume across signal frames. --- src/x86/Gos-freebsd.c | 1 + src/x86_64/Gos-freebsd.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/x86/Gos-freebsd.c b/src/x86/Gos-freebsd.c index 592bf1f2..2a2b8d18 100644 --- a/src/x86/Gos-freebsd.c +++ b/src/x86/Gos-freebsd.c @@ -108,6 +108,7 @@ unw_handle_signal_frame (unw_cursor_t *cursor) sf = (struct sigframe *)c->dwarf.cfa; uc_addr = (uintptr_t)&(sf->sf_uc); + c->uc = (ucontext_t *)uc_addr; esp_loc = DWARF_LOC (uc_addr + FREEBSD_UC_MCONTEXT_ESP_OFF, 0); ret = dwarf_get (&c->dwarf, esp_loc, &c->dwarf.cfa); diff --git a/src/x86_64/Gos-freebsd.c b/src/x86_64/Gos-freebsd.c index 6d571254..dcbc4922 100644 --- a/src/x86_64/Gos-freebsd.c +++ b/src/x86_64/Gos-freebsd.c @@ -96,6 +96,7 @@ unw_handle_signal_frame (unw_cursor_t *cursor) if (c->sigcontext_format == X86_64_SCF_FREEBSD_SIGFRAME) { ucontext = c->dwarf.cfa + offsetof(struct sigframe, sf_uc); + c->uc = (ucontext_t *)ucontext; Debug(1, "signal frame, skip over trampoline\n"); struct dwarf_loc rsp_loc = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RSP, 0);