[nemiver/big-stack: 2/3] Allow IDebugger::list_frame to ask for a range of frames



commit 3843954c1bf651cac5a6a132e19411e6fc44dc5c
Author: Dodji Seketeli <dodji redhat com>
Date:   Sun Apr 19 20:59:12 2009 +0200

    Allow IDebugger::list_frame to ask for a range of frames
    
    	* src/dbgengine/nmv-i-debugger.h (IDebugger::list_frame): Add new
    	two new parameters to allow asking for a range of frames,
    	and not necessarily for all of them.
    	* src/dbgengine/nmv-gdb-engine.h (GDBEngine::list_frames): Adjust
    	signature.
    	* src/dbgengine/nmv-gdb-engine.cc (GDBEngine::list_frames): Adjust
    	signature and pass on the right arguments to -stack-list-frames to
    	for a frame window.
---
 src/dbgengine/nmv-gdb-engine.cc |   25 +++++++++++++++++++++++--
 src/dbgengine/nmv-gdb-engine.h  |    4 +++-
 src/dbgengine/nmv-i-debugger.h  |    4 +++-
 3 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/src/dbgengine/nmv-gdb-engine.cc b/src/dbgengine/nmv-gdb-engine.cc
index 81d22c3..0bcb95d 100644
--- a/src/dbgengine/nmv-gdb-engine.cc
+++ b/src/dbgengine/nmv-gdb-engine.cc
@@ -3069,15 +3069,36 @@ GDBEngine::delete_breakpoint (gint a_break_num,
 }
 
 void
-GDBEngine::list_frames (const UString &a_cookie)
+GDBEngine::list_frames (int a_low_frame,
+                        int a_high_frame,
+                        const UString &a_cookie)
 {
     LOG_FUNCTION_SCOPE_NORMAL_DD;
+    string low, high, stack_window, cmd_str;
+
+    if (a_low_frame >= 0)
+        low = UString::from_int (a_low_frame).raw ();
+    if (a_high_frame >= 0)
+        high = UString::from_int (a_high_frame).raw ();
+
+    if (!low.empty () && !high.empty ())
+        stack_window = low + " " + high;
+
+    cmd_str = (stack_window.empty ())
+              ? "-stack-list-frames"
+              : "-stack-list-frames " + stack_window;
+
     queue_command (Command ("list-frames",
-                            "-stack-list-frames",
+                            cmd_str,
                             a_cookie));
 }
 
 void
+GDBEngine::list_frames (int a_min_frame_index,
+                        int a_max_frame_index,
+                        const UString &a_cookie="");
+
+void
 GDBEngine::select_frame (int a_frame_id,
                          const UString &a_cookie)
 {
diff --git a/src/dbgengine/nmv-gdb-engine.h b/src/dbgengine/nmv-gdb-engine.h
index 58f79d5..a1b2cd1 100644
--- a/src/dbgengine/nmv-gdb-engine.h
+++ b/src/dbgengine/nmv-gdb-engine.h
@@ -319,7 +319,9 @@ public:
     void select_frame (int a_frame_id,
                        const UString &a_cookie) ;
 
-    void list_frames (const UString &a_cookie) ;
+    void list_frames (int a_low_frame,
+                      int a_high_frame,
+                      const UString &a_cookie);
 
     void list_frames_arguments (int a_low_frame,
                                 int a_high_frame,
diff --git a/src/dbgengine/nmv-i-debugger.h b/src/dbgengine/nmv-i-debugger.h
index 15a77f9..8b2c19f 100644
--- a/src/dbgengine/nmv-i-debugger.h
+++ b/src/dbgengine/nmv-i-debugger.h
@@ -799,7 +799,9 @@ public:
     virtual void select_frame (int a_frame_id,
                                const UString &a_cookie="") = 0;
 
-    virtual void list_frames (const UString &a_cookie="") = 0;
+    virtual void list_frames (int a_low_frame=-1,
+                              int a_high_frame=-1,
+                              const UString &a_cookie="") = 0;
 
     virtual void list_frames_arguments (int a_low_frame=-1,
                                         int a_high_frame=-1,



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