arm: Skip duplicate consecutive addresses in backtrace output

Adds logic to track and skip duplicate consecutive addresses when logging
backtraces. This improves log readability by removing redundant entries
that point to the same address in sequence.
This commit is contained in:
Zephyron 2025-01-02 17:25:36 +10:00
parent 7dc72a0e95
commit 167a9e1a5b
No known key found for this signature in database
GPG key ID: 8DA271B6A74353F1

View file

@ -18,9 +18,15 @@ void ArmInterface::LogBacktrace(Kernel::KProcess* process) const {
"Offset", "Symbol");
LOG_ERROR(Core_ARM, "");
const auto backtrace = GetBacktraceFromContext(process, ctx);
u64 last_address = 0;
for (const auto& entry : backtrace) {
if (entry.address == last_address) {
continue;
}
LOG_ERROR(Core_ARM, "{:20}{:016X} {:016X} {:016X} {}", entry.module, entry.address,
entry.original_address, entry.offset, entry.name);
last_address = entry.address;
}
}