tccrun: fix build on DragonFly BSD.

This commit is contained in:
minux 2014-04-12 00:52:20 -04:00
parent 5f7cdd29b6
commit 8d3e0b3080

View File

@ -528,7 +528,7 @@ static int rt_get_caller_pc(addr_t *paddr, ucontext_t *uc, int level)
/* XXX: only support linux */ /* XXX: only support linux */
#if defined(__APPLE__) #if defined(__APPLE__)
*paddr = uc->uc_mcontext->__ss.__rip; *paddr = uc->uc_mcontext->__ss.__rip;
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
*paddr = uc->uc_mcontext.mc_rip; *paddr = uc->uc_mcontext.mc_rip;
#else #else
*paddr = uc->uc_mcontext.gregs[REG_RIP]; *paddr = uc->uc_mcontext.gregs[REG_RIP];
@ -537,7 +537,7 @@ static int rt_get_caller_pc(addr_t *paddr, ucontext_t *uc, int level)
} else { } else {
#if defined(__APPLE__) #if defined(__APPLE__)
fp = uc->uc_mcontext->__ss.__rbp; fp = uc->uc_mcontext->__ss.__rbp;
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
fp = uc->uc_mcontext.mc_rbp; fp = uc->uc_mcontext.mc_rbp;
#else #else
fp = uc->uc_mcontext.gregs[REG_RBP]; fp = uc->uc_mcontext.gregs[REG_RBP];