Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/libraries/source/nvtt/src/src/nvcore/Debug.cpp
Show First 20 Lines • Show All 659 Lines • ▼ Show 20 Lines | # if NV_CPU_X86_64 | ||||
ucontext_t * ucp = (ucontext_t *)secret; | ucontext_t * ucp = (ucontext_t *)secret; | ||||
return (void *)ucp->uc_mcontext.gregs[REG_RIP]; | return (void *)ucp->uc_mcontext.gregs[REG_RIP]; | ||||
# elif NV_CPU_X86 | # elif NV_CPU_X86 | ||||
ucontext_t * ucp = (ucontext_t *)secret; | ucontext_t * ucp = (ucontext_t *)secret; | ||||
return (void *)ucp->uc_mcontext.gregs[14/*REG_EIP*/]; | return (void *)ucp->uc_mcontext.gregs[14/*REG_EIP*/]; | ||||
# elif NV_CPU_PPC | # elif NV_CPU_PPC | ||||
ucontext_t * ucp = (ucontext_t *)secret; | ucontext_t * ucp = (ucontext_t *)secret; | ||||
return (void *) ucp->uc_mcontext.regs->nip; | return (void *) ucp->uc_mcontext.regs->nip; | ||||
# elif NV_CPU_ARM | |||||
ucontext_t * ucp = (ucontext_t *)secret; | |||||
return (void *) ucp->uc_mcontext.arm_pc; | |||||
# elif NV_CPU_AARCH64 | # elif NV_CPU_AARCH64 | ||||
ucontext_t * ucp = (ucontext_t *)secret; | ucontext_t * ucp = (ucontext_t *)secret; | ||||
return (void *) ucp->uc_mcontext.pc; | return (void *) ucp->uc_mcontext.pc; | ||||
# else | # else | ||||
# error "Unknown CPU" | # error "Unknown CPU" | ||||
# endif | # endif | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 340 Lines • ▼ Show 20 Lines | #if (NV_OS_WIN32 && NV_CC_MSVC) || (defined(HAVE_SIGNAL_H) && defined(HAVE_EXECINFO_H)) | ||||
{ | { | ||||
void * trace[64]; | void * trace[64]; | ||||
int size = backtrace(trace, 64); | int size = backtrace(trace, 64); | ||||
Array<const char *> lines; | Array<const char *> lines; | ||||
writeStackTrace(trace, size, callstackLevelsToSkip + 1, lines); // + 1 to skip the call to dumpCallstack | writeStackTrace(trace, size, callstackLevelsToSkip + 1, lines); // + 1 to skip the call to dumpCallstack | ||||
for (uint i = 0; i < lines.count(); i++) { | for (uint i = 0; i < lines.count(); i++) { | ||||
#if NV_CPU_ARM || NV_CPU_AARCH64 || NV_OS_DARWIN || NV_OS_IOS | |||||
va_list empty_va_list = {}; | |||||
messageHandler->log(lines[i], empty_va_list); | |||||
#else | |||||
messageHandler->log(lines[i], NULL); | messageHandler->log(lines[i], NULL); | ||||
#endif | |||||
delete lines[i]; | delete lines[i]; | ||||
} | } | ||||
} | } | ||||
#endif | #endif | ||||
} | } | ||||
/// Set the debug message handler. | /// Set the debug message handler. | ||||
▲ Show 20 Lines • Show All 238 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator