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