From a893d3014b763c20071cd9525428489357850f00 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 6 Mar 2015 20:45:43 +0000 Subject: 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 --- lldb/source/Core/Module.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lldb/source/Core/Module.cpp') 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()); } } -- cgit v1.2.3