<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Dec 14, 2016 at 1:41 PM Sean Callanan via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">
Modified: lldb/trunk/source/API/SBFrame.cpp<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFrame.cpp?rev=289711&r1=289710&r2=289711&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFrame.cpp?rev=289711&r1=289710&r2=289711&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- lldb/trunk/source/API/SBFrame.cpp (original)<br class="gmail_msg">
+++ lldb/trunk/source/API/SBFrame.cpp Wed Dec 14 15:31:31 2016<br class="gmail_msg">
@@ -52,6 +52,8 @@<br class="gmail_msg">
#include "lldb/API/SBValue.h"<br class="gmail_msg">
#include "lldb/API/SBVariablesOptions.h"<br class="gmail_msg">
<br class="gmail_msg">
+#include "llvm/Support/PrettyStackTrace.h"<br class="gmail_msg">
+<br class="gmail_msg">
using namespace lldb;<br class="gmail_msg">
using namespace lldb_private;<br class="gmail_msg">
<br class="gmail_msg">
@@ -1288,10 +1290,11 @@ lldb::SBValue SBFrame::EvaluateExpressio<br class="gmail_msg">
if (stop_locker.TryLock(&process->GetRunLock())) {<br class="gmail_msg">
frame = exe_ctx.GetFramePtr();<br class="gmail_msg">
if (frame) {<br class="gmail_msg">
+ std::unique_ptr<llvm::PrettyStackTraceFormat> PST;<br class="gmail_msg"></blockquote><div>Minor nit, but I would move this to the most narrow scope possible that requires its use. which in this case means to move the declaration inside the next if statement.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
if (target->GetDisplayExpressionsInCrashlogs()) {<br class="gmail_msg">
StreamString frame_description;<br class="gmail_msg">
frame->DumpUsingSettingsFormat(&frame_description);<br class="gmail_msg">
- Host::SetCrashDescriptionWithFormat(<br class="gmail_msg">
+ PST = llvm::make_unique<llvm::PrettyStackTraceFormat>(<br class="gmail_msg">
"SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value "<br class="gmail_msg">
"= %u) %s",<br class="gmail_msg">
expr, options.GetFetchDynamicValue(),<br class="gmail_msg"></blockquote><div>If you do the above, then you could declare the variable as `auto` here. Normally auto is frowned upon, but this is an exception since `make_unique<PrettyStackTraceFormat>` is a clear statement of the return type.</div></div></div>