On Wed, Dec 14, 2016 at 1:41 PM Sean Callanan via lldb-commits < lldb-commits@lists.llvm.org> wrote:
> > Modified: lldb/trunk/source/API/SBFrame.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFrame.cpp?rev=289711&r1=289710&r2=289711&view=diff > > ============================================================================== > --- lldb/trunk/source/API/SBFrame.cpp (original) > +++ lldb/trunk/source/API/SBFrame.cpp Wed Dec 14 15:31:31 2016 > @@ -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::EvaluateExpressio > if (stop_locker.TryLock(&process->GetRunLock())) { > frame = exe_ctx.GetFramePtr(); > if (frame) { > + std::unique_ptr<llvm::PrettyStackTraceFormat> PST; > 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. > 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(), > 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.
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits