diff options
author | Sean Callanan <scallanan@apple.com> | 2016-12-14 21:31:31 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2016-12-14 21:31:31 +0000 |
commit | 237c3ed95e89388902a70d806fd7fa6d3c9f5eab (patch) | |
tree | 7565ae88c0f2f2b9156845f85aadf7ce74392421 /lldb/source/API | |
parent | 4ffd08cae91e6bfbf1519420aeb096964d27fd39 (diff) | |
download | bcm5719-llvm-237c3ed95e89388902a70d806fd7fa6d3c9f5eab.tar.gz bcm5719-llvm-237c3ed95e89388902a70d806fd7fa6d3c9f5eab.zip |
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
Diffstat (limited to 'lldb/source/API')
-rw-r--r-- | lldb/source/API/SBFrame.cpp | 8 | ||||
-rw-r--r-- | lldb/source/API/SBTarget.cpp | 6 |
2 files changed, 6 insertions, 8 deletions
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp index 1845b12cfcd..5500c339dfa 100644 --- a/lldb/source/API/SBFrame.cpp +++ b/lldb/source/API/SBFrame.cpp @@ -52,6 +52,8 @@ #include "lldb/API/SBValue.h" #include "lldb/API/SBVariablesOptions.h" +#include "llvm/Support/PrettyStackTrace.h" + using namespace lldb; using namespace lldb_private; @@ -1288,10 +1290,11 @@ lldb::SBValue SBFrame::EvaluateExpression(const char *expr, if (stop_locker.TryLock(&process->GetRunLock())) { frame = exe_ctx.GetFramePtr(); if (frame) { + std::unique_ptr<llvm::PrettyStackTraceFormat> PST; if (target->GetDisplayExpressionsInCrashlogs()) { StreamString frame_description; frame->DumpUsingSettingsFormat(&frame_description); - Host::SetCrashDescriptionWithFormat( + PST = llvm::make_unique<llvm::PrettyStackTraceFormat>( "SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value " "= %u) %s", expr, options.GetFetchDynamicValue(), @@ -1301,9 +1304,6 @@ lldb::SBValue SBFrame::EvaluateExpression(const char *expr, exe_results = target->EvaluateExpression(expr, frame, expr_value_sp, options.ref()); expr_result.SetSP(expr_value_sp, options.GetFetchDynamicValue()); - - if (target->GetDisplayExpressionsInCrashlogs()) - Host::SetCrashDescription(nullptr); } else { if (log) log->Printf("SBFrame::EvaluateExpression () => error: could not " diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index a620f6f3093..211f77aee03 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 @@ lldb::SBValue SBTarget::EvaluateExpression(const char *expr, 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 @@ lldb::SBValue SBTarget::EvaluateExpression(const char *expr, 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 " |