[nemiver] Handle breakpoints added via GDB scripts



commit 26d6813e801a2e148a6f6a066542e2e17bb3cacf
Author: Dodji Seketeli <dodji seketeli org>
Date:   Thu Jun 9 01:48:35 2011 +0200

    Handle breakpoints added via GDB scripts
    
    	* src/persp/dbgperspective/nmv-breakpoints-view.cc
    	(BreakpointsView::Priv::set_breakpoints): Handle breakpoints that
    	have been set via e.g, GDB scripts.  That is, breakpoints for
    	which we didn't get singular notification for.

 src/persp/dbgperspective/nmv-breakpoints-view.cc |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/src/persp/dbgperspective/nmv-breakpoints-view.cc b/src/persp/dbgperspective/nmv-breakpoints-view.cc
index 178277c..60b5b19 100644
--- a/src/persp/dbgperspective/nmv-breakpoints-view.cc
+++ b/src/persp/dbgperspective/nmv-breakpoints-view.cc
@@ -254,12 +254,22 @@ public:
                             << breakmap_iter->second.number ());
                     update_breakpoint (tree_iter, breakmap_iter->second);
                 } else {
-                    // We shouldn't reach this place, as we should
-                    // have been notified about any new breakpoint by
-                    // mean of IDebugger::breakpoint_set_signal, and
+                    // Normally, we shouldn't reach this place, as we
+                    // should have been notified about any new
+                    // breakpoint by mean of
+                    // IDebugger::breakpoint_set_signal, and
                     // on_debugger_breakpoint_set_signal should have
-                    // added the breakpoint to the model.                    
-                    THROW ("Should not be reached");
+                    // added the breakpoint to the model.  It turned
+                    // out we can reach this point nevertheless, when,
+                    // say, a breakpoint is added by mean of a GDB
+                    // script. In that case, the GDB implementation of
+                    // IDebugger doesn't get any GDB/MI notification
+                    // upon breakpoint creation, so we don't get the
+                    // IDebugger::breakpoint_set_signal notification.
+                    // Let's just add the breakpoint now then.
+                    LOG_DD ("Didn't find breakpoint: " << breakmap_iter->first
+                            << " so going to add it");
+                    append_breakpoint (breakmap_iter->second);
                 }
             }
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]