[Lldb-commits] [lldb] r125049 - /lldb/branches/apple/calcite/lldb/source/Target/StopInfo.cpp

Jim Ingham jingham at apple.com
Mon Feb 7 12:51:42 PST 2011


Author: jingham
Date: Mon Feb  7 14:51:41 2011
New Revision: 125049

URL: http://llvm.org/viewvc/llvm-project?rev=125049&view=rev
Log:
Prevent recursive calling of the breakpoint action.  Can happen because we try to reset the stop info the the breakpoint hit when we get done with a function call, but if that happens under an action for this breakpoint, it will re-trigger the action on the way out.

Modified:
    lldb/branches/apple/calcite/lldb/source/Target/StopInfo.cpp

Modified: lldb/branches/apple/calcite/lldb/source/Target/StopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/calcite/lldb/source/Target/StopInfo.cpp?rev=125049&r1=125048&r2=125049&view=diff
==============================================================================
--- lldb/branches/apple/calcite/lldb/source/Target/StopInfo.cpp (original)
+++ lldb/branches/apple/calcite/lldb/source/Target/StopInfo.cpp Mon Feb  7 14:51:41 2011
@@ -59,7 +59,8 @@
         StopInfo (thread, break_id),
         m_description(),
         m_should_stop (false),
-        m_should_stop_is_valid (false)
+        m_should_stop_is_valid (false),
+        m_should_perform_action (true)
     {
     }
     
@@ -67,7 +68,8 @@
         StopInfo (thread, break_id),
         m_description(),
         m_should_stop (should_stop),
-        m_should_stop_is_valid (true)
+        m_should_stop_is_valid (true),
+        m_should_perform_action (true)
     {
     }
 
@@ -115,6 +117,10 @@
     virtual void
     PerformAction (Event *event_ptr)
     {
+        if (!m_should_perform_action)
+            return;
+        m_should_perform_action = false;
+        
         BreakpointSiteSP bp_site_sp (m_thread.GetProcess().GetBreakpointSiteList().FindByID (m_value));
         if (bp_site_sp)
         {
@@ -189,6 +195,8 @@
     std::string m_description;
     bool m_should_stop;
     bool m_should_stop_is_valid;
+    bool m_should_perform_action; // Since we are trying to preserve the "state" of the system even if we run functions
+                                  // etc. behind the users backs, we need to make sure we only REALLY perform the action once.
 };
 
 





More information about the lldb-commits mailing list