creport: Clean up bugs, now saves (empty) reports to the SD successfully

This commit is contained in:
Michael Scire 2018-06-25 22:27:33 -06:00
parent 12236eae9e
commit d5b303f852
6 changed files with 14 additions and 7 deletions

View file

@ -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"
},

View file

@ -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:

View file

@ -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;

View file

@ -92,5 +92,10 @@ struct DebugEventInfo {
DebugEventType type;
u32 flags;
u64 thread_id;
union {
DebugInfo info;
u64 _[0x40/sizeof(u64)];
};
};
static_assert(sizeof(DebugEventInfo) >= 0x50, "Incorrect DebugEventInfo definition!");

View file

@ -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;

View file

@ -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);
};