[Lldb-commits] [lldb] r284792 - Add an API to remove an action from the Process PreResumeActions.

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 20 15:50:01 PDT 2016


Author: jingham
Date: Thu Oct 20 17:50:00 2016
New Revision: 284792

URL: http://llvm.org/viewvc/llvm-project?rev=284792&view=rev
Log:
Add an API to remove an action from the Process PreResumeActions.

Modified:
    lldb/trunk/include/lldb/Target/Process.h
    lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=284792&r1=284791&r2=284792&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Thu Oct 20 17:50:00 2016
@@ -2608,6 +2608,8 @@ public:
   bool RunPreResumeActions();
 
   void ClearPreResumeActions();
+  
+  void ClearPreResumeAction(PreResumeActionCallback callback, void *baton);
 
   ProcessRunLock &GetRunLock();
 
@@ -2942,6 +2944,9 @@ protected:
     PreResumeCallbackAndBaton(PreResumeActionCallback in_callback,
                               void *in_baton)
         : callback(in_callback), baton(in_baton) {}
+    bool operator== (const PreResumeCallbackAndBaton &rhs) {
+      return callback == rhs.callback && baton == rhs.baton;
+    }
   };
 
   using StructuredDataPluginMap =

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=284792&r1=284791&r2=284792&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Thu Oct 20 17:50:00 2016
@@ -5860,6 +5860,16 @@ bool Process::RunPreResumeActions() {
 
 void Process::ClearPreResumeActions() { m_pre_resume_actions.clear(); }
 
+void Process::ClearPreResumeAction(PreResumeActionCallback callback, void *baton)
+{
+    PreResumeCallbackAndBaton element(callback, baton);
+    auto found_iter = std::find(m_pre_resume_actions.begin(), m_pre_resume_actions.end(), element);
+    if (found_iter != m_pre_resume_actions.end())
+    {
+        m_pre_resume_actions.erase(found_iter);
+    }
+}
+
 ProcessRunLock &Process::GetRunLock() {
   if (m_private_state_thread.EqualsThread(Host::GetCurrentThread()))
     return m_private_run_lock;




More information about the lldb-commits mailing list