From dff830513848caa54df35ce102cb21a989b93e31 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 1 Aug 2020 09:49:03 +0200 Subject: [PATCH] UserspaceEmulator: Don't print backtrace offsets if we have file/line File/line is way more interesting than offsets, so let's only do the offsets if we don't have file/line information. --- DevTools/UserspaceEmulator/Emulator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DevTools/UserspaceEmulator/Emulator.cpp b/DevTools/UserspaceEmulator/Emulator.cpp index b4c72aec45d..dc3ab117ca5 100644 --- a/DevTools/UserspaceEmulator/Emulator.cpp +++ b/DevTools/UserspaceEmulator/Emulator.cpp @@ -225,9 +225,11 @@ void Emulator::dump_backtrace(const Vector& backtrace) u32 offset = 0; String symbol = m_elf->symbolicate(address, &offset); auto source_position = m_debug_info->get_source_position(address); - report("==%d== %#08x %s +%#x", getpid(), address, symbol.characters(), offset); + report("==%d== %#08x %s", getpid(), address, symbol.characters()); if (source_position.has_value()) report(" (\033[34;1m%s\033[0m:%zu)", LexicalPath(source_position.value().file_path).basename().characters(), source_position.value().line_number); + else + report(" +%#x", offset); report("\n"); } }