Adopt PrettyStackTrace in LLDB
LLDB needs some minor changes to adopt PrettyStackTrace after https://reviews.llvm.org/D27683.
We remove our own SetCrashDescription() function and use LLVM-provided RAII objects instead.
We also make sure LLDB doesn't define __crashtracer_info__ which would collide with LLVM's definition.
Differential Revision: https://reviews.llvm.org/D27735
llvm-svn: 289711
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index a620f6f..211f77a 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -64,6 +64,7 @@
#include "../source/Commands/CommandObjectBreakpoint.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Regex.h"
using namespace lldb;
@@ -2129,7 +2130,7 @@
StreamString frame_description;
if (frame)
frame->DumpUsingSettingsFormat(&frame_description);
- Host::SetCrashDescriptionWithFormat(
+ llvm::PrettyStackTraceFormat PST(
"SBTarget::EvaluateExpression (expr = \"%s\", fetch_dynamic_value = "
"%u) %s",
expr, options.GetFetchDynamicValue(),
@@ -2139,9 +2140,6 @@
target->EvaluateExpression(expr, frame, expr_value_sp, options.ref());
expr_result.SetSP(expr_value_sp, options.GetFetchDynamicValue());
-#ifdef LLDB_CONFIGURATION_DEBUG
- Host::SetCrashDescription(NULL);
-#endif
} else {
if (log)
log->Printf("SBTarget::EvaluateExpression () => error: could not "