diff --git a/include/tdep-x86_64/jmpbuf.h b/include/tdep-x86_64/jmpbuf.h index ae1b2d94..44fcd69b 100644 --- a/include/tdep-x86_64/jmpbuf.h +++ b/include/tdep-x86_64/jmpbuf.h @@ -41,4 +41,3 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define JB_MASK 9 #endif - diff --git a/src/x86/Gresume.c b/src/x86/Gresume.c index cf914786..81754760 100644 --- a/src/x86/Gresume.c +++ b/src/x86/Gresume.c @@ -54,6 +54,26 @@ x86_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg) Debug (8, "resuming at ip=%x via setcontext()\n", c->dwarf.ip); setcontext (uc); } +#elif defined __FreeBSD__ + struct cursor *c = (struct cursor *) cursor; + ucontext_t *uc = c->uc; + + /* Ensure c->pi is up-to-date. On x86, it's relatively common to be + missing DWARF unwind info. We don't want to fail in that case, + because the frame-chain still would let us do a backtrace at + least. */ + dwarf_make_proc_info (&c->dwarf); + + if (c->sigcontext_format == X86_SCF_NONE) { + Debug (8, "resuming at ip=%x via setcontext()\n", c->dwarf.ip); + setcontext (uc); + } else if (c->sigcontext_format == XXX) { + struct sigcontext *sc = (struct sigcontext *) c->sigcontext_addr; + + Debug (8, "resuming at ip=%x via sigreturn(%p)\n", c->dwarf.ip, sc); + sigreturn(sc); + } + else #else # warning Implement me! #endif