[nemiver/count-point: 6/14] New IDebugger::get_breakpoint_from_cache API.
- From: Dodji Seketeli <dodji src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nemiver/count-point: 6/14] New IDebugger::get_breakpoint_from_cache API.
- Date: Sun, 10 Oct 2010 16:36:38 +0000 (UTC)
commit c3ca82087d27b11a217a8f40feade0a8ff366636
Author: Dodji Seketeli <dodji seketeli org>
Date: Sat Oct 9 14:10:47 2010 +0200
New IDebugger::get_breakpoint_from_cache API.
* src/dbgengine/nmv-i-debugger.h
(IDebugger::get_breakpoint_from_cache): New API.
* src/dbgengine/nmv-gdb-engine.h
(GDBEngine::get_breakpoint_from_cache): Likewise.
* src/dbgengine/nmv-gdb-engine.cc
(GDBEngine::get_breakpoint_from_cache): Implement the new API.
src/dbgengine/nmv-gdb-engine.cc | 24 ++++++++++++++++--------
src/dbgengine/nmv-gdb-engine.h | 3 +++
src/dbgengine/nmv-i-debugger.h | 4 ++++
3 files changed, 23 insertions(+), 8 deletions(-)
---
diff --git a/src/dbgengine/nmv-gdb-engine.cc b/src/dbgengine/nmv-gdb-engine.cc
index b402cfc..fd86838 100644
--- a/src/dbgengine/nmv-gdb-engine.cc
+++ b/src/dbgengine/nmv-gdb-engine.cc
@@ -3884,14 +3884,22 @@ GDBEngine::get_cached_breakpoints ()
return m_priv->cached_breakpoints;
}
-/// Append a set of breakpoints to our breakpoint cache.
-/// This function supports the countpoint feature. That is, as a
-/// countpoint is a concept not known to GDB, we have to mark an
-/// otherwise normal breakpoint [from GDB's standpoint] as a
-/// countpoint, in our cache. So whenever we see a breakpoint that we
-/// have previously marked as a countpoint in our cache, we make sure
-/// to not loose the countpointness.
-/// \param a_breaks the set of breakpoints to append to the cache.
+bool
+GDBEngine::get_breakpoint_from_cache (int a_num,
+ IDebugger::Breakpoint &a_bp) const
+{
+ typedef map<int, IDebugger::Breakpoint> BPMap;
+ BPMap &bp_cache =
+ const_cast<GDBEngine*> (this)->get_cached_breakpoints ();
+ BPMap::const_iterator nil = bp_cache.end ();
+ BPMap::iterator it;
+
+ if ((it = bp_cache.find (a_num)) == nil)
+ return false;
+ a_bp = it->second;
+ return true;
+}
+
void
GDBEngine::append_breakpoints_to_cache
(const map<int, IDebugger::Breakpoint> &a_breaks)
diff --git a/src/dbgengine/nmv-gdb-engine.h b/src/dbgengine/nmv-gdb-engine.h
index e92ed6d..f6fc61b 100644
--- a/src/dbgengine/nmv-gdb-engine.h
+++ b/src/dbgengine/nmv-gdb-engine.h
@@ -368,6 +368,9 @@ public:
map<int, IDebugger::Breakpoint>& get_cached_breakpoints ();
+ bool get_breakpoint_from_cache (int a_num,
+ IDebugger::Breakpoint &a_bp) const;
+
void set_catch (const UString &a_event,
const UString &a_cookie) ;
diff --git a/src/dbgengine/nmv-i-debugger.h b/src/dbgengine/nmv-i-debugger.h
index 9f49101..da27993 100644
--- a/src/dbgengine/nmv-i-debugger.h
+++ b/src/dbgengine/nmv-i-debugger.h
@@ -1134,6 +1134,10 @@ public:
virtual const map<int, Breakpoint>& get_cached_breakpoints () = 0;
+ virtual bool get_breakpoint_from_cache (int a_num,
+ IDebugger::Breakpoint &a_bp)
+ const = 0;
+
virtual void choose_function_overload (int a_overload_number,
const UString &a_cookie="") = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]