summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core')
-rw-r--r--lldb/source/Core/Log.cpp11
-rw-r--r--lldb/source/Core/Module.cpp10
2 files changed, 18 insertions, 3 deletions
diff --git a/lldb/source/Core/Log.cpp b/lldb/source/Core/Log.cpp
index fe4cfb366c8..2ac538470a6 100644
--- a/lldb/source/Core/Log.cpp
+++ b/lldb/source/Core/Log.cpp
@@ -29,6 +29,8 @@
#include "lldb/Interpreter/Args.h"
#include "llvm/ADT/SmallString.h"
+#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/Signals.h"
using namespace lldb;
using namespace lldb_private;
@@ -122,8 +124,13 @@ Log::PrintfWithFlagsVarArg (uint32_t flags, const char *format, va_list args)
header.PrintfVarArg (format, args);
stream_sp->Printf("%s\n", header.GetData());
- if (m_options.Test (LLDB_LOG_OPTION_BACKTRACE))
- Host::Backtrace (*stream_sp, 1024);
+ if (m_options.Test(LLDB_LOG_OPTION_BACKTRACE))
+ {
+ std::string back_trace;
+ llvm::raw_string_ostream stream(back_trace);
+ llvm::sys::PrintStackTrace(stream);
+ stream_sp->PutCString(back_trace.c_str());
+ }
stream_sp->Flush();
}
}
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());
}
}
OpenPOWER on IntegriCloud