strat: TitleId -> ProgramId, titles->contents
This commit is contained in:
@@ -44,7 +44,7 @@ extern "C" {
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::TitleId CurrentTitleId = ncm::TitleId::Fatal;
|
||||
ncm::ProgramId CurrentProgramId = ncm::ProgramId::Fatal;
|
||||
|
||||
namespace result {
|
||||
|
||||
|
||||
@@ -81,9 +81,9 @@ namespace ams::fatal::srv {
|
||||
this->context.cpu_ctx.aarch32_ctx.stack_trace_size = std::max(size_t(this->context.cpu_ctx.aarch32_ctx.stack_trace_size), aarch32::CpuContext::MaxStackTraceDepth);
|
||||
}
|
||||
|
||||
/* Get title id. */
|
||||
pm::info::GetTitleId(&this->context.title_id, process_id);
|
||||
this->context.is_creport = (this->context.title_id == ncm::TitleId::Creport);
|
||||
/* Get program id. */
|
||||
pm::info::GetProgramId(&this->context.program_id, process_id);
|
||||
this->context.is_creport = (this->context.program_id == ncm::ProgramId::Creport);
|
||||
|
||||
if (!this->context.is_creport) {
|
||||
/* On firmware version 2.0.0, use debugging SVCs to collect information. */
|
||||
@@ -91,11 +91,11 @@ namespace ams::fatal::srv {
|
||||
fatal::srv::TryCollectDebugInformation(&this->context, process_id);
|
||||
}
|
||||
} else {
|
||||
/* We received info from creport. Parse title id from afsr0. */
|
||||
/* We received info from creport. Parse program id from afsr0. */
|
||||
if (cpu_ctx.architecture == CpuContext::Architecture_Aarch64) {
|
||||
this->context.title_id = cpu_ctx.aarch64_ctx.GetTitleIdForAtmosphere();
|
||||
this->context.program_id = cpu_ctx.aarch64_ctx.GetProgramIdForAtmosphere();
|
||||
} else {
|
||||
this->context.title_id = cpu_ctx.aarch32_ctx.GetTitleIdForAtmosphere();
|
||||
this->context.program_id = cpu_ctx.aarch32_ctx.GetProgramIdForAtmosphere();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,14 +76,14 @@ namespace ams::fatal::srv {
|
||||
}
|
||||
|
||||
/* Open report file. */
|
||||
snprintf(file_path, sizeof(file_path) - 1, "sdmc:/atmosphere/fatal_reports/%011lu_%016lx.log", timestamp, static_cast<u64>(this->context->title_id));
|
||||
snprintf(file_path, sizeof(file_path) - 1, "sdmc:/atmosphere/fatal_reports/%011lu_%016lx.log", timestamp, static_cast<u64>(this->context->program_id));
|
||||
FILE *f_report = fopen(file_path, "w");
|
||||
if (f_report != NULL) {
|
||||
ON_SCOPE_EXIT { fclose(f_report); };
|
||||
|
||||
fprintf(f_report, "Atmosphère Fatal Report (v1.0):\n");
|
||||
fprintf(f_report, "Result: 0x%X (2%03d-%04d)\n\n", this->context->result.GetValue(), this->context->result.GetModule(), this->context->result.GetDescription());
|
||||
fprintf(f_report, "Title ID: %016lx\n", static_cast<u64>(this->context->title_id));
|
||||
fprintf(f_report, "Program ID: %016lx\n", static_cast<u64>(this->context->program_id));
|
||||
if (strlen(this->context->proc_name)) {
|
||||
fprintf(f_report, "Process Name: %s\n", this->context->proc_name);
|
||||
}
|
||||
@@ -117,7 +117,7 @@ namespace ams::fatal::srv {
|
||||
}
|
||||
|
||||
if (this->context->stack_dump_size) {
|
||||
snprintf(file_path, sizeof(file_path) - 1, "sdmc:/atmosphere/fatal_reports/dumps/%011lu_%016lx.bin", timestamp, static_cast<u64>(this->context->title_id));
|
||||
snprintf(file_path, sizeof(file_path) - 1, "sdmc:/atmosphere/fatal_reports/dumps/%011lu_%016lx.bin", timestamp, static_cast<u64>(this->context->program_id));
|
||||
FILE *f_stackdump = fopen(file_path, "wb");
|
||||
if (f_stackdump == NULL) { return; }
|
||||
ON_SCOPE_EXIT { fclose(f_stackdump); };
|
||||
|
||||
@@ -210,7 +210,7 @@ namespace ams::fatal::srv {
|
||||
font::SetFontSize(16.0f);
|
||||
font::PrintFormat(config.GetErrorMessage(), this->context->result.GetModule(), this->context->result.GetDescription(), this->context->result.GetValue());
|
||||
font::AddSpacingLines(0.5f);
|
||||
font::PrintFormatLine("Title: %016lX", static_cast<u64>(this->context->title_id));
|
||||
font::PrintFormatLine( "Program: %016lX", static_cast<u64>(this->context->program_id));
|
||||
font::AddSpacingLines(0.5f);
|
||||
font::PrintFormatLine(u8"Firmware: %s (Atmosphère %u.%u.%u-%s)", config.GetFirmwareVersion().display_version, ATMOSPHERE_RELEASE_VERSION, ams::GetGitRevision());
|
||||
font::AddSpacingLines(1.5f);
|
||||
|
||||
Reference in New Issue
Block a user