[nemiver/count-point: 7/14] Replace debugger_utils::is_countpoint with IDebugger::is_countpoint



commit 6e05b0b05316bdb1f1ac40b306ad3aa22a4c5197
Author: Dodji Seketeli <dodji seketeli org>
Date:   Sat Oct 9 14:24:10 2010 +0200

    Replace debugger_utils::is_countpoint with IDebugger::is_countpoint
    
    	* src/dbgengine/nmv-debugger-utils.h (is_countpoint): Remove.
    	* src/dbgengine/nmv-debugger-utils.cc (is_countpoint): Remove
    	* src/dbgengine/nmv-i-debugger.h (IDebugger::is_countpoint): New API.
    	* src/dbgengine/nmv-gdb-engine.h (GDBEngine::is_countpoint): Likewise.
    	* src/dbgengine/nmv-gdb-engine.cc (GDBEngine::is_countpoint):
    	Implement new API.
    	* src/persp/dbgperspective/nmv-breakpoints-view.cc
    	(BreakpointsView::Priv::update_breakpoint): Replace use of
    	debugger_utils::is_counpoint with IDebugger::is_countpoint.
    	* src/persp/dbgperspective/nmv-dbg-perspective.cc
    	(DBGPerspective::on_debugger_asm_signal3): Likewise.
    	(DBGPerspective::record_and_save_session): Likewise.
    	(DBGPerspective::set_breakpoint): Likewise.
    	(DBGPerspective::append_breakpoint): Likewise.
    	(DBGPerspective::apply_decorations_to_source): Likewise.
    	(DBGPerspective::apply_decorations_to_asm): Likewise.

 src/dbgengine/nmv-debugger-utils.cc              |    7 -------
 src/dbgengine/nmv-debugger-utils.h               |    2 --
 src/dbgengine/nmv-gdb-engine.cc                  |   14 ++++++++++++++
 src/dbgengine/nmv-gdb-engine.h                   |    4 ++++
 src/dbgengine/nmv-i-debugger.h                   |    4 ++++
 src/persp/dbgperspective/nmv-breakpoints-view.cc |    2 +-
 src/persp/dbgperspective/nmv-dbg-perspective.cc  |   14 +++++++-------
 7 files changed, 30 insertions(+), 17 deletions(-)
---
diff --git a/src/dbgengine/nmv-debugger-utils.cc b/src/dbgengine/nmv-debugger-utils.cc
index 9d156c3..5970a76 100644
--- a/src/dbgengine/nmv-debugger-utils.cc
+++ b/src/dbgengine/nmv-debugger-utils.cc
@@ -85,12 +85,5 @@ dump_variable_value (IDebugger::VariableSafePtr a_var,
     a_out_str = os.str ();
 }
 
-bool
-is_countpoint (const IDebugger::Breakpoint &a_breakpoint)
-{
-  return (a_breakpoint.type ()
-	  == IDebugger::Breakpoint::COUNTPOINT_TYPE);
-}
-
 NEMIVER_END_NAMESPACE (debugger_utils)
 NEMIVER_END_NAMESPACE (nemiver)
diff --git a/src/dbgengine/nmv-debugger-utils.h b/src/dbgengine/nmv-debugger-utils.h
index dfe6f51..125368c 100644
--- a/src/dbgengine/nmv-debugger-utils.h
+++ b/src/dbgengine/nmv-debugger-utils.h
@@ -41,8 +41,6 @@ void dump_variable_value (IDebugger::VariableSafePtr a_var,
                           int a_indent_num,
                           std::string &a_out_str);
 
-bool is_countpoint (const IDebugger::Breakpoint &);
-
 NEMIVER_END_NAMESPACE (debugger_utils)
 NEMIVER_END_NAMESPACE (nemiver)
 
diff --git a/src/dbgengine/nmv-gdb-engine.cc b/src/dbgengine/nmv-gdb-engine.cc
index fd86838..ad36cb2 100644
--- a/src/dbgengine/nmv-gdb-engine.cc
+++ b/src/dbgengine/nmv-gdb-engine.cc
@@ -3807,6 +3807,20 @@ GDBEngine::enable_countpoint (gint a_break_num,
     command.tag2 (a_break_num);
     queue_command (command);
 }
+
+bool
+GDBEngine::is_countpoint (gint a_bp_num) const
+{
+    Breakpoint bp;
+    if (get_breakpoint_from_cache (a_bp_num, bp))
+        return is_countpoint (bp);
+    return false;
+}
+
+bool
+GDBEngine::is_countpoint (const Breakpoint &a_breakpoint) const
+{
+    return (a_breakpoint.type () == Breakpoint::COUNTPOINT_TYPE);
 }
 
 void
diff --git a/src/dbgengine/nmv-gdb-engine.h b/src/dbgengine/nmv-gdb-engine.h
index f6fc61b..71e10ab 100644
--- a/src/dbgengine/nmv-gdb-engine.h
+++ b/src/dbgengine/nmv-gdb-engine.h
@@ -356,6 +356,10 @@ public:
 			    bool a_flag,
 			    const UString &a_cookie);
 
+    bool is_countpoint (gint a_break_num) const;
+
+    bool is_countpoint (const Breakpoint &a_breakpoint) const;
+
     void delete_breakpoint (const UString &a_path,
                             gint a_line_num,
                             const UString &a_cookie);
diff --git a/src/dbgengine/nmv-i-debugger.h b/src/dbgengine/nmv-i-debugger.h
index da27993..2e254a2 100644
--- a/src/dbgengine/nmv-i-debugger.h
+++ b/src/dbgengine/nmv-i-debugger.h
@@ -1118,6 +1118,10 @@ public:
                                     bool a_flag,
                                     const UString &a_cookie ="") = 0;
 
+    virtual bool is_countpoint (gint a_break_num) const = 0;
+
+    virtual bool is_countpoint (const Breakpoint &a_breakpoint) const = 0;
+
     virtual void delete_breakpoint (const UString &a_path,
                                     gint a_line_num,
                                     const UString &a_cookie="") = 0;
diff --git a/src/persp/dbgperspective/nmv-breakpoints-view.cc b/src/persp/dbgperspective/nmv-breakpoints-view.cc
index 8452fe9..85c55d1 100644
--- a/src/persp/dbgperspective/nmv-breakpoints-view.cc
+++ b/src/persp/dbgperspective/nmv-breakpoints-view.cc
@@ -320,7 +320,7 @@ public:
                                         a_breakpoint.ignore_count ();
         (*a_iter)[get_bp_cols ().is_standard] = false;
         (*a_iter)[get_bp_cols ().is_countpoint] =
-            debugger_utils::is_countpoint (a_breakpoint);
+            debugger->is_countpoint (a_breakpoint);
 
         switch (a_breakpoint.type ()) {
 	case IDebugger::Breakpoint::STANDARD_BREAKPOINT_TYPE:
diff --git a/src/persp/dbgperspective/nmv-dbg-perspective.cc b/src/persp/dbgperspective/nmv-dbg-perspective.cc
index 781fdbd..424cc5c 100644
--- a/src/persp/dbgperspective/nmv-dbg-perspective.cc
+++ b/src/persp/dbgperspective/nmv-dbg-perspective.cc
@@ -2736,7 +2736,7 @@ DBGPerspective::on_debugger_asm_signal3
     switch_to_asm (a_info, a_instrs, a_editor,
                    /*a_approximate_where=*/true);
     append_visual_breakpoint (a_editor, a_bp.address (),
-                              debugger_utils::is_countpoint (a_bp),
+                              debugger ()->is_countpoint (a_bp),
                               a_bp.line ());
 
     NEMIVER_CATCH;
@@ -5185,7 +5185,7 @@ DBGPerspective::record_and_save_session (ISessMgr::Session &a_session)
                                      break_iter->second.enabled (),
                                      break_iter->second.condition (),
                                      break_iter->second.ignore_count (),
-                                     debugger_utils::is_countpoint
+                                     debugger ()->is_countpoint
                                      (break_iter->second));
             a_session.breakpoints ().push_back (bp);
             LOG_DD ("Regular breakpoint scheduled to be stored");
@@ -6440,7 +6440,7 @@ DBGPerspective::set_breakpoint (const IDebugger::Breakpoint &a_breakpoint)
     if (a_breakpoint.type () == IDebugger::Breakpoint::STANDARD_BREAKPOINT_TYPE
         || a_breakpoint.type () == IDebugger::Breakpoint::COUNTPOINT_TYPE) {
         int ignore_count =
-            debugger_utils::is_countpoint (a_breakpoint)
+            debugger ()->is_countpoint (a_breakpoint)
             ? -1
             : a_breakpoint.ignore_count ();
 
@@ -6492,13 +6492,13 @@ DBGPerspective::append_breakpoint (int a_bp_num,
         switch (type) {
             case SourceEditor::BUFFER_TYPE_SOURCE:
                 append_visual_breakpoint (editor, a_breakpoint.line (),
-                                          debugger_utils::is_countpoint
+                                          debugger ()->is_countpoint
                                           (a_breakpoint),
                                           a_breakpoint.enabled ());
                 break;
             case SourceEditor::BUFFER_TYPE_ASSEMBLY:
                 append_visual_breakpoint (editor, a_breakpoint.address (),
-                                          debugger_utils::is_countpoint
+                                          debugger ()->is_countpoint
                                           (a_breakpoint),
                                           a_breakpoint.enabled ());
                 break;
@@ -6807,7 +6807,7 @@ DBGPerspective::apply_decorations_to_source (SourceEditor *a_editor,
         if (a_editor->get_path () == it->second.file_full_name ()) {
             append_visual_breakpoint (a_editor,
                                       it->second.line (),
-                                      debugger_utils::is_countpoint
+                                      debugger ()->is_countpoint
                                       (it->second),
                                       it->second.enabled ());
         }
@@ -6853,7 +6853,7 @@ DBGPerspective::apply_decorations_to_asm (SourceEditor *a_editor,
         if (a_editor->get_path () == it->second.file_full_name ()) {
             Address addr = it->second.address ();
             if (!append_visual_breakpoint (a_editor, addr,
-                                           debugger_utils::is_countpoint
+                                           debugger ()->is_countpoint
                                            (it->second),
                                            it->second.enabled ())) {
                 LOG_DD ("Could'nt find line for address: "



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