summaryrefslogtreecommitdiffstats
path: root/lldb/source/Utility/LLDBAssert.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-03-06 20:45:43 +0000
committerZachary Turner <zturner@google.com>2015-03-06 20:45:43 +0000
commita893d3014b763c20071cd9525428489357850f00 (patch)
treec951e9dfd9d7904f02e76d2e24809b5b5bb92396 /lldb/source/Utility/LLDBAssert.cpp
parent829c7347d1f51eadf536687b04b0c2e35581d864 (diff)
downloadbcm5719-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/Utility/LLDBAssert.cpp')
-rw-r--r--lldb/source/Utility/LLDBAssert.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/lldb/source/Utility/LLDBAssert.cpp b/lldb/source/Utility/LLDBAssert.cpp
index 875dd51bca3..c11c24b0e42 100644
--- a/lldb/source/Utility/LLDBAssert.cpp
+++ b/lldb/source/Utility/LLDBAssert.cpp
@@ -8,9 +8,12 @@
//===----------------------------------------------------------------------===//
#include "lldb/Utility/LLDBAssert.h"
-#include "lldb/Core/StreamString.h"
-#include "lldb/Host/Host.h"
+#include "llvm/Support/Format.h"
+#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/Signals.h"
+
+using namespace llvm;
using namespace lldb_private;
void
@@ -24,15 +27,10 @@ lldb_private::lldb_assert (int expression,
;
else
{
- StreamString stream;
- stream.Printf("Assertion failed: (%s), function %s, file %s, line %u\n",
- expr_text,
- func,
- file,
- line);
- stream.Printf("backtrace leading to the failure:\n");
- Host::Backtrace(stream, 1000);
- stream.Printf("please file a bug report against lldb reporting this failure log, and as many details as possible\n");
- printf("%s\n", stream.GetData());
+ errs() << format("Assertion failed: (%s), function %s, file %s, line %u\n",
+ expr_text, func, file, line);
+ errs() << "backtrace leading to the failure:\n";
+ llvm::sys::PrintStackTrace(errs());
+ errs() << "please file a bug report against lldb reporting this failure log, and as many details as possible\n";
}
}
OpenPOWER on IntegriCloud