[Lldb-commits] [lldb] 2606918 - Revert "[LLDB/API] Expose args and env from SBProcessInfo."

Bruce Mitchener via lldb-commits lldb-commits at lists.llvm.org
Sat Jun 5 01:51:11 PDT 2021


Author: Bruce Mitchener
Date: 2021-06-05T15:50:49+07:00
New Revision: 2606918f467519f1634a67ee386211e99665fd23

URL: https://github.com/llvm/llvm-project/commit/2606918f467519f1634a67ee386211e99665fd23
DIFF: https://github.com/llvm/llvm-project/commit/2606918f467519f1634a67ee386211e99665fd23.diff

LOG: Revert "[LLDB/API] Expose args and env from SBProcessInfo."

This reverts commit 8d33437d030af27fff21dd3fd0e66893b0148217.

This broke one of the buildbots.

Added: 
    

Modified: 
    lldb/bindings/interface/SBProcessInfo.i
    lldb/include/lldb/API/SBEnvironment.h
    lldb/include/lldb/API/SBProcessInfo.h
    lldb/source/API/SBProcessInfo.cpp
    lldb/test/API/python_api/process/TestProcessAPI.py

Removed: 
    


################################################################################
diff  --git a/lldb/bindings/interface/SBProcessInfo.i b/lldb/bindings/interface/SBProcessInfo.i
index 361975a571ad3..17b2761a344e7 100644
--- a/lldb/bindings/interface/SBProcessInfo.i
+++ b/lldb/bindings/interface/SBProcessInfo.i
@@ -68,25 +68,6 @@ public:
     ) GetTriple;
     const char *
     GetTriple ();
-
-    %feature("docstring",
-    "Return the number of arguments given to the described process."
-    ) GetNumArguments;
-    uint32_t
-    GetNumArguments ();
-
-    %feature("autodoc", "
-    GetArgumentAtIndex(int index) -> string
-    Return the specified argument given to the described process."
-    ) GetArgumentAtIndex;
-    const char *
-    GetArgumentAtIndex (uint32_t index);
-
-    %feature("docstring",
-    "Return the environment variables for the described process."
-    ) GetEnvironment;
-    SBEnvironment
-    GetEnvironment ();
 };
 
 } // namespace lldb

diff  --git a/lldb/include/lldb/API/SBEnvironment.h b/lldb/include/lldb/API/SBEnvironment.h
index fcf41684d0bed..f40ee01a42ab9 100644
--- a/lldb/include/lldb/API/SBEnvironment.h
+++ b/lldb/include/lldb/API/SBEnvironment.h
@@ -122,7 +122,6 @@ class LLDB_API SBEnvironment {
 protected:
   friend class SBPlatform;
   friend class SBTarget;
-  friend class SBProcessInfo;
   friend class SBLaunchInfo;
 
   SBEnvironment(lldb_private::Environment rhs);

diff  --git a/lldb/include/lldb/API/SBProcessInfo.h b/lldb/include/lldb/API/SBProcessInfo.h
index ae5e6072aa744..36fae9e842a61 100644
--- a/lldb/include/lldb/API/SBProcessInfo.h
+++ b/lldb/include/lldb/API/SBProcessInfo.h
@@ -53,19 +53,6 @@ class LLDB_API SBProcessInfo {
   /// Return the target triple (arch-vendor-os) for the described process.
   const char *GetTriple();
 
-  // Return the number of arguments given to the described process.
-  uint32_t GetNumArguments();
-
-  // Return the specified argument given to the described process.
-  const char *GetArgumentAtIndex(uint32_t index);
-
-  /// Return the environment variables for the described process.
-  ///
-  /// \return
-  ///     An lldb::SBEnvironment object which is a copy of the process
-  ///     environment.
-  SBEnvironment GetEnvironment();
-
 private:
   friend class SBProcess;
 

diff  --git a/lldb/source/API/SBProcessInfo.cpp b/lldb/source/API/SBProcessInfo.cpp
index 6f63813673985..cba3bdc179f30 100644
--- a/lldb/source/API/SBProcessInfo.cpp
+++ b/lldb/source/API/SBProcessInfo.cpp
@@ -9,7 +9,6 @@
 #include "lldb/API/SBProcessInfo.h"
 #include "SBReproducerPrivate.h"
 #include "Utils.h"
-#include "lldb/API/SBEnvironment.h"
 #include "lldb/API/SBFileSpec.h"
 #include "lldb/Utility/ProcessInfo.h"
 
@@ -195,38 +194,6 @@ const char *SBProcessInfo::GetTriple() {
   return triple;
 }
 
-uint32_t SBProcessInfo::GetNumArguments() {
-  LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBProcessInfo, GetNumArguments);
-
-  uint32_t num = 0;
-  if (m_opaque_up) {
-    num = m_opaque_up->GetArguments().size();
-  }
-  return num;
-}
-
-const char *SBProcessInfo::GetArgumentAtIndex(uint32_t index) {
-  LLDB_RECORD_METHOD(const char *, SBProcessInfo, GetArgumentAtIndex,
-                     (uint32_t), index);
-
-  const char *argument = nullptr;
-  if (m_opaque_up) {
-    argument = m_opaque_up->GetArguments().GetArgumentAtIndex(index);
-  }
-  return argument;
-}
-
-SBEnvironment SBProcessInfo::GetEnvironment() {
-  LLDB_RECORD_METHOD_NO_ARGS(lldb::SBEnvironment, SBProcessInfo,
-                             GetEnvironment);
-
-  if (m_opaque_up) {
-    return LLDB_RECORD_RESULT(SBEnvironment(m_opaque_up->GetEnvironment()));
-  }
-
-  return LLDB_RECORD_RESULT(SBEnvironment());
-}
-
 namespace lldb_private {
 namespace repro {
 
@@ -253,10 +220,6 @@ void RegisterMethods<SBProcessInfo>(Registry &R) {
   LLDB_REGISTER_METHOD(bool, SBProcessInfo, EffectiveGroupIDIsValid, ());
   LLDB_REGISTER_METHOD(lldb::pid_t, SBProcessInfo, GetParentProcessID, ());
   LLDB_REGISTER_METHOD(const char *, SBProcessInfo, GetTriple, ());
-  LLDB_REGISTER_METHOD(uint32_t, SBProcessInfo, GetNumArguments, ());
-  LLDB_REGISTER_METHOD(const char *, SBProcessInfo, GetArgumentAtIndex,
-                       (uint32_t));
-  LLDB_REGISTER_METHOD(lldb::SBEnvironment, SBProcessInfo, GetEnvironment, ());
 }
 
 }

diff  --git a/lldb/test/API/python_api/process/TestProcessAPI.py b/lldb/test/API/python_api/process/TestProcessAPI.py
index 5df9eb9d5edbe..b7efc7e4affa6 100644
--- a/lldb/test/API/python_api/process/TestProcessAPI.py
+++ b/lldb/test/API/python_api/process/TestProcessAPI.py
@@ -335,8 +335,6 @@ def test_get_process_info(self):
         # Launch the process and stop at the entry point.
         launch_info = target.GetLaunchInfo()
         launch_info.SetWorkingDirectory(self.get_process_working_directory())
-        launch_info.SetEnvironmentEntries(["FOO=BAR"], False)
-        launch_info.SetArguments(["--abc"], False)
         launch_flags = launch_info.GetLaunchFlags()
         launch_flags |= lldb.eLaunchFlagStopAtEntry
         launch_info.SetLaunchFlags(launch_flags)
@@ -360,11 +358,6 @@ def test_get_process_info(self):
             "Process ID is valid")
         triple = process_info.GetTriple()
         self.assertIsNotNone(triple, "Process has a triple")
-        env = process_info.GetEnvironment()
-        self.assertGreater(env.GetNumValues(), 0)
-        self.assertEqual("BAR", env.Get("FOO"))
-        self.assertEqual(process_info.GetNumArguments(), 1)
-        self.assertEqual("--abc", process_info.GetArgumentAtIndex(0))
 
         # Additional process info varies by platform, so just check that
         # whatever info was retrieved is consistent and nothing blows up.


        


More information about the lldb-commits mailing list