1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-23 04:12:02 +00:00

fatal: Display start instead of bt if size = 0

This commit is contained in:
Michael Scire 2018-11-13 18:11:08 -08:00
parent fa9d7f40fc
commit d4ee772714

View file

@ -264,66 +264,82 @@ Result ShowFatalTask::ShowFatal() {
} }
/* Print Backtrace. */ /* Print Backtrace. */
FontManager::SetPosition(backtrace_x, backtrace_y); u32 bt_size;
if (this->ctx->cpu_ctx.is_aarch32) { if (this->ctx->cpu_ctx.is_aarch32) {
FontManager::PrintFormatLine("Backtrace (Start Address = 0x%08x)", this->ctx->cpu_ctx.aarch32_ctx.start_address); bt_size = this->ctx->cpu_ctx.aarch32_ctx.stack_trace_size;
FontManager::AddSpacingLines(0.5f); } else {
for (u32 i = 0; i < Aarch32CpuContext::MaxStackTraceDepth / 2; i++) { bt_size = this->ctx->cpu_ctx.aarch64_ctx.stack_trace_size;
u32 bt_cur = 0, bt_next = 0; }
if (i < this->ctx->cpu_ctx.aarch32_ctx.stack_trace_size) {
bt_cur = this->ctx->cpu_ctx.aarch32_ctx.stack_trace[i]; if (bt_size == 0) {
} if (this->ctx->cpu_ctx.is_aarch32) {
if (i + Aarch32CpuContext::MaxStackTraceDepth / 2 < this->ctx->cpu_ctx.aarch32_ctx.stack_trace_size) { FontManager::PrintFormatLine("Start Address: 0x%08x", this->ctx->cpu_ctx.aarch32_ctx.start_address);
bt_next = this->ctx->cpu_ctx.aarch32_ctx.stack_trace[i + Aarch32CpuContext::MaxStackTraceDepth / 2]; } else {
} FontManager::PrintFormatLine("Start Address: 0x%016lx", this->ctx->cpu_ctx.aarch64_ctx.start_address);
if (i < this->ctx->cpu_ctx.aarch32_ctx.stack_trace_size) {
u32 x = FontManager::GetX();
FontManager::PrintFormat("BT[%02X]: ", i);
FontManager::SetPosition(x + 76, FontManager::GetY());
FontManager::PrintFormat("0x%08x ", bt_cur);
}
if (i + Aarch32CpuContext::MaxStackTraceDepth / 2 < this->ctx->cpu_ctx.aarch32_ctx.stack_trace_size) {
u32 x = FontManager::GetX();
FontManager::PrintFormat("BT[%02X]: ", i + Aarch32CpuContext::MaxStackTraceDepth / 2);
FontManager::SetPosition(x + 76, FontManager::GetY());
FontManager::PrintFormat("0x%08x ", bt_next);
}
FontManager::PrintLine("");
FontManager::SetPosition(backtrace_x, FontManager::GetY());
} }
} else { } else {
FontManager::PrintFormatLine("Backtrace (Start Address = 0x%016lx)", this->ctx->cpu_ctx.aarch64_ctx.start_address); FontManager::SetPosition(backtrace_x, backtrace_y);
FontManager::AddSpacingLines(0.5f); if (this->ctx->cpu_ctx.is_aarch32) {
for (u32 i = 0; i < Aarch64CpuContext::MaxStackTraceDepth / 2; i++) { FontManager::PrintFormatLine("Backtrace (Start Address = 0x%08x)", this->ctx->cpu_ctx.aarch32_ctx.start_address);
u64 bt_cur = 0, bt_next = 0; FontManager::AddSpacingLines(0.5f);
if (i < this->ctx->cpu_ctx.aarch64_ctx.stack_trace_size) { for (u32 i = 0; i < Aarch32CpuContext::MaxStackTraceDepth / 2; i++) {
bt_cur = this->ctx->cpu_ctx.aarch64_ctx.stack_trace[i]; u32 bt_cur = 0, bt_next = 0;
if (i < this->ctx->cpu_ctx.aarch32_ctx.stack_trace_size) {
bt_cur = this->ctx->cpu_ctx.aarch32_ctx.stack_trace[i];
}
if (i + Aarch32CpuContext::MaxStackTraceDepth / 2 < this->ctx->cpu_ctx.aarch32_ctx.stack_trace_size) {
bt_next = this->ctx->cpu_ctx.aarch32_ctx.stack_trace[i + Aarch32CpuContext::MaxStackTraceDepth / 2];
}
if (i < this->ctx->cpu_ctx.aarch32_ctx.stack_trace_size) {
u32 x = FontManager::GetX();
FontManager::PrintFormat("BT[%02X]: ", i);
FontManager::SetPosition(x + 76, FontManager::GetY());
FontManager::PrintFormat("0x%08x ", bt_cur);
}
if (i + Aarch32CpuContext::MaxStackTraceDepth / 2 < this->ctx->cpu_ctx.aarch32_ctx.stack_trace_size) {
u32 x = FontManager::GetX();
FontManager::PrintFormat("BT[%02X]: ", i + Aarch32CpuContext::MaxStackTraceDepth / 2);
FontManager::SetPosition(x + 76, FontManager::GetY());
FontManager::PrintFormat("0x%08x ", bt_next);
}
FontManager::PrintLine("");
FontManager::SetPosition(backtrace_x, FontManager::GetY());
} }
if (i + Aarch64CpuContext::MaxStackTraceDepth / 2 < this->ctx->cpu_ctx.aarch64_ctx.stack_trace_size) { } else {
bt_next = this->ctx->cpu_ctx.aarch64_ctx.stack_trace[i + Aarch64CpuContext::MaxStackTraceDepth / 2]; FontManager::PrintFormatLine("Backtrace (Start Address = 0x%016lx)", this->ctx->cpu_ctx.aarch64_ctx.start_address);
FontManager::AddSpacingLines(0.5f);
for (u32 i = 0; i < Aarch64CpuContext::MaxStackTraceDepth / 2; i++) {
u64 bt_cur = 0, bt_next = 0;
if (i < this->ctx->cpu_ctx.aarch64_ctx.stack_trace_size) {
bt_cur = this->ctx->cpu_ctx.aarch64_ctx.stack_trace[i];
}
if (i + Aarch64CpuContext::MaxStackTraceDepth / 2 < this->ctx->cpu_ctx.aarch64_ctx.stack_trace_size) {
bt_next = this->ctx->cpu_ctx.aarch64_ctx.stack_trace[i + Aarch64CpuContext::MaxStackTraceDepth / 2];
}
if (i < this->ctx->cpu_ctx.aarch64_ctx.stack_trace_size) {
u32 x = FontManager::GetX();
FontManager::PrintFormat("BT[%02X]: ", i);
FontManager::SetPosition(x + 76, FontManager::GetY());
FontManager::PrintFormat("0x%016lx ", bt_cur);
}
if (i + Aarch64CpuContext::MaxStackTraceDepth / 2 < this->ctx->cpu_ctx.aarch64_ctx.stack_trace_size) {
u32 x = FontManager::GetX();
FontManager::PrintFormat("BT[%02X]: ", i + Aarch64CpuContext::MaxStackTraceDepth / 2);
FontManager::SetPosition(x + 76, FontManager::GetY());
FontManager::PrintFormat("0x%016lx ", bt_next);
}
FontManager::PrintLine("");
FontManager::SetPosition(backtrace_x, FontManager::GetY());
} }
if (i < this->ctx->cpu_ctx.aarch64_ctx.stack_trace_size) {
u32 x = FontManager::GetX();
FontManager::PrintFormat("BT[%02X]: ", i);
FontManager::SetPosition(x + 76, FontManager::GetY());
FontManager::PrintFormat("0x%016lx ", bt_cur);
}
if (i + Aarch64CpuContext::MaxStackTraceDepth / 2 < this->ctx->cpu_ctx.aarch64_ctx.stack_trace_size) {
u32 x = FontManager::GetX();
FontManager::PrintFormat("BT[%02X]: ", i + Aarch64CpuContext::MaxStackTraceDepth / 2);
FontManager::SetPosition(x + 76, FontManager::GetY());
FontManager::PrintFormat("0x%016lx ", bt_next);
}
FontManager::PrintLine("");
FontManager::SetPosition(backtrace_x, FontManager::GetY());
} }
} }
/* Enqueue the buffer. */ /* Enqueue the buffer. */
framebufferEnd(&fb); framebufferEnd(&fb);