[Lldb-commits] [lldb] r237281 - Remove DoAttachToProcessWithId(lldb::pid_t).

Zachary Turner zturner at google.com
Wed May 13 12:44:45 PDT 2015


Author: zturner
Date: Wed May 13 14:44:44 2015
New Revision: 237281

URL: http://llvm.org/viewvc/llvm-project?rev=237281&view=rev
Log:
Remove DoAttachToProcessWithId(lldb::pid_t).

There were two versions of DoAttachToprocessWithId.  One that takes
a pid_t, and the other which takes a pid_t and a ProcessAttachInfo.
There were no callers of the former version, and all of the
implementations of this version were simply forwarding calls to
one version or the other.

Modified:
    lldb/trunk/include/lldb/Target/Process.h
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
    lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
    lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.h
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h

Modified: lldb/trunk/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=237281&r1=237280&r2=237281&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Wed May 13 14:44:44 2015
@@ -1453,31 +1453,14 @@ public:
     /// @param[in] pid
     ///     The process ID that we should attempt to attach to.
     ///
-    /// @return
-    ///     Returns \a pid if attaching was successful, or
-    ///     LLDB_INVALID_PROCESS_ID if attaching fails.
-    //------------------------------------------------------------------
-    virtual Error
-    DoAttachToProcessWithID (lldb::pid_t pid)
-    {
-        Error error;
-        error.SetErrorStringWithFormat("error: %s does not support attaching to a process by pid", GetPluginName().GetCString());
-        return error;
-    }
-
-    //------------------------------------------------------------------
-    /// Attach to an existing process using a process ID.
-    ///
-    /// @param[in] pid
-    ///     The process ID that we should attempt to attach to.
-    ///
     /// @param[in] attach_info
     ///     Information on how to do the attach. For example, GetUserID()
     ///     will return the uid to attach as.
     ///
     /// @return
-    ///     Returns \a pid if attaching was successful, or
-    ///     LLDB_INVALID_PROCESS_ID if attaching fails.
+    ///     Returns a successful Error attaching was successful, or
+    ///     an appropriate (possibly platform-specific) error code if
+    ///     attaching fails.
     /// hanming : need flag
     //------------------------------------------------------------------
     virtual Error
@@ -1499,7 +1482,9 @@ public:
     ///     will return the uid to attach as.
     ///
     /// @return
-    ///     Returns an error object.
+    ///     Returns a successful Error attaching was successful, or
+    ///     an appropriate (possibly platform-specific) error code if
+    ///     attaching fails.
     //------------------------------------------------------------------
     virtual Error
     DoAttachToProcessWithName (const char *process_name, const ProcessAttachInfo &attach_info)

Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp?rev=237281&r1=237280&r2=237281&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp Wed May 13 14:44:44 2015
@@ -406,15 +406,6 @@ ProcessKDP::DoLaunch (Module *exe_module
     return error;
 }
 
-
-Error
-ProcessKDP::DoAttachToProcessWithID (lldb::pid_t attach_pid)
-{
-    Error error;
-    error.SetErrorString ("attach to process by ID is not suppported in kdp remote debugging");
-    return error;
-}
-
 Error
 ProcessKDP::DoAttachToProcessWithID (lldb::pid_t attach_pid, const ProcessAttachInfo &attach_info)
 {

Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h?rev=237281&r1=237280&r2=237281&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h Wed May 13 14:44:44 2015
@@ -97,9 +97,6 @@ public:
     DoConnectRemote (lldb_private::Stream *strm, const char *remote_url);
     
     virtual lldb_private::Error
-    DoAttachToProcessWithID (lldb::pid_t pid);
-    
-    virtual lldb_private::Error
     DoAttachToProcessWithID (lldb::pid_t pid, const lldb_private::ProcessAttachInfo &attach_info);
     
     virtual lldb_private::Error

Modified: lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp?rev=237281&r1=237280&r2=237281&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp (original)
+++ lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.cpp Wed May 13 14:44:44 2015
@@ -85,7 +85,7 @@ ProcessPOSIX::CanDebug(Target &target, b
 }
 
 Error
-ProcessPOSIX::DoAttachToProcessWithID(lldb::pid_t pid)
+ProcessPOSIX::DoAttachToProcessWithID (lldb::pid_t pid,  const ProcessAttachInfo &attach_info)
 {
     Error error;
     assert(m_monitor == NULL);
@@ -134,12 +134,6 @@ ProcessPOSIX::DoAttachToProcessWithID(ll
 }
 
 Error
-ProcessPOSIX::DoAttachToProcessWithID (lldb::pid_t pid,  const ProcessAttachInfo &attach_info)
-{
-    return DoAttachToProcessWithID(pid);
-}
-
-Error
 ProcessPOSIX::WillLaunch(Module* module)
 {
     Error error;

Modified: lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.h?rev=237281&r1=237280&r2=237281&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.h (original)
+++ lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIX.h Wed May 13 14:44:44 2015
@@ -51,9 +51,6 @@ public:
     WillLaunch(lldb_private::Module *module) override;
 
     lldb_private::Error
-    DoAttachToProcessWithID(lldb::pid_t pid) override;
-
-    lldb_private::Error
     DoAttachToProcessWithID (lldb::pid_t pid, const lldb_private::ProcessAttachInfo &attach_info) override;
 
     lldb_private::Error

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=237281&r1=237280&r2=237281&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Wed May 13 14:44:44 2015
@@ -1301,13 +1301,6 @@ ProcessGDBRemote::DidLaunch ()
 }
 
 Error
-ProcessGDBRemote::DoAttachToProcessWithID (lldb::pid_t attach_pid)
-{
-    ProcessAttachInfo attach_info;
-    return DoAttachToProcessWithID(attach_pid, attach_info);
-}
-
-Error
 ProcessGDBRemote::DoAttachToProcessWithID (lldb::pid_t attach_pid, const ProcessAttachInfo &attach_info)
 {
     Log *log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS));

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h?rev=237281&r1=237280&r2=237281&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h Wed May 13 14:44:44 2015
@@ -105,9 +105,6 @@ public:
     
     Error
     WillLaunchOrAttach ();
-
-    Error
-    DoAttachToProcessWithID (lldb::pid_t pid) override;
     
     Error
     DoAttachToProcessWithID (lldb::pid_t pid, const ProcessAttachInfo &attach_info) override;





More information about the lldb-commits mailing list