[nemiver/varobjs-support: 8/8] Make LocalVarsInspector2 properly show selected frame's arguments



commit 00a960a8b14ac92a81748af5b26fff2c90168ef8
Author: Dodji Seketeli <dodji redhat com>
Date:   Fri May 1 19:23:29 2009 +0200

    Make LocalVarsInspector2 properly show selected frame's arguments
    
    	* src/persp/dbgperspective/nmv-local-vars-inspector2.cc:
    	(LocalVarsInspector2::Priv::finish_handling_debugger_stopped_event):
    	Remember the current frame. List the frame arguments of the current
    	frame, not of the frame which index is 0.
    	(LocalVarsInspector2::show_local_variables_of_current_function):
    	Make this accept a frame in parameter. This is the frame
    	the function needs to fetch the arguments for. It's not clean to do
    	this but we have no easy way to fetch the arguments of the "current"
    	function, unfortunately.
---
 .../dbgperspective/nmv-local-vars-inspector2.cc    |   46 ++++++++++++-------
 .../dbgperspective/nmv-local-vars-inspector2.h     |    3 +-
 2 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/src/persp/dbgperspective/nmv-local-vars-inspector2.cc b/src/persp/dbgperspective/nmv-local-vars-inspector2.cc
index 34febc5..a4e46d8 100644
--- a/src/persp/dbgperspective/nmv-local-vars-inspector2.cc
+++ b/src/persp/dbgperspective/nmv-local-vars-inspector2.cc
@@ -349,27 +349,34 @@ public:
     void
     finish_handling_debugger_stopped_event
                                     (IDebugger::StopReason /*a_reason*/,
-                                     bool /*a_has_frame*/,
+                                     bool a_has_frame,
                                      const IDebugger::Frame &a_frame)
     {
         LOG_FUNCTION_SCOPE_NORMAL_DD;
 
         NEMIVER_TRY
 
-            THROW_IF_FAIL (tree_store);
-            if (is_new_frame) {
-                LOG_DD ("init tree view");
-                re_init_tree_view ();
-                LOG_DD ("list local variables");
-                debugger->list_local_variables ();
-                LOG_DD ("list frames arguments");
-                debugger->list_frames_arguments (0, 0);
-            } else {
-                LOG_DD ("update local variables and function arguments");
-                update_local_variables ();
-                update_function_arguments ();
-            }
-            previous_function_name = a_frame.function_name ();
+        THROW_IF_FAIL (tree_store);
+
+        if (!a_has_frame)
+            return;
+
+        saved_frame = a_frame;
+
+        if (is_new_frame) {
+            LOG_DD ("init tree view");
+            re_init_tree_view ();
+            LOG_DD ("list local variables");
+            debugger->list_local_variables ();
+            LOG_DD ("list frames arguments");
+            debugger->list_frames_arguments (a_frame.level (),
+                                             a_frame.level ());
+        } else {
+            LOG_DD ("update local variables and function arguments");
+            update_local_variables ();
+            update_function_arguments ();
+        }
+        previous_function_name = a_frame.function_name ();
 
         NEMIVER_CATCH
     }
@@ -777,15 +784,20 @@ LocalVarsInspector2::widget () const
 }
 
 void
-LocalVarsInspector2::show_local_variables_of_current_function ()
+LocalVarsInspector2::show_local_variables_of_current_function
+                                            (const IDebugger::Frame &a_frame)
 {
     LOG_FUNCTION_SCOPE_NORMAL_DD;
     THROW_IF_FAIL (m_priv);
     THROW_IF_FAIL (m_priv->debugger);
 
+    m_priv->saved_frame = a_frame;
+
     re_init_widget ();
     m_priv->debugger->list_local_variables ();
-    m_priv->debugger->list_frames_arguments (0, 0);
+    int frame_level = m_priv->debugger->get_current_frame_level ();
+    LOG_DD ("current frame level: " <<  (int)frame_level);
+    m_priv->debugger->list_frames_arguments (frame_level, frame_level);
 }
 
 void
diff --git a/src/persp/dbgperspective/nmv-local-vars-inspector2.h b/src/persp/dbgperspective/nmv-local-vars-inspector2.h
index c3fbb15..d871514 100644
--- a/src/persp/dbgperspective/nmv-local-vars-inspector2.h
+++ b/src/persp/dbgperspective/nmv-local-vars-inspector2.h
@@ -61,7 +61,8 @@ public:
     Gtk::Widget& widget () const;
     void set_local_variables
                     (const std::list<IDebugger::VariableSafePtr> &a_vars);
-    void show_local_variables_of_current_function ();
+    void show_local_variables_of_current_function
+                                        (const IDebugger::Frame &a_frame);
     void re_init_widget ();
 };//end LocalVarsInspector2
 



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