[lldb] [llgs] Support resuming one process with PID!=current via vCont

Extend vCont function to support resuming a process with an arbitrary
PID, that could be different than the one selected via Hc (or no process
at all may be selected).  Resuming more than one process simultaneously
is not supported yet.

Remove the ReadTid() method that was only used by Handle_vCont(),
and furthermore it was wrongly using m_current_process rather than
m_continue_process.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D127862
This commit is contained in:
Michał Górny
2022-06-15 16:48:48 +02:00
parent 3266b11714
commit a3422793e0
4 changed files with 176 additions and 76 deletions

View File

@@ -639,7 +639,7 @@ llvm::Optional<std::pair<lldb::pid_t, lldb::tid_t>>
StringExtractorGDBRemote::GetPidTid(lldb::pid_t default_pid) {
llvm::StringRef view = llvm::StringRef(m_packet).substr(m_index);
size_t initial_length = view.size();
lldb::pid_t pid = default_pid;
lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
lldb::tid_t tid;
if (view.consume_front("p")) {
@@ -675,5 +675,5 @@ StringExtractorGDBRemote::GetPidTid(lldb::pid_t default_pid) {
// update m_index
m_index += initial_length - view.size();
return {{pid, tid}};
return {{pid != LLDB_INVALID_PROCESS_ID ? pid : default_pid, tid}};
}