Make PlatformPOSIX::KillProcess to delegate to a remote platform if connected.
authorOleksiy Vyalov <ovyalov@google.com>
Tue, 17 Feb 2015 22:57:56 +0000 (22:57 +0000)
committerOleksiy Vyalov <ovyalov@google.com>
Tue, 17 Feb 2015 22:57:56 +0000 (22:57 +0000)
http://reviews.llvm.org/D7660

llvm-svn: 229577

lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h

index 5b72728..8fa8616 100644 (file)
@@ -714,6 +714,18 @@ PlatformPOSIX::LaunchProcess (ProcessLaunchInfo &launch_info)
     return error;
 }
 
+lldb_private::Error
+PlatformPOSIX::KillProcess (const lldb::pid_t pid)
+{
+    if (IsHost())
+        return Platform::KillProcess (pid);
+
+    if (m_remote_platform_sp)
+        return m_remote_platform_sp->KillProcess (pid);
+
+    return Error ("the platform is not currently connected");
+}
+
 lldb::ProcessSP
 PlatformPOSIX::Attach (ProcessAttachInfo &attach_info,
                        Debugger &debugger,
index aae415e..4fec694 100644 (file)
@@ -134,6 +134,9 @@ public:
     lldb_private::Error
     LaunchProcess (lldb_private::ProcessLaunchInfo &launch_info) override;
 
+    lldb_private::Error
+    KillProcess (const lldb::pid_t pid) override;
+
     lldb::ProcessSP
     Attach (lldb_private::ProcessAttachInfo &attach_info,
             lldb_private::Debugger &debugger,