MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / OSDumpContext

Function OSDumpContext

src/dolphin/src/os/OSContext.c:366–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364}
365
366void OSDumpContext(OSContext* context)
367{
368 u32 i;
369 u32* p;
370
371 OSReport("------------------------- Context 0x%08x -------------------------\n", context);
372
373 for (i = 0; i < 16; ++i)
374 {
375 OSReport("r%-2d = 0x%08x (%14d) r%-2d = 0x%08x (%14d)\n", i, context->gpr[i],
376 context->gpr[i], i + 16, context->gpr[i + 16], context->gpr[i + 16]);
377 }
378
379 OSReport("LR = 0x%08x CR = 0x%08x\n", context->lr, context->cr);
380 OSReport("SRR0 = 0x%08x SRR1 = 0x%08x\n", context->srr0, context->srr1);
381
382 OSReport("\nGQRs----------\n");
383 for (i = 0; i < 4; ++i)
384 {
385 OSReport("gqr%d = 0x%08x \t gqr%d = 0x%08x\n", i, context->gqr[i], i + 4,
386 context->gqr[i + 4]);
387 }
388
389 if (context->state & OS_CONTEXT_STATE_FPSAVED)
390 {
391 OSContext* currentContext;
392 OSContext fpuContext;
393 BOOL enabled;
394
395 enabled = OSDisableInterrupts();
396 currentContext = OSGetCurrentContext();
397 OSClearContext(&fpuContext);
398 OSSetCurrentContext(&fpuContext);
399
400 OSReport("\n\nFPRs----------\n");
401 for (i = 0; i < 32; i += 2)
402 {
403 OSReport("fr%d \t= %d \t fr%d \t= %d\n", i, (u32)context->fpr[i], i + 1,
404 (u32)context->fpr[i + 1]);
405 }
406 OSReport("\n\nPSFs----------\n");
407 for (i = 0; i < 32; i += 2)
408 {
409 OSReport("ps%d \t= 0x%x \t ps%d \t= 0x%x\n", i, (u32)context->psf[i], i + 1,
410 (u32)context->psf[i + 1]);
411 }
412
413 OSClearContext(&fpuContext);
414 OSSetCurrentContext(currentContext);
415 OSRestoreInterrupts(enabled);
416 }
417
418 OSReport("\nAddress: Back Chain LR Save\n");
419 for (i = 0, p = (u32*)context->gpr[1]; p && (u32)p != 0xffffffff && i++ < 16; p = (u32*)*p)
420 {
421 OSReport("0x%08x: 0x%08x 0x%08x\n", p, p[0], p[1]);
422 }
423}

Callers 3

DMAErrorHandlerFunction · 0.85
__OSUnhandledExceptionFunction · 0.85

Calls 2

OSReportFunction · 0.85
OSDisableInterruptsFunction · 0.85

Tested by

no test coverage detected