diff --git a/exceptions/parser/exception_dump_parser/__init__.py b/exceptions/parser/exception_dump_parser/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/exceptions/exception_dump_parser.py b/exceptions/parser/exception_dump_parser/exception_dump_parser.py old mode 100644 new mode 100755 similarity index 95% rename from exceptions/exception_dump_parser.py rename to exceptions/parser/exception_dump_parser/exception_dump_parser.py index abcb25f..0fcc964 --- a/exceptions/exception_dump_parser.py +++ b/exceptions/parser/exception_dump_parser/exception_dump_parser.py @@ -98,7 +98,7 @@ faultStatusSources = { 0b1000:'Precise External Abort', 0b10110:'Imprecise External Abort', 0b10:'Debug event' } -if __name__ == "__main__": +def main(args=None): parser = argparse.ArgumentParser(description="Parse Luma3DS exception dumps") parser.add_argument("filename") args = parser.parse_args() @@ -141,6 +141,11 @@ if __name__ == "__main__": typeDetailsStr = " (VFP exception)" 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: + print("Fault status: " + faultStatusSources[xfsr & 0xf]) + if additionalDataSize != 0: print("Current process: {0} ({1:016x})".format(additionalData[:8].decode("ascii"), unpack_from("