[nemiver] 701480 Correctly flag a breakpoint pending state



commit 84e754d4df64e91cec41e37026e7ec39a0a670d7
Author: Dodji Seketeli <dodji seketeli org>
Date:   Sun Jun 2 22:22:49 2013 +0200

    701480 Correctly flag a breakpoint pending state
    
        * src/dbgengine/nmv-i-debugger.h (Breakpoint::{m_is_pending,
        is_pending): New data member and accessors.
        (Breakpoint::clear): Initialize the new m_is_pending data member.
        (Breakpoint::address): When a non empty address is set, then the
        breakpoint implicitly becomes non-pending.
        * src/dbgengine/nmv-gdbmi-parser.cc
        (GDBMIParser::parse_breakpoint_with_one_loc): Flag the resulting
        breakpoint as pending when the 'pending' property is present.

 src/dbgengine/nmv-gdbmi-parser.cc |    2 ++
 src/dbgengine/nmv-i-debugger.h    |   19 +++++++++++--------
 2 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/src/dbgengine/nmv-gdbmi-parser.cc b/src/dbgengine/nmv-gdbmi-parser.cc
index e41428e..a2d91cd 100644
--- a/src/dbgengine/nmv-gdbmi-parser.cc
+++ b/src/dbgengine/nmv-gdbmi-parser.cc
@@ -2270,6 +2270,8 @@ GDBMIParser::parse_breakpoint_with_one_loc (Glib::ustring::size_type a_from,
     UString pending = attrs["pending"];
     if (pending.empty ())
         pending = attrs["original-location"];
+    else
+        a_bkpt.is_pending (true);
     if (!pending.empty ()) {
         LOG_D ("got pending breakpoint: '" << pending << "'",
                GDBMI_OUTPUT_DOMAIN);
diff --git a/src/dbgengine/nmv-i-debugger.h b/src/dbgengine/nmv-i-debugger.h
index ef3832e..b8d98ad 100644
--- a/src/dbgengine/nmv-i-debugger.h
+++ b/src/dbgengine/nmv-i-debugger.h
@@ -129,6 +129,8 @@ public:
         // the parent breakpoint.  The parent breakpoint contains
         // information that are relevant for all the sub-breakpoints.
         int m_parent_breakpoint_number;
+        // Whether the breakpoint is pending.
+        bool m_is_pending;
 
     public:
         Breakpoint () {clear ();}
@@ -158,7 +160,12 @@ public:
 
         const Address& address () const {return m_address;}
         Address& address () {return m_address;}
-        void address (const string &a_in) {m_address = a_in;}
+        void address (const string &a_in)
+        {
+            m_address = a_in;
+            if (!m_address.empty ())
+                m_is_pending = false;
+        }
 
         const string& function () const {return m_function;}
         void function (const string &a_in) {m_function = a_in;}
@@ -200,13 +207,8 @@ public:
         bool is_write_watchpoint () const {return m_is_write_watchpoint;}
         void is_write_watchpoint (bool f) {m_is_write_watchpoint = f;}
 
-        bool is_pending () const
-        {
-            if (m_address == "<PENDING>") {
-                return true;
-            }
-            return false;
-        }
+        bool is_pending () const {return m_is_pending;}
+        void is_pending (bool a) {m_is_pending = a;}
 
         /// Test whether this breakpoint has multiple location.
         ///
@@ -255,6 +257,7 @@ public:
             m_is_write_watchpoint = false;
             m_sub_breakpoints.clear ();
             m_parent_breakpoint_number = 0;
+            m_is_pending = false;
         }
     };//end class Breakpoint
 


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