[Lldb-commits] [lldb] 480eb74 - Revert "[lldb/API] Introduce SBProcess::ForceScriptedState method"

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 6 13:18:12 PST 2023


Author: Med Ismail Bennani
Date: 2023-03-06T13:17:40-08:00
New Revision: 480eb744982f2cecd9aa75ef32910fe023d8d4dc

URL: https://github.com/llvm/llvm-project/commit/480eb744982f2cecd9aa75ef32910fe023d8d4dc
DIFF: https://github.com/llvm/llvm-project/commit/480eb744982f2cecd9aa75ef32910fe023d8d4dc.diff

LOG: Revert "[lldb/API] Introduce SBProcess::ForceScriptedState method"

This reverts commit 3675e0bb67fa86b8476a67bb1a7623a6b1a373b3.

Added: 
    

Modified: 
    lldb/include/lldb/API/SBProcess.h
    lldb/include/lldb/Target/Process.h
    lldb/source/API/SBProcess.cpp
    lldb/source/Plugins/Process/scripted/ScriptedProcess.h

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/API/SBProcess.h b/lldb/include/lldb/API/SBProcess.h
index 4b87d4afa310c..be0048763a25d 100644
--- a/lldb/include/lldb/API/SBProcess.h
+++ b/lldb/include/lldb/API/SBProcess.h
@@ -187,14 +187,6 @@ class LLDB_API SBProcess {
   ///   The stop event corresponding to stop ID.
   lldb::SBEvent GetStopEventForStopID(uint32_t stop_id);
 
-  /// If the process is a scripted process, changes its private state.
-  /// No-op otherwise.
-  ///
-  /// \param [in] new_state
-  ///   The new private state that the scripted process should be set to.
-  ///
-  void ForceScriptedState(StateType new_state);
-
   size_t ReadMemory(addr_t addr, void *buf, size_t size, lldb::SBError &error);
 
   size_t WriteMemory(addr_t addr, const void *buf, size_t size,

diff  --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index fb16bb05e9f1f..3ffacb52299b9 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -2544,8 +2544,6 @@ void PruneThreadPlans();
 
   virtual void *GetImplementation() { return nullptr; }
 
-  virtual void ForceScriptedState(lldb::StateType state) {}
-
 protected:
   friend class Trace;
 

diff  --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp
index 2004b66eafe34..ca473175f18f0 100644
--- a/lldb/source/API/SBProcess.cpp
+++ b/lldb/source/API/SBProcess.cpp
@@ -466,16 +466,6 @@ SBEvent SBProcess::GetStopEventForStopID(uint32_t stop_id) {
   return sb_event;
 }
 
-void SBProcess::ForceScriptedState(StateType new_state) {
-  LLDB_INSTRUMENT_VA(this, new_state);
-
-  if (ProcessSP process_sp = GetSP()) {
-    std::lock_guard<std::recursive_mutex> guard(
-        process_sp->GetTarget().GetAPIMutex());
-    process_sp->ForceScriptedState(new_state);
-  }
-}
-
 StateType SBProcess::GetState() {
   LLDB_INSTRUMENT_VA(this);
 

diff  --git a/lldb/source/Plugins/Process/scripted/ScriptedProcess.h b/lldb/source/Plugins/Process/scripted/ScriptedProcess.h
index fd8e3132b620a..d72c19a19720f 100644
--- a/lldb/source/Plugins/Process/scripted/ScriptedProcess.h
+++ b/lldb/source/Plugins/Process/scripted/ScriptedProcess.h
@@ -90,10 +90,6 @@ class ScriptedProcess : public Process {
 
   void *GetImplementation() override;
 
-  void ForceScriptedState(lldb::StateType state) override {
-    SetPrivateState(state);
-  }
-
 protected:
   ScriptedProcess(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp,
                   const ScriptedMetadata &scripted_metadata, Status &error);


        


More information about the lldb-commits mailing list