diff options
author | Zachary Turner <zturner@google.com> | 2015-03-06 20:45:43 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-03-06 20:45:43 +0000 |
commit | a893d3014b763c20071cd9525428489357850f00 (patch) | |
tree | c951e9dfd9d7904f02e76d2e24809b5b5bb92396 /lldb/source/Core/Module.cpp | |
parent | 829c7347d1f51eadf536687b04b0c2e35581d864 (diff) | |
download | bcm5719-llvm-a893d3014b763c20071cd9525428489357850f00.tar.gz bcm5719-llvm-a893d3014b763c20071cd9525428489357850f00.zip |
Remove Host::Backtrace in favor of llvm::sys::PrintStackTrace()
This removes Host::Backtrace from the codebase, and changes all
call sites to use llvm::sys::PrintStackTrace(). This makes the
functionality available for all platforms, and even for platforms
which currently had a supported implementation of Host::Backtrace,
this patch should enable richer information in stack traces, such
as file and line number information, as well as giving it the
ability to unwind through inlined functions.
llvm-svn: 231511
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r-- | lldb/source/Core/Module.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index 2a1663be5cc..d394118cba7 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -40,6 +40,9 @@ #include "Plugins/ObjectFile/JIT/ObjectFileJIT.h" +#include "llvm/Support/raw_os_ostream.h" +#include "llvm/Support/Signals.h" + using namespace lldb; using namespace lldb_private; @@ -1234,7 +1237,12 @@ Module::LogMessageVerboseBacktrace (Log *log, const char *format, ...) log_message.PrintfVarArg (format, args); va_end (args); if (log->GetVerbose()) - Host::Backtrace (log_message, 1024); + { + std::string back_trace; + llvm::raw_string_ostream stream(back_trace); + llvm::sys::PrintStackTrace(stream); + log_message.PutCString(back_trace.c_str()); + } log->PutCString(log_message.GetString().c_str()); } } |