mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
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.
This commit is contained in:
parent
80eef2c014
commit
dff8305138
Notes:
sideshowbarker
2024-07-19 04:24:58 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/dff83051384
1 changed files with 3 additions and 1 deletions
|
@ -225,9 +225,11 @@ void Emulator::dump_backtrace(const Vector<FlatPtr>& backtrace)
|
||||||
u32 offset = 0;
|
u32 offset = 0;
|
||||||
String symbol = m_elf->symbolicate(address, &offset);
|
String symbol = m_elf->symbolicate(address, &offset);
|
||||||
auto source_position = m_debug_info->get_source_position(address);
|
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())
|
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);
|
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");
|
report("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue