Log dump of processor registers */
| 1202 | |
| 1203 | /* Log dump of processor registers */ |
| 1204 | void logRegisters(ucontext_t *uc) { |
| 1205 | serverLog(LL_WARNING|LL_RAW, "\n------ REGISTERS ------\n"); |
| 1206 | |
| 1207 | /* OSX */ |
| 1208 | #if defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_6) |
| 1209 | /* OSX AMD64 */ |
| 1210 | #if defined(_STRUCT_X86_THREAD_STATE64) && !defined(__i386__) |
| 1211 | serverLog(LL_WARNING, |
| 1212 | "\n" |
| 1213 | "RAX:%016lx RBX:%016lx\nRCX:%016lx RDX:%016lx\n" |
| 1214 | "RDI:%016lx RSI:%016lx\nRBP:%016lx RSP:%016lx\n" |
| 1215 | "R8 :%016lx R9 :%016lx\nR10:%016lx R11:%016lx\n" |
| 1216 | "R12:%016lx R13:%016lx\nR14:%016lx R15:%016lx\n" |
| 1217 | "RIP:%016lx EFL:%016lx\nCS :%016lx FS:%016lx GS:%016lx", |
| 1218 | (unsigned long) uc->uc_mcontext->__ss.__rax, |
| 1219 | (unsigned long) uc->uc_mcontext->__ss.__rbx, |
| 1220 | (unsigned long) uc->uc_mcontext->__ss.__rcx, |
| 1221 | (unsigned long) uc->uc_mcontext->__ss.__rdx, |
| 1222 | (unsigned long) uc->uc_mcontext->__ss.__rdi, |
| 1223 | (unsigned long) uc->uc_mcontext->__ss.__rsi, |
| 1224 | (unsigned long) uc->uc_mcontext->__ss.__rbp, |
| 1225 | (unsigned long) uc->uc_mcontext->__ss.__rsp, |
| 1226 | (unsigned long) uc->uc_mcontext->__ss.__r8, |
| 1227 | (unsigned long) uc->uc_mcontext->__ss.__r9, |
| 1228 | (unsigned long) uc->uc_mcontext->__ss.__r10, |
| 1229 | (unsigned long) uc->uc_mcontext->__ss.__r11, |
| 1230 | (unsigned long) uc->uc_mcontext->__ss.__r12, |
| 1231 | (unsigned long) uc->uc_mcontext->__ss.__r13, |
| 1232 | (unsigned long) uc->uc_mcontext->__ss.__r14, |
| 1233 | (unsigned long) uc->uc_mcontext->__ss.__r15, |
| 1234 | (unsigned long) uc->uc_mcontext->__ss.__rip, |
| 1235 | (unsigned long) uc->uc_mcontext->__ss.__rflags, |
| 1236 | (unsigned long) uc->uc_mcontext->__ss.__cs, |
| 1237 | (unsigned long) uc->uc_mcontext->__ss.__fs, |
| 1238 | (unsigned long) uc->uc_mcontext->__ss.__gs |
| 1239 | ); |
| 1240 | logStackContent((void**)uc->uc_mcontext->__ss.__rsp); |
| 1241 | #elif defined(__i386__) |
| 1242 | /* OSX x86 */ |
| 1243 | serverLog(LL_WARNING, |
| 1244 | "\n" |
| 1245 | "EAX:%08lx EBX:%08lx ECX:%08lx EDX:%08lx\n" |
| 1246 | "EDI:%08lx ESI:%08lx EBP:%08lx ESP:%08lx\n" |
| 1247 | "SS:%08lx EFL:%08lx EIP:%08lx CS :%08lx\n" |
| 1248 | "DS:%08lx ES:%08lx FS :%08lx GS :%08lx", |
| 1249 | (unsigned long) uc->uc_mcontext->__ss.__eax, |
| 1250 | (unsigned long) uc->uc_mcontext->__ss.__ebx, |
| 1251 | (unsigned long) uc->uc_mcontext->__ss.__ecx, |
| 1252 | (unsigned long) uc->uc_mcontext->__ss.__edx, |
| 1253 | (unsigned long) uc->uc_mcontext->__ss.__edi, |
| 1254 | (unsigned long) uc->uc_mcontext->__ss.__esi, |
| 1255 | (unsigned long) uc->uc_mcontext->__ss.__ebp, |
| 1256 | (unsigned long) uc->uc_mcontext->__ss.__esp, |
| 1257 | (unsigned long) uc->uc_mcontext->__ss.__ss, |
| 1258 | (unsigned long) uc->uc_mcontext->__ss.__eflags, |
| 1259 | (unsigned long) uc->uc_mcontext->__ss.__eip, |
| 1260 | (unsigned long) uc->uc_mcontext->__ss.__cs, |
| 1261 | (unsigned long) uc->uc_mcontext->__ss.__ds, |
no test coverage detected