Browse Source

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.
Andreas Kling 4 years ago
parent
commit
ae10c9d8ec
1 changed files with 2 additions and 3 deletions
  1. 2 3
      DevTools/UserspaceEmulator/Emulator.cpp

+ 2 - 3
DevTools/UserspaceEmulator/Emulator.cpp

@@ -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);
     }
 }