[lldb] Make `process connect` behave the same in sync and async mode.

I think the check for whether the process is connected is totally bogus
in the first place, but on the off-chance that's it's not, we should
behave the same in synchronous and asynchronous mode.
This commit is contained in:
Jonas Devlieghere 2020-11-13 17:30:34 -08:00
parent 2c196bbc6b
commit 6c0cd5676e
3 changed files with 9 additions and 18 deletions

View File

@ -837,18 +837,6 @@ std::string PlatformRemoteGDBServer::MakeUrl(const char *scheme,
return std::string(result.GetString());
}
lldb::ProcessSP PlatformRemoteGDBServer::ConnectProcess(
llvm::StringRef connect_url, llvm::StringRef plugin_name,
lldb_private::Debugger &debugger, lldb_private::Target *target,
lldb_private::Status &error) {
if (!IsRemote() || !IsConnected()) {
error.SetErrorString("Not connected to remote gdb server");
return nullptr;
}
return Platform::ConnectProcess(connect_url, plugin_name, debugger, target,
error);
}
size_t PlatformRemoteGDBServer::ConnectToWaitingProcesses(Debugger &debugger,
Status &error) {
std::vector<std::string> connection_urls;

View File

@ -154,12 +154,6 @@ public:
const lldb::UnixSignalsSP &GetRemoteUnixSignals() override;
lldb::ProcessSP ConnectProcess(llvm::StringRef connect_url,
llvm::StringRef plugin_name,
lldb_private::Debugger &debugger,
lldb_private::Target *target,
lldb_private::Status &error) override;
size_t ConnectToWaitingProcesses(lldb_private::Debugger &debugger,
lldb_private::Status &error) override;

View File

@ -0,0 +1,9 @@
# Synchronous
# RUN: %lldb -o 'platform select remote-gdb-server' -o 'process connect connect://localhost:4321' 2>&1 | FileCheck %s
# Asynchronous
# RUN: echo -e 'platform select remote-gdb-server\nprocess connect connect://localhost:4321' | %lldb 2>&1 | FileCheck %s
# CHECK: Platform: remote-gdb-server
# CHECK: Connected: no
# CHECK: error: Failed to connect port