creport: fix various issues, improve support (closes #187)

-Fixes a NULL deref in thread info parsing
-Heuristically uses [<buildid>] instead of rodata contents if NSO has no
name segment
-Adds full thread/code region dump for all firmwares, instead of just
5.x.
This commit is contained in:
Michael Scire
2018-08-11 18:46:41 -07:00
parent 761ab4fcfe
commit 6c8a1a39e1
3 changed files with 44 additions and 13 deletions

View File

@@ -11,10 +11,9 @@ void CrashReport::BuildReport(u64 pid, bool has_extra_info) {
this->has_extra_info = has_extra_info;
if (OpenProcess(pid)) {
ProcessExceptions();
if (kernelAbove500()) {
this->code_list.ReadCodeRegionsFromProcess(this->debug_handle, this->crashed_thread_info.GetPC(), this->crashed_thread_info.GetLR());
this->thread_list.ReadThreadsFromProcess(this->debug_handle, Is64Bit());
}
this->code_list.ReadCodeRegionsFromProcess(this->debug_handle, this->crashed_thread_info.GetPC(), this->crashed_thread_info.GetLR());
this->thread_list.ReadThreadsFromProcess(this->debug_handle, Is64Bit());
this->crashed_thread_info.SetCodeList(&this->code_list);
this->thread_list.SetCodeList(&this->code_list);
if (IsApplication()) {
@@ -287,11 +286,11 @@ void CrashReport::SaveToFile(FILE *f_report) {
fprintf(f_report, " Size: 0x%016lx\n", this->dying_message_size);
CrashReport::Memdump(f_report, " Dying Message: ", this->dying_message, this->dying_message_size);
}
fprintf(f_report, "Code Region Info:\n");
this->code_list.SaveToFile(f_report);
fprintf(f_report, "\nThread Report:\n");
this->thread_list.SaveToFile(f_report);
}
fprintf(f_report, "Code Region Info:\n");
this->code_list.SaveToFile(f_report);
fprintf(f_report, "\nThread Report:\n");
this->thread_list.SaveToFile(f_report);
}
/* Lifted from hactool. */