From d5b303f852b981c61f0e4fe42d5de4eb3ae7dc75 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 25 Jun 2018 22:27:33 -0600 Subject: [PATCH] creport: Clean up bugs, now saves (empty) reports to the SD successfully --- stratosphere/creport/creport.json | 4 +++- stratosphere/creport/source/creport_code_info.hpp | 2 +- stratosphere/creport/source/creport_crash_report.cpp | 2 +- stratosphere/creport/source/creport_debug_types.hpp | 9 +++++++-- stratosphere/creport/source/creport_thread_info.cpp | 2 +- stratosphere/creport/source/creport_thread_info.hpp | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/stratosphere/creport/creport.json b/stratosphere/creport/creport.json index a280fc5d1..4ea55edbd 100644 --- a/stratosphere/creport/creport.json +++ b/stratosphere/creport/creport.json @@ -18,7 +18,6 @@ "csrng": false, "erpt:c": false, "fatal:u": false, - "fsp-srv": false, "ns:dev": false, "time:s": true }, @@ -71,6 +70,8 @@ "svcOutputDebugString": "0x27", "svcReturnFromException": "0x28", "svcGetInfo": "0x29", + "svcWaitForAddress": "0x34", + "svcSignalToAddress": "0x35", "svcCreateSession": "0x40", "svcAcceptSession": "0x41", "svcReplyAndReceiveLight": "0x42", @@ -81,6 +82,7 @@ "svcGetDebugEvent": "0x63", "svcGetThreadList": "0x66", "svcGetDebugThreadContext": "0x67", + "svcQueryDebugProcessMemory": "0x69", "svcReadDebugProcessMemory": "0x6a", "svcGetDebugThreadParam": "0x6d" }, diff --git a/stratosphere/creport/source/creport_code_info.hpp b/stratosphere/creport/source/creport_code_info.hpp index 7f069a188..279609417 100644 --- a/stratosphere/creport/source/creport_code_info.hpp +++ b/stratosphere/creport/source/creport_code_info.hpp @@ -16,7 +16,7 @@ class CodeList { u32 code_count; CodeInfo code_infos[max_code_count]; public: - CodeList() : code_count(0), code_infos({}) { } + CodeList() : code_count(0) { } void ReadCodeRegionsFromProcess(Handle debug_handle, u64 pc, u64 lr); private: diff --git a/stratosphere/creport/source/creport_crash_report.cpp b/stratosphere/creport/source/creport_crash_report.cpp index 3a4ea3f19..4930afaec 100644 --- a/stratosphere/creport/source/creport_crash_report.cpp +++ b/stratosphere/creport/source/creport_crash_report.cpp @@ -31,7 +31,7 @@ void CrashReport::SaveReport() { } /* Open report file. */ - snprintf(report_path, sizeof(report_path) - 1, "sdmc:/atmosphere/crash reports/%016lx_%016lx.log", timestamp, process_info.title_id); + snprintf(report_path, sizeof(report_path) - 1, "sdmc:/atmosphere/crash reports/%020lu_%016lx.log", timestamp, process_info.title_id); FILE *f_report = fopen(report_path, "w"); if (f_report == NULL) { return; diff --git a/stratosphere/creport/source/creport_debug_types.hpp b/stratosphere/creport/source/creport_debug_types.hpp index c17b32772..0e91418f3 100644 --- a/stratosphere/creport/source/creport_debug_types.hpp +++ b/stratosphere/creport/source/creport_debug_types.hpp @@ -92,5 +92,10 @@ struct DebugEventInfo { DebugEventType type; u32 flags; u64 thread_id; - DebugInfo info; -}; \ No newline at end of file + union { + DebugInfo info; + u64 _[0x40/sizeof(u64)]; + }; +}; + +static_assert(sizeof(DebugEventInfo) >= 0x50, "Incorrect DebugEventInfo definition!"); \ No newline at end of file diff --git a/stratosphere/creport/source/creport_thread_info.cpp b/stratosphere/creport/source/creport_thread_info.cpp index 3ab24b23a..95a6127a5 100644 --- a/stratosphere/creport/source/creport_thread_info.cpp +++ b/stratosphere/creport/source/creport_thread_info.cpp @@ -46,7 +46,7 @@ bool ThreadInfo::ReadFromProcess(Handle debug_handle, u64 thread_id, bool is_64_ /* Advance to the next frame. */ this->stack_trace[this->stack_trace_size++] = cur_frame.lr; - cur_fp = cur_frame.lr; + cur_fp = cur_frame.fp; } return true; diff --git a/stratosphere/creport/source/creport_thread_info.hpp b/stratosphere/creport/source/creport_thread_info.hpp index e7204863f..19879e209 100644 --- a/stratosphere/creport/source/creport_thread_info.hpp +++ b/stratosphere/creport/source/creport_thread_info.hpp @@ -53,7 +53,7 @@ class ThreadList { u32 thread_count; ThreadInfo thread_infos[max_thread_count]; public: - ThreadList() : thread_count(0), thread_infos({}) { } + ThreadList() : thread_count(0) { } void ReadThreadsFromProcess(Handle debug_handle, bool is_64_bit); };