arm: Skip duplicate consecutive addresses in backtrace output
ref: aa56430f2a
This commit is contained in:
parent
cf1bcb02c5
commit
e6d0c5ea42
1 changed files with 11 additions and 2 deletions
|
@ -14,13 +14,22 @@ void ArmInterface::LogBacktrace(Kernel::KProcess* process) const {
|
||||||
this->GetContext(ctx);
|
this->GetContext(ctx);
|
||||||
|
|
||||||
LOG_ERROR(Core_ARM, "Backtrace, sp={:016X}, pc={:016X}", ctx.sp, ctx.pc);
|
LOG_ERROR(Core_ARM, "Backtrace, sp={:016X}, pc={:016X}", ctx.sp, ctx.pc);
|
||||||
LOG_ERROR(Core_ARM, "{:20}{:20}{:20}{:20}{}", "Module Name", "Address", "Original Address",
|
LOG_ERROR(Core_ARM, "{:20}{:20}{:20}{:20}{}", "Module Name", "Address", "Original Address", "Offset", "Symbol");
|
||||||
"Offset", "Symbol");
|
|
||||||
LOG_ERROR(Core_ARM, "");
|
LOG_ERROR(Core_ARM, "");
|
||||||
|
|
||||||
const auto backtrace = GetBacktraceFromContext(process, ctx);
|
const auto backtrace = GetBacktraceFromContext(process, ctx);
|
||||||
|
u64 last_address = 0;
|
||||||
|
|
||||||
for (const auto& entry : backtrace) {
|
for (const auto& entry : backtrace) {
|
||||||
|
|
||||||
|
// Skip duplicate consecutive addresses
|
||||||
|
if (entry.address == last_address)
|
||||||
|
continue;
|
||||||
|
|
||||||
LOG_ERROR(Core_ARM, "{:20}{:016X} {:016X} {:016X} {}", entry.module, entry.address,
|
LOG_ERROR(Core_ARM, "{:20}{:016X} {:016X} {:016X} {}", entry.module, entry.address,
|
||||||
entry.original_address, entry.offset, entry.name);
|
entry.original_address, entry.offset, entry.name);
|
||||||
|
|
||||||
|
last_address = entry.address;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue