This commit moves the m_spawned_pids member from the common LLGS/Platform class to the plaform
specific part. This enables us to remove LLGS code, which was attempting to manage the
m_spawned_pids contents, but at the same time making sure, there is only one debugged process. If
we ever want to do multi-process debugging, we will probably want to replace this with a set of
NativeProcessProtocolSP anyway. The only functional change is that support for
qKillSpawnedProcess packet is removed from LLGS, but this was not used there anyway (we have the
k packet for that).
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | ||
---|---|---|
280 ↗ | (On Diff #30797) | 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. |
282 ↗ | (On Diff #30797) | return Error(...)? |
Fix the m_debugged_process_sp check and this is good to go.
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | ||
---|---|---|
280 ↗ | (On Diff #30797) | 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()) |
- Add a check for process validity
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | ||
---|---|---|
280 ↗ | (On Diff #30797) | 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. |