From 2a2d1bc78bd1169d5bb48a682a5b820c66707e6a Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sat, 19 Jan 2019 16:32:33 -0800 Subject: [PATCH] creport: Fix formatting error. --- .../creport/source/creport_crash_report.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/stratosphere/creport/source/creport_crash_report.cpp b/stratosphere/creport/source/creport_crash_report.cpp index 0c48af675..7d130e34a 100644 --- a/stratosphere/creport/source/creport_crash_report.cpp +++ b/stratosphere/creport/source/creport_crash_report.cpp @@ -19,8 +19,10 @@ #include #include #include + #include "creport_crash_report.hpp" #include "creport_debug_types.hpp" + void CrashReport::BuildReport(u64 pid, bool has_extra_info) { this->has_extra_info = has_extra_info; if (OpenProcess(pid)) { @@ -44,6 +46,7 @@ void CrashReport::BuildReport(u64 pid, bool has_extra_info) { Close(); } } + FatalContext *CrashReport::GetFatalContext() { FatalContext *ctx = new FatalContext; *ctx = (FatalContext){0}; @@ -72,6 +75,7 @@ FatalContext *CrashReport::GetFatalContext() { return ctx; } + void CrashReport::ProcessExceptions() { if (!IsOpen()) { return; @@ -94,6 +98,7 @@ void CrashReport::ProcessExceptions() { } } } + void CrashReport::HandleAttachProcess(DebugEventInfo &d) { this->process_info = d.info.attach_process; if (kernelAbove500() && IsApplication()) { @@ -131,6 +136,7 @@ void CrashReport::HandleAttachProcess(DebugEventInfo &d) { this->dying_message_size = userdata_size; } } + void CrashReport::HandleException(DebugEventInfo &d) { switch (d.info.exception.type) { case DebugExceptionType::UndefinedInstruction: @@ -177,6 +183,7 @@ void CrashReport::HandleException(DebugEventInfo &d) { /* Parse crashing thread info. */ this->crashed_thread_info.ReadFromProcess(this->debug_handle, d.thread_id, Is64Bit()); } + void CrashReport::ProcessDyingMessage() { /* Dying message is only stored starting in 5.0.0. */ if (!kernelAbove500()) { @@ -202,6 +209,7 @@ void CrashReport::ProcessDyingMessage() { svcReadDebugProcessMemory(this->dying_message, this->debug_handle, this->dying_message_address, this->dying_message_size); } + bool CrashReport::IsAddressReadable(u64 address, u64 size, MemoryInfo *o_mi) { MemoryInfo mi; u32 pi; @@ -225,6 +233,7 @@ bool CrashReport::IsAddressReadable(u64 address, u64 size, MemoryInfo *o_mi) { } return true; } + bool CrashReport::GetCurrentTime(u64 *out) { *out = 0; @@ -247,6 +256,7 @@ bool CrashReport::GetCurrentTime(u64 *out) { } return success; } + void CrashReport::EnsureReportDirectories() { char path[FS_MAX_PATH]; strcpy(path, "sdmc:/atmosphere"); @@ -256,6 +266,7 @@ void CrashReport::EnsureReportDirectories() { strcat(path, "/dumps"); mkdir(path, S_IRWXU); } + void CrashReport::SaveReport() { /* Save the report to the SD card. */ char report_path[FS_MAX_PATH]; @@ -284,6 +295,7 @@ void CrashReport::SaveReport() { this->thread_list.DumpBinary(f_report, this->crashed_thread_info.GetId()); fclose(f_report); } + void CrashReport::SaveToFile(FILE *f_report) { char buf[0x10] = {0}; fprintf(f_report, "Atmosphère Crash Report (v1.2):\n"); @@ -341,6 +353,7 @@ void CrashReport::SaveToFile(FILE *f_report) { fprintf(f_report, "\nThread Report:\n"); this->thread_list.SaveToFile(f_report); } + /* Lifted from hactool. */ void CrashReport::Memdump(FILE *f, const char *prefix, const void *data, size_t size) { uint8_t *p = (uint8_t *)data;