[Lldb-commits] [PATCH] D145612: [lldb] Only replace valobj with persisted one if not null in DWIMPrint

Augusto Noronha via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 8 14:19:08 PST 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG581ac50d58b9: [lldb] Only replace valobj with persisted one if not null in DWIMPrint (authored by augusto2112).

Changed prior to commit:
  https://reviews.llvm.org/D145612?vs=503503&id=503518#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145612/new/

https://reviews.llvm.org/D145612

Files:
  lldb/source/Commands/CommandObjectDWIMPrint.cpp


Index: lldb/source/Commands/CommandObjectDWIMPrint.cpp
===================================================================
--- lldb/source/Commands/CommandObjectDWIMPrint.cpp
+++ lldb/source/Commands/CommandObjectDWIMPrint.cpp
@@ -88,8 +88,10 @@
   if (StackFrame *frame = m_exe_ctx.GetFramePtr()) {
     auto valobj_sp = frame->FindVariable(ConstString(expr));
     if (valobj_sp && valobj_sp->GetError().Success()) {
-      if (!eval_options.GetSuppressPersistentResult())
-        valobj_sp = valobj_sp->Persist();
+      if (!eval_options.GetSuppressPersistentResult()) {
+        if (auto persisted_valobj = valobj_sp->Persist())
+          valobj_sp = persisted_valobj;
+      }
 
       if (verbosity == eDWIMPrintVerbosityFull) {
         StringRef flags;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145612.503518.patch
Type: text/x-patch
Size: 764 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230308/5f93ffc5/attachment.bin>


More information about the lldb-commits mailing list