mirror of
https://notabug.org/litucks/torzu.git
synced 2025-04-28 09:35:26 +00:00
arm: Skip duplicate consecutive addresses in backtrace output
ref: aa56430f2a
This commit is contained in:
parent
d231c26e22
commit
266eb0d318
@ -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…
x
Reference in New Issue
Block a user