[Lldb-commits] [PATCH] D143104: [lldb/Plugins] Add Attach capabilities to ScriptedProcess

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 17 17:28:47 PST 2023


mib added inline comments.


================
Comment at: lldb/source/API/SBAttachInfo.cpp:273-278
+  ScriptedMetadataSP metadata_sp = m_opaque_sp->GetScriptedMetadata();
 
-  m_opaque_sp->SetScriptedProcessClassName(class_name);
+  if (!metadata_sp)
+    metadata_sp = std::make_shared<ScriptedMetadata>(class_name, nullptr);
+
+  m_opaque_sp->SetScriptedMetadata(metadata_sp);
----------------
bulbazord wrote:
> Maybe I'm misunderstanding but it seems like this implementation doesn't allow you to actually change the class name more than once? If that's not intentional, then we should be creating a new ScriptedMetadata and calling `SetScriptedMetadata` every time. If it is intentional, why?
> 
Good catch! I forgot to check-in some code --'


================
Comment at: lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp:203-208
+  SetPrivateState(eStateRunning);
+
+  if (error.Fail())
+    return error;
+
+  SetPrivateState(eStateStopped);
----------------
bulbazord wrote:
> I'm not sure I understand what the point of setting the state to `Running` is and only setting it to `Stopped` if the attach failed? Should we be mucking with state at all if the attach failed?
I guess we can do it subsequently


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

https://reviews.llvm.org/D143104



More information about the lldb-commits mailing list