[nemiver] 643700 Function arguments are duplicated



commit a5bc1f55497291fecb8bb62802c7b3f7e0fdb8d8
Author: Dodji Seketeli <dodji seketeli org>
Date:   Wed Mar 2 19:10:00 2011 +0100

    643700 Function arguments are duplicated
    
    	* src/dbgengine/nmv-debugger-utils.h (null_frame_vector_slot)
    	(null_frame_args_slot): Declare ...
    	* src/dbgengine/nmv-debugger-utils.cc (null_frame_vector_slot)
    	(null_frame_args_slot): ... these new functions.
    	* src/dbgengine/nmv-i-debugger.h (IDebugger::FrameVectorSlot)
    	(IDebugger::FrameArgsSlot): Declare these new slot typedefs.
    	(IDebugger::list_frames)
    	(IDebugger::list_frames_arguments): Declare these new entry point
    	overloads taking slots.
    	* src/dbgengine/nmv-gdb-engine.h (GDBEngine::list_frames)
    	(GDBEngine::list_frames_arguments): Declare new functions.
    	* src/dbgengine/nmv-gdb-engine.cc
    	(GDBEngine::list_frames, GDBEngine::list_frames_arguments):
    	Support calling back into a slot.
    	(OnFramesListedHandler::do_handle): Invoke the slot passed in
    	parameter of IDebugger::list_frames.
    	(OnFramesParamsListedHandler::do_handle): Invoke the slot passed
    	in parameter of IDebugger::list_frames_arguments.
    	* src/persp/dbgperspective/nmv-call-stack.cc
    	(CallStack::Priv::update_selected_frame): Pass a callback slot to
    	IDebugger::list_frames.
    	(CallStack::Priv::on_frames_listed_during_paging): Renamed
    	on_frames_listed_signal into this.  The former was reacting to
    	IDebugger::frames_listed_signal and was looking into the cookie to
    	decide what to do.  This new version is passed to the
    	IDebugger::list_frames call directly we don't need to look into
    	any cookie anymore.  Also we know that we are now called during
    	frame paging, so we just have to react to that context.
    	(CallStack::Priv::on_frames_listed): Splitted out of the former
    	on_frames_listed_signal.  Like for the function above, we don't
    	need to look into any cookie anymore, as this function is passed
    	as a callback to a precise invocation of IDebugger::list_frames.
    	We just have to react to contexts where we are not dealing with
    	frames paging.  Pass &Priv::on_frames_args_listed to the
    	invocation of IDebugger::list_frames_arguments.
    	(CallStack::Priv::on_frames_args_listed): Renamed
    	on_frames_params_listed_signal into this.  This doesn't react to
    	IDebugger::frames_arguments_listed_signal anymore.  Rather, it is
    	passed as a callback slot to a precise invocation of
    	IDebugger::list_frames_arguments.
    	(CallStack::Priv::connect_debugger_signals): Do not react anymore to
    	IDebugger::frames_listed_signal and
    	IDebugger::frames_arguments_listed_signal.
    	(CallStack::Priv::update_call_stack): Pass Priv::on_frames_listed
    	as callback slot to the IDebugger::list_frames invocation.
    	* src/persp/dbgperspective/nmv-local-vars-inspector.cc
    	(LocalVarsInspector::Priv::connect_to_debugger_signals): Don't
    	connect anymore to IDebugger::frames_arguments_listed_signals.
    	(LocalVarsInspector::Priv::on_function_args_listed): Renamed
    	LocalVarsInspector::Priv::on_function_args_listed_signal into
    	this.  No need to look into any cookie anymore.
    	(LocalVarsInspector::Priv::finish_handling_debugger_stopped_event):
    	Pass &Priv::on_function_args_listed slot as callback to the
    	IDebugger::list_frames_arguments invocation.
    	(LocalVarsInspector::show_local_variables_of_current_function):
    	Likewise.

 src/dbgengine/nmv-debugger-utils.cc                |   10 +
 src/dbgengine/nmv-debugger-utils.h                 |    4 +
 src/dbgengine/nmv-gdb-engine.cc                    |  177 ++++++++++++++++++--
 src/dbgengine/nmv-gdb-engine.h                     |   10 +
 src/dbgengine/nmv-i-debugger.h                     |   21 ++-
 src/persp/dbgperspective/nmv-call-stack.cc         |   83 ++++++----
 .../dbgperspective/nmv-local-vars-inspector.cc     |   30 ++--
 7 files changed, 279 insertions(+), 56 deletions(-)
---
diff --git a/src/dbgengine/nmv-debugger-utils.cc b/src/dbgengine/nmv-debugger-utils.cc
index 9842fff..d036060 100644
--- a/src/dbgengine/nmv-debugger-utils.cc
+++ b/src/dbgengine/nmv-debugger-utils.cc
@@ -44,6 +44,16 @@ null_const_ustring_slot (const UString &)
 {
 }
 
+void
+null_frame_vector_slot (const vector<IDebugger::Frame> &)
+{
+}
+
+void
+null_frame_args_slot (const map<int, IDebugger::VariableList> &)
+{
+}
+
 /// Generate a string of of white spaces.
 /// \param a_nb_ws the number of white spaces to generate
 /// \param a_ws_str the output string the white spaces are
diff --git a/src/dbgengine/nmv-debugger-utils.h b/src/dbgengine/nmv-debugger-utils.h
index caa7ada..2ab7814 100644
--- a/src/dbgengine/nmv-debugger-utils.h
+++ b/src/dbgengine/nmv-debugger-utils.h
@@ -38,6 +38,10 @@ void null_const_variable_list_slot (const IDebugger::VariableList &);
 
 void null_const_ustring_slot (const UString &);
 
+void null_frame_vector_slot (const vector<IDebugger::Frame> &);
+
+void null_frame_args_slot (const map<int, IDebugger::VariableList> &);
+
 void dump_variable_value (IDebugger::VariableSafePtr a_var,
                           int a_indent_num,
                           std::ostringstream &a_os,
diff --git a/src/dbgengine/nmv-gdb-engine.cc b/src/dbgengine/nmv-gdb-engine.cc
index 7df7866..09dfdd3 100644
--- a/src/dbgengine/nmv-gdb-engine.cc
+++ b/src/dbgengine/nmv-gdb-engine.cc
@@ -55,7 +55,8 @@ static const UString DEFAULT_GDB_BINARY = "default-gdb-binary";
 
 using nemiver::debugger_utils::null_const_variable_slot;
 using nemiver::debugger_utils::null_const_variable_list_slot;
-
+using nemiver::debugger_utils::null_frame_vector_slot;
+using nemiver::debugger_utils::null_frame_args_slot;
 
 NEMIVER_BEGIN_NAMESPACE (nemiver)
 
@@ -785,11 +786,52 @@ public:
                                         follow_fork_mode);
     }
 
+    /// Lists the frames which numbers are in a given range.
+    ///
+    /// Upon completion of the GDB side of this command, the signal
+    /// Priv::frames_listed_signal is emitted.
+    ///
+    /// \param a_low_frame the lower bound of the frame range to list.
+    ///
+    /// \param a_high_frame the upper bound of the frame range to list.
+    ///
+    /// \param a_cookie a string to be passed to the
+    /// Priv::frames_listed_signal.
     void list_frames (int a_low_frame,
                       int a_high_frame,
                       const UString &a_cookie)
     {
         LOG_FUNCTION_SCOPE_NORMAL_DD;
+
+        list_frames (a_low_frame, a_high_frame,
+                     &null_frame_vector_slot,
+                     a_cookie);
+    }
+
+    /// A subroutine of the list_frame overload above.
+    /// 
+    /// Lists the frames which numbers are in a given range.
+    ///
+    /// Upon completion of the GDB side of this command, the signal
+    /// Priv::frames_listed_signal is emitted.  The callback slot
+    /// given in parameter is called as well.
+    ///
+    /// \param a_low_frame the lower bound of the frame range to list.
+    ///
+    /// \param a_high_frame the upper bound of the frame range to list.
+    ///
+    /// \param a_slot a callback slot to be called upon completion of
+    /// the GDB-side command.
+    ///
+    /// \param a_cookie a string to be passed to the
+    /// Priv::frames_listed_signal.
+    void list_frames (int a_low_frame,
+                      int a_high_frame,
+                      const FrameVectorSlot &a_slot,
+                      const UString &a_cookie)
+    {
+        LOG_FUNCTION_SCOPE_NORMAL_DD;
+
         string low, high, stack_window, cmd_str;
 
         if (a_low_frame >= 0)
@@ -803,10 +845,10 @@ public:
         cmd_str = (stack_window.empty ())
                   ? "-stack-list-frames"
                   : "-stack-list-frames " + stack_window;
-
-        queue_command (Command ("list-frames",
-                                cmd_str,
-                                a_cookie));
+        
+        Command command ("list-frames", cmd_str, a_cookie);
+        command.set_slot (a_slot);
+        queue_command (command);
     }
 
     void set_tty_path (const UString &a_tty_path)
@@ -1656,9 +1698,17 @@ struct OnFramesListedHandler : OutputHandler {
             m_engine->set_current_frame_address
             (a_in.output ().result_record ().call_stack ()[0].address ());
 
-        m_engine->frames_listed_signal ().emit
-            (a_in.output ().result_record ().call_stack (),
-             a_in.command ().cookie ());
+        vector<IDebugger::Frame> &frames =
+            a_in.output ().result_record ().call_stack ();
+
+        if (a_in.command ().has_slot ()) {
+            IDebugger::FrameVectorSlot slot =
+                a_in.command ().get_slot<IDebugger::FrameVectorSlot> ();
+            slot (frames);
+        }
+
+        m_engine->frames_listed_signal ().emit (frames,
+                                                a_in.command ().cookie ());
         m_engine->set_state (IDebugger::READY);
     }
 };//struct OnFramesListedHandler
@@ -1687,6 +1737,16 @@ struct OnFramesParamsListedHandler : OutputHandler {
     {
         LOG_FUNCTION_SCOPE_NORMAL_DD;
 
+        
+        const map<int, list<IDebugger::VariableSafePtr> > &frame_args =
+            a_in.output ().result_record ().frames_parameters ();
+
+        if (a_in.command ().has_slot ()) {
+            IDebugger::FrameArgsSlot slot =
+                a_in.command ().get_slot<IDebugger::FrameArgsSlot> ();
+            slot (frame_args);
+        }
+
         m_engine->frames_arguments_listed_signal ().emit
             (a_in.output ().result_record ().frames_parameters (),
              a_in.command ().cookie ());
@@ -4112,6 +4172,21 @@ GDBEngine::delete_breakpoint (gint a_break_num,
                             a_cookie));
 }
 
+/// Lists the frames which numbers are in a given range.
+///
+/// Upon completion of the GDB side of this command, the signal
+/// Priv::frames_listed_signal is emitted.  The callback slot
+/// given in parameter is called as well.
+///
+/// \param a_low_frame the lower bound of the frame range to list.
+///
+/// \param a_high_frame the upper bound of the frame range to list.
+///
+/// \param a_slot a callback slot to be called upon completion of
+/// the GDB-side command.
+///
+/// \param a_cookie a string to be passed to the
+/// Priv::frames_listed_signal. 
 void
 GDBEngine::list_frames (int a_low_frame,
                         int a_high_frame,
@@ -4122,10 +4197,36 @@ GDBEngine::list_frames (int a_low_frame,
     m_priv->list_frames (a_low_frame, a_high_frame, a_cookie);
 }
 
+/// A subroutine of the list_frame overload above.
+/// 
+/// Lists the frames which numbers are in a given range.
+///
+/// Upon completion of the GDB side of this command, the signal
+/// Priv::frames_listed_signal is emitted.  The callback slot
+/// given in parameter is called as well.
+///
+/// \param a_low_frame the lower bound of the frame range to list.
+///
+/// \param a_high_frame the upper bound of the frame range to list.
+///
+/// \param a_slot a callback slot to be called upon completion of
+/// the GDB-side command.
+///
+/// \param a_cookie a string to be passed to the
+/// Priv::frames_listed_signal. 
 void
-GDBEngine::list_frames (int a_min_frame_index,
-                        int a_max_frame_index,
-                        const UString &a_cookie = "");
+GDBEngine::list_frames (int a_low_frame,
+                        int a_high_frame,
+                        const FrameVectorSlot &a_slot,
+                        const UString &a_cookie)
+
+{
+    LOG_FUNCTION_SCOPE_NORMAL_DD;
+
+    m_priv->list_frames (a_low_frame,
+                         a_high_frame,
+                         a_slot, a_cookie);
+}
 
 void
 GDBEngine::select_frame (int a_frame_id,
@@ -4141,17 +4242,68 @@ GDBEngine::select_frame (int a_frame_id,
 
 }
 
+/// List the arguments of the frames which numbers are in a given
+/// range.
+///
+/// Upon completion of the GDB-side of this command the signal
+/// GDBEngine::frames_arguments_listed_signal is emitted.
+/// 
+/// \param a_low_frame the lower bound of the range of frames which
+/// arguments to list.
+///
+/// \param a_high_frame the uper bound of the range of frames which
+/// arguments to list.
+///
+/// \param a_cookie a string to be passed to the
+/// GDBEngine::frames_arguments_listed_signal signal.
 void
 GDBEngine::list_frames_arguments (int a_low_frame,
                                   int a_high_frame,
                                   const UString &a_cookie)
 {
     LOG_FUNCTION_SCOPE_NORMAL_DD;
+    list_frames_arguments (a_low_frame, a_high_frame,
+                           &null_frame_args_slot, a_cookie);
+}
+
+/// List the arguments of the frames which numbers are in a given
+/// range.
+///
+/// Upon completion of the GDB-side command emitted by this function
+/// the signal GDBEngine::frames_arguments_listed_signal is emitted.
+/// In addition, a callback slot passed in parameter of this function
+/// is invoked upon completion.
+/// 
+/// \param a_low_frame the lower bound of the range of frames which
+/// arguments to list.
+///
+/// \param a_high_frame the uper bound of the range of frames which
+/// arguments to list.
+///
+/// \param a_slot a callback slot called upon completion of the
+/// GDB-side command emitted by this function.
+///
+/// \param a_cookie a string to be passed to the
+/// GDBEngine::frames_arguments_listed_signal signal.
+void
+GDBEngine::list_frames_arguments (int a_low_frame,
+                                  int a_high_frame,
+                                  const FrameArgsSlot &a_slot,
+                                  const UString &a_cookie)
+{
+    UString cmd_str;
+
     if (a_low_frame < 0 || a_high_frame < 0) {
+        cmd_str = "-stack-list-arguments 1";
         queue_command (Command ("list-frames-arguments",
                                 "-stack-list-arguments 1",
                                 a_cookie));
     } else {
+        cmd_str = UString ("-stack-list-arguments 1 ")
+            + UString::from_int (a_low_frame)
+            + " "
+            + UString::from_int (a_high_frame);
+
         queue_command (Command ("list-frames-arguments",
                                 "-stack-list-arguments 1 "
                                     + UString::from_int (a_low_frame)
@@ -4159,6 +4311,9 @@ GDBEngine::list_frames_arguments (int a_low_frame,
                                     + UString::from_int (a_high_frame),
                                     a_cookie));
     }
+    Command command ("list-frames-arguments", cmd_str, a_cookie);
+    command.set_slot (a_slot);
+    queue_command (command);
 }
 
 void
diff --git a/src/dbgengine/nmv-gdb-engine.h b/src/dbgengine/nmv-gdb-engine.h
index fd986b8..7f95fe6 100644
--- a/src/dbgengine/nmv-gdb-engine.h
+++ b/src/dbgengine/nmv-gdb-engine.h
@@ -406,10 +406,20 @@ public:
                       int a_high_frame,
                       const UString &a_cookie);
 
+    void list_frames (int a_low_frame,
+		      int a_high_frame,
+		      const FrameVectorSlot &a_slot,
+		      const UString &a_cookie);
+
     void list_frames_arguments (int a_low_frame,
                                 int a_high_frame,
                                 const UString &a_cookie);
 
+    void list_frames_arguments (int a_low_frame,
+				int a_high_frame,
+				const FrameArgsSlot &a_slot,
+				const UString &a_cookie);
+
     void list_local_variables (const UString &a_cookie);
 
     void list_global_variables ( const UString &a_cookie );
diff --git a/src/dbgengine/nmv-i-debugger.h b/src/dbgengine/nmv-i-debugger.h
index 9c869ff..978f5e8 100644
--- a/src/dbgengine/nmv-i-debugger.h
+++ b/src/dbgengine/nmv-i-debugger.h
@@ -256,6 +256,10 @@ public:
         void line_number (int a_in) {m_line_number = a_in;}
     };//end class OverloadsChoiceEntry
 
+    class Variable;
+    typedef SafePtr<Variable, ObjectRef, ObjectUnref> VariableSafePtr;
+    typedef list<VariableSafePtr> VariableList;
+
     /// \brief a function frame as seen by the debugger.
     class Frame {
         Address m_address;
@@ -334,10 +338,11 @@ public:
             m_args.clear ();
         }
     };//end class Frame
+    typedef sigc::slot<void, const vector<IDebugger::Frame>&>
+        FrameVectorSlot;
+    typedef sigc::slot<void, const map<int, IDebugger::VariableList>& >
+        FrameArgsSlot;
 
-    class Variable;
-    typedef SafePtr<Variable, ObjectRef, ObjectUnref> VariableSafePtr;
-    typedef list<VariableSafePtr> VariableList;
     class Variable : public Object {
         // non copyable.
         Variable (const Variable &);
@@ -1177,10 +1182,20 @@ public:
                               int a_high_frame=-1,
                               const UString &a_cookie="") = 0;
 
+    virtual void list_frames (int a_low_frame,
+                              int a_high_frame,
+                              const FrameVectorSlot &a_slot,
+                              const UString &a_cookie) = 0;
+
     virtual void list_frames_arguments (int a_low_frame=-1,
                                         int a_high_frame=-1,
                                         const UString &a_cookie="") = 0;
 
+    virtual void list_frames_arguments (int a_low_frame,
+                                        int a_high_frame,
+                                        const FrameArgsSlot &a_slot,
+                                        const UString &a_cookie) = 0;
+
     virtual void list_local_variables (const UString &a_cookie="") = 0;
 
     virtual void list_global_variables (const UString &a_cookie="") = 0;
diff --git a/src/persp/dbgperspective/nmv-call-stack.cc b/src/persp/dbgperspective/nmv-call-stack.cc
index bbe001f..9a8976e 100644
--- a/src/persp/dbgperspective/nmv-call-stack.cc
+++ b/src/persp/dbgperspective/nmv-call-stack.cc
@@ -234,7 +234,9 @@ struct CallStack::Priv {
             frame_low = frame_high + 1;
             frame_high += nb_frames_expansion_chunk;
             debugger->list_frames (frame_low, frame_high,
-                                   COOKIE_CALL_STACK_IN_FRAME_PAGING_TRANS);
+                                   sigc::mem_fun
+                                   (*this, &Priv::on_frames_listed_during_paging),
+                                   "");
             return;
         }
 
@@ -302,45 +304,64 @@ struct CallStack::Priv {
         handle_update (a_cookie);
     }
 
-    void on_frames_listed_signal (const vector<IDebugger::Frame> &a_stack,
-                                  const UString &a_cookie)
+    void
+    on_frames_listed_during_paging (const vector<IDebugger::Frame> &a_stack)
     {
         LOG_FUNCTION_SCOPE_NORMAL_DD;
 
-        NEMIVER_TRY
+        NEMIVER_TRY;
+
+        // We are in a mode where the user asked to see more stack
+        // frames.  This is named frame paging. In this case, just
+        // append the frames to the current ones. Again, the frames
+        // will be appended without arguments. We'll request the
+        // arguments right after this.
+        FrameArgsMap frames_args;
+        append_frames_to_tree_view (a_stack, frames_args);
+
+        // Okay so now, ask for frame arguments matching the frames we
+        // just received.
+        debugger->list_frames_arguments (a_stack[0].level (),
+                                         a_stack[a_stack.size () - 1].level (),
+                                         sigc::mem_fun
+                                         (*this, &Priv::on_frames_args_listed),
+                                         "");
+
+        NEMIVER_CATCH;
+    }
+
+    void
+    on_frames_listed (const vector<IDebugger::Frame> &a_stack)
+    {
+        LOG_FUNCTION_SCOPE_NORMAL_DD;
+
+        NEMIVER_TRY;
 
         THROW_IF_FAIL (debugger);
         waiting_for_stack_args = true;
 
         FrameArgsMap frames_args;
-        if (a_cookie.raw () != COOKIE_CALL_STACK_IN_FRAME_PAGING_TRANS) {
-            // Set the frame list without frame arguments,
-            // then, request IDebugger for frame arguments.
-            // When the arguments arrive, we will update the call stack
-            // with those.
-            set_frame_list (a_stack, frames_args);
-        } else {
-            // We are a mode where the user asked to see more stack frames.
-            // This is named frame paging. In this case, just append the
-            // frames to the current ones. Again, the frames will be
-            // appended without arguments. We'll request the arguments
-            // right after this.
-            append_frames_to_tree_view (a_stack, frames_args);
-        }
-        // Okay so now, ask for frame arguments matching the frames we just
-        // received.
+        // Set the frame list without frame arguments, then, request
+        // IDebugger for frame arguments.  When the arguments arrive,
+        // we will update the call stack with those.
+        set_frame_list (a_stack, frames_args);
+
+        // Okay so now, ask for frame arguments matching the frames we
+        // just received.
         debugger->list_frames_arguments (a_stack[0].level (),
-                                         a_stack[a_stack.size () - 1].level ());
+                                         a_stack[a_stack.size () - 1].level (),
+                                         sigc::mem_fun
+                                         (*this, &Priv::on_frames_args_listed),
+                                         "");
 
-        NEMIVER_CATCH
+        NEMIVER_CATCH;
     }
 
-    void on_frames_params_listed_signal
-            (const map<int, list<IDebugger::VariableSafePtr> > &a_frames_args,
-             const UString &a_cookie)
+    void
+    on_frames_args_listed
+    (const map<int, IDebugger::VariableList> &a_frames_args)
     {
         LOG_DD ("frames params listed");
-        if (a_cookie.empty ()) {}
 
         if (waiting_for_stack_args) {
             update_frames_arguments (a_frames_args);
@@ -426,6 +447,8 @@ struct CallStack::Priv {
         }
     }
 
+    /// Connect callback slots to the relevant signals of our
+    /// implementation of the IDebugger interface.
     void connect_debugger_signals ()
     {
         LOG_FUNCTION_SCOPE_NORMAL_DD;
@@ -436,10 +459,6 @@ struct CallStack::Priv {
                     (*this, &CallStack::Priv::on_debugger_stopped_signal));
         debugger->thread_selected_signal ().connect (sigc::mem_fun
                      (*this, &CallStack::Priv::on_thread_selected_signal));
-        debugger->frames_listed_signal ().connect (sigc::mem_fun
-                    (*this, &CallStack::Priv::on_frames_listed_signal));
-        debugger->frames_arguments_listed_signal ().connect (sigc::mem_fun
-                    (*this, &CallStack::Priv::on_frames_params_listed_signal));
         debugger->command_done_signal ().connect (sigc::mem_fun
                     (*this, &CallStack::Priv::on_command_done_signal));
     }
@@ -784,7 +803,9 @@ struct CallStack::Priv {
     void update_call_stack ()
     {
         THROW_IF_FAIL (debugger);
-        debugger->list_frames (0, frame_high);
+        debugger->list_frames (0, frame_high,
+                               sigc::mem_fun (*this, &Priv::on_frames_listed),
+                               "");
     }
 };//end struct CallStack::Priv
 
diff --git a/src/persp/dbgperspective/nmv-local-vars-inspector.cc b/src/persp/dbgperspective/nmv-local-vars-inspector.cc
index 1fba95b..9d372a5 100644
--- a/src/persp/dbgperspective/nmv-local-vars-inspector.cc
+++ b/src/persp/dbgperspective/nmv-local-vars-inspector.cc
@@ -185,6 +185,8 @@ public:
         return true;
     }
 
+    /// Connect callback slots to the relevant signals of the
+    /// debugging engine.k
     void
     connect_to_debugger_signals ()
     {
@@ -195,8 +197,6 @@ public:
             (sigc::mem_fun (*this, &Priv::on_stopped_signal));
         debugger->local_variables_listed_signal ().connect
             (sigc::mem_fun (*this, &Priv::on_local_variables_listed_signal));
-        debugger->frames_arguments_listed_signal ().connect
-            (sigc::mem_fun (*this, &Priv::on_function_args_listed_signal));
     }
 
     void
@@ -454,7 +454,10 @@ public:
             debugger->list_local_variables ();
             LOG_DD ("list frames arguments");
             debugger->list_frames_arguments (a_frame.level (),
-                                             a_frame.level ());
+                                             a_frame.level (),
+                                             sigc::mem_fun
+                                             (*this, &Priv::on_function_args_listed),
+                                             "");
         } else {
             LOG_DD ("update local variables and function arguments");
             update_local_variables ();
@@ -793,18 +796,16 @@ public:
     }
 
     void
-    on_function_args_listed_signal
-        (const map<int, IDebugger::VariableList> &a_frames_params,
-         const UString & /* a_cookie */)
+    on_function_args_listed (const map<int, IDebugger::VariableList> &a_args)
     {
         LOG_FUNCTION_SCOPE_NORMAL_DD;
 
-        NEMIVER_TRY
+        NEMIVER_TRY;
 
         UString name;
         map<int, IDebugger::VariableList>::const_iterator frame_it;
-        frame_it = a_frames_params.find (debugger->get_current_frame_level ());
-        if (frame_it == a_frames_params.end ()) {
+        frame_it = a_args.find (debugger->get_current_frame_level ());
+        if (frame_it == a_args.end ()) {
             LOG_DD ("Got empty frames parameters");
             return;
         }
@@ -822,7 +823,7 @@ public:
                  sigc::mem_fun (*this,
                                 &Priv::on_function_arg_var_created_signal));
         }
-        NEMIVER_CATCH
+        NEMIVER_CATCH;
     }
 
     void
@@ -1130,6 +1131,10 @@ LocalVarsInspector::widget () const
     return *m_priv->tree_view;
 }
 
+/// List the local variables of the current function, as well as its
+/// arguments.
+///
+/// \param a_frame the frame of the current function to act upon.
 void
 LocalVarsInspector::show_local_variables_of_current_function
                                             (const IDebugger::Frame &a_frame)
@@ -1144,7 +1149,10 @@ LocalVarsInspector::show_local_variables_of_current_function
     m_priv->debugger->list_local_variables ();
     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);
+    m_priv->debugger->list_frames_arguments (frame_level, frame_level,
+                                             sigc::mem_fun
+                                             (*m_priv, &Priv::on_function_args_listed),
+                                             "");
 }
 
 void



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