1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 11:35:10 +00:00

UserspaceEmulator: Fix busted backtraces with --report-to-debug

Some of the output was still going to stderr in this mode, we need to
use reportln() to make sure it goes to the right place.
This commit is contained in:
Andreas Kling 2020-11-08 01:11:14 +01:00
parent 957e7d10d4
commit ae10c9d8ec

View file

@ -230,11 +230,10 @@ void Emulator::dump_backtrace(const Vector<FlatPtr>& backtrace)
u32 offset = 0;
String symbol = m_elf->symbolicate(address, &offset);
auto source_position = m_debug_info->get_source_position(address);
new_warn("=={}== {:p} {}", getpid(), address, symbol);
if (source_position.has_value())
reportln(" (\033[34;1m{}\033[0m:{})", LexicalPath(source_position.value().file_path).basename(), source_position.value().line_number);
reportln("=={}== {:p} {} (\033[34;1m{}\033[0m:{})", getpid(), address, symbol, LexicalPath(source_position.value().file_path).basename(), source_position.value().line_number);
else
reportln(" +{:x}", offset);
reportln("=={}== {:p} {} +{:x}", getpid(), address, symbol, offset);
}
}