[Lldb-commits] [PATCH] D11557: [LLGS] Spawned process handling cleanup
Pavel Labath
labath at google.com
Tue Jul 28 09:25:10 PDT 2015
labath added inline comments.
================
Comment at: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp:280
@@ -291,1 +279,3 @@
+ // Before we try to attach, make sure we aren't already monitoring something else.
+ if (m_debugged_process_sp)
{
----------------
clayborg wrote:
> ovyalov wrote:
> > We may want to check for GetID() != LLDB_INVALID_PROCESS_ID becauseNativeProcessProtocol::Attach doesn't nullify native_process_sp if AttachToInferior fails.
> >
> > Considering how often we check something like m_debugged_process_sp && (m_debugged_process_sp->GetID () != LLDB_INVALID_PROCESS_ID)" having a separate method for this might be pretty convenient - we can do it in another CL.
> Or put ask the process to validate itself with IsBeingDebugged() or some other function that verifies the process is being debugged:
>
> ```
> if (m_debugged_process_sp && m_debugged_process_sp->IsBeingDebugged())
> ```
I have added a check for LLDB_INVALID_PROCESS_ID. For the future I would like to clean this up more so that m_debugged_process_sp is non-null if and only if we have a valid debugged process.
http://reviews.llvm.org/D11557
More information about the lldb-commits
mailing list