From 1e4431dcc9ef3ff64ac85747cd77abfc0dd5660b Mon Sep 17 00:00:00 2001 From: Aurora Wright Date: Sat, 7 Oct 2017 20:57:42 +0200 Subject: [PATCH] Fix ARM9 exceptions displaying ARM11-specific info --- exceptions/parser/luma3ds_exception_dump_parser/__main__.py | 6 +++--- source/exceptions.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/exceptions/parser/luma3ds_exception_dump_parser/__main__.py b/exceptions/parser/luma3ds_exception_dump_parser/__main__.py index 0fcc964..5bab50c 100755 --- a/exceptions/parser/luma3ds_exception_dump_parser/__main__.py +++ b/exceptions/parser/luma3ds_exception_dump_parser/__main__.py @@ -142,8 +142,8 @@ def main(args=None): print("Exception type: {0}{1}".format("unknown" if exceptionType >= len(handledExceptionNames) else handledExceptionNames[exceptionType], typeDetailsStr)) - xfsr = registers[18] if exceptionType == 2 else registers[17] if exceptionType == 3 else 0 - if xfsr != 0: + if processor == 11 and exceptionType >= 2: + xfsr = registers[18] if exceptionType == 2 else registers[17] print("Fault status: " + faultStatusSources[xfsr & 0xf]) if additionalDataSize != 0: @@ -155,7 +155,7 @@ def main(args=None): print(makeRegisterLine(registerNames[i], registers[i], registerNames[i+1], registers[i+1])) if nbRegisters % 2 == 1: print("{0:<15}{1:<20}".format(registerNames[nbRegisters - 1], "{0:08x}".format(registers[nbRegisters - 1]))) - if exceptionType == 3: + if processor == 11 and exceptionType == 3: print("{0:<15}{1:<20}Access type: {2}".format("FAR", "{0:08x}".format(registers[19]), "Write" if registers[17] & (1 << 11) != 0 else "Read")) thumb = registers[16] & 0x20 != 0 diff --git a/source/exceptions.c b/source/exceptions.c index 0b95136..e2f4bf7 100644 --- a/source/exceptions.c +++ b/source/exceptions.c @@ -117,7 +117,7 @@ void detectAndProcessExceptionDumps(void) else posY = drawFormattedString(true, 10, posY + SPACING_Y, COLOR_WHITE, "Exception type: %s", handledExceptionNames[dumpHeader->type]); - if(dumpHeader->type >= 2) + if(dumpHeader->processor == 11 && dumpHeader->type >= 2) { u32 xfsr = (dumpHeader->type == 2 ? regs[18] : regs[17]) & 0xF; @@ -144,7 +144,7 @@ void detectAndProcessExceptionDumps(void) posY = drawFormattedString(true, 10 + 22 * SPACING_X, posY, COLOR_WHITE, "%-7s%08X", registerNames[i + 1], regs[20]); } - if(dumpHeader->type == 3) + if(dumpHeader->processor == 11 && dumpHeader->type == 3) posY = drawFormattedString(true, 10, posY + SPACING_Y, COLOR_WHITE, "%-7s%08X Access type: %s", "FAR", regs[19], regs[17] & (1u << 11) ? "Write" : "Read"); posY += SPACING_Y;