Unified · Split
| @@ -39,7 +39,9 @@ · 38 unmodified lines | ||
| 39 | 39 | #ifndef _WIN32 |
| 40 | 40 | # include <unistd.h> |
| 41 | 41 | # include <sys/time.h> |
| 42 | −# include <sys/ucontext.h> | |
| 42 | +# ifndef __OpenBSD__ | |
| 43 | +# include <sys/ucontext.h> | |
| 44 | +# endif | |
| 43 | 45 | # include <sys/mman.h> |
| 44 | 46 | # ifndef CONFIG_TCC_STATIC |
| 45 | 47 | # include <dlfcn.h> |
| @@ -496,6 +496,8 @@ static int rt_get_caller_pc(addr_t *paddr, ucontext_t *uc, int level) · 495 unmodified lines | ||
| 496 | 496 | *paddr = uc->uc_mcontext.eip; |
| 497 | 497 | #elif defined(__NetBSD__) |
| 498 | 498 | *paddr = uc->uc_mcontext.__gregs[_REG_EIP]; |
| 499 | +#elif defined(__OpenBSD__) | |
| 500 | + *paddr = uc->sc_eip; | |
| 499 | 501 | #else |
| 500 | 502 | *paddr = uc->uc_mcontext.gregs[REG_EIP]; |
| 501 | 503 | #endif |
| @@ -509,6 +511,8 @@ static int rt_get_caller_pc(addr_t *paddr, ucontext_t *uc, int level) · 7 unmodified lines | ||
| 509 | 511 | fp = uc->uc_mcontext.ebp; |
| 510 | 512 | #elif defined(__NetBSD__) |
| 511 | 513 | fp = uc->uc_mcontext.__gregs[_REG_EBP]; |
| 514 | +#elif defined(__OpenBSD__) | |
| 515 | + *paddr = uc->sc_ebp; | |
| 512 | 516 | #else |
| 513 | 517 | fp = uc->uc_mcontext.gregs[REG_EBP]; |
| 514 | 518 | #endif |