Dodji Seketeli | 28 May 2012 23:52

Subject: [PATCH 0/5] Cleanups, enhancements and bug fixes

Hello,

While working on the variable monitoring feature of Nemiver, I made a
certain number of generic cleanups, enhancements and bug fixes to the
code base.  I thought I'd applied them to the master branch and rebase
the 'monitor-variable' on top of this new state of the master branch.

The five patches that come as a follow-up of this message are what
it's all about.

Thanks.

--

-- 
		Dodji
Dodji Seketeli | 28 May 2012 23:55

[PATCH 5/5] Update sub-variables of the one we are looking at

This is a bug fix to our varobjs diff handling utility.  We were
forgetting to apply the varobj diff to the sub-variables of a given
varobj.

Fixed thus, tested an applying to master.

	* src/dbgengine/nmv-dbg-common.cc (VarChange::apply_to_variable):
	Don't forget to apply changes to the sub-variables of the one we
	are looking at.
---
 src/dbgengine/nmv-dbg-common.cc |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/dbgengine/nmv-dbg-common.cc b/src/dbgengine/nmv-dbg-common.cc
index c440a8d..3329d2e 100644
--- a/src/dbgengine/nmv-dbg-common.cc
+++ b/src/dbgengine/nmv-dbg-common.cc
 <at>  <at>  -162,15 +162,13  <at>  <at>  VarChange::apply_to_variable (IDebugger::VariableSafePtr a_var,
     IDebugger::VariableSafePtr v;
     if (*a_var == *variable ()) {
         applied_to = a_var;
-        update_debugger_variable (*applied_to, *variable ());
     } else {
         // variable must be a descendant of a_var.
         v = a_var->get_descendant (variable ()->internal_name ());
         THROW_IF_FAIL (v);
         applied_to = v;
-        if (variable ()->name ().empty () && !v->name ().empty ())
-            variable ()->name (v->name ());
     }
(Continue reading)

Dodji Seketeli | 28 May 2012 23:54

[PATCH 3/5] Add VarInspectorDialog::inspector getter

It turned out to be useful to be able to get the inspector used by the
VarInspectorDialog.

Tested and applying to master.

	* src/persp/dbgperspective/nmv-var-inspector-dialog.h
	(VarInspectorDialog::inspector): Declare new getter.
	* src/persp/dbgperspective/nmv-var-inspector-dialog.cc
	(VarInspectorDialog::inspector): New getter
---
 .../dbgperspective/nmv-var-inspector-dialog.cc     |    8 ++++++++
 .../dbgperspective/nmv-var-inspector-dialog.h      |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/persp/dbgperspective/nmv-var-inspector-dialog.cc b/src/persp/dbgperspective/nmv-var-inspector-dialog.cc
index 6b5856d..fd870aa 100644
--- a/src/persp/dbgperspective/nmv-var-inspector-dialog.cc
+++ b/src/persp/dbgperspective/nmv-var-inspector-dialog.cc
 <at>  <at>  -413,6 +413,14  <at>  <at>  VarInspectorDialog::variable () const
     return m_priv->var_inspector->get_variable ();
 }

+/// Return the variable inspector used by this dialog
+VarInspector& 
+VarInspectorDialog::inspector () const
+{
+    THROW_IF_FAIL (m_priv);
+    return *m_priv->var_inspector;
+}
+
(Continue reading)

Dodji Seketeli | 28 May 2012 23:53

[PATCH 1/5] Style cleanup

This patch is a set of trivial style cleanups in the local variable
inspector widget and in the variable inspector dialog.

Tested and applying to master.

	* src/persp/dbgperspective/nmv-local-vars-inspector.cc
	(LocalVarsInspector::Priv::init_graphical_signals): Add comment.
	* src/persp/dbgperspective/nmv-var-inspector-dialog.cc
	(VarInspectorDialog::inspect_variable): Remove useless assert.
---
 .../dbgperspective/nmv-local-vars-inspector.cc     |    2 ++
 .../dbgperspective/nmv-var-inspector-dialog.cc     |    1 -
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/persp/dbgperspective/nmv-local-vars-inspector.cc b/src/persp/dbgperspective/nmv-local-vars-inspector.cc
index 4167b44..2323774 100644
--- a/src/persp/dbgperspective/nmv-local-vars-inspector.cc
+++ b/src/persp/dbgperspective/nmv-local-vars-inspector.cc
 <at>  <at>  -231,6 +231,8  <at>  <at>  public:
         tree_view->signal_row_activated ().connect
             (sigc::mem_fun (*this,
                             &Priv::on_tree_view_row_activated_signal));
+        // Schedule the button press signal handler to be run before
+        // the default handler.
         tree_view->signal_button_press_event ().connect_notify
             (sigc::mem_fun (this, &Priv::on_button_press_signal));
         tree_view->signal_draw ().connect_notify
diff --git a/src/persp/dbgperspective/nmv-var-inspector-dialog.cc b/src/persp/dbgperspective/nmv-var-inspector-dialog.cc
index e7994e3..5aeda14 100644
--- a/src/persp/dbgperspective/nmv-var-inspector-dialog.cc
(Continue reading)

Dodji Seketeli | 28 May 2012 23:53

[PATCH 2/5] Allow opt-in points when inspecting a variable

It turned out to be very useful to be able to define actions to be
performed whenever the user asks to inspects an expression in the
variable inspector.  This patch basically defines a new
VarInspectorDialog::inspect_variable method that takes a signal
slot (a generalization of a callback function pointer) that is to be
invoked whenever the expression is materialized and evaluated in the
expression inspector dialog.  It also defines new signals that are
emitted by the VarInspector whenever an expression is evaluated and
when it is cleared.

Tested and applying to master.

	* src/persp/dbgperspective/nmv-var-inspector-dialog.h
	(VarInspectorDialog::inspect_variable): Declare new overload.
	* src/persp/dbgperspective/nmv-var-inspector.h
	(VarInspector::inspect_variable): New overload.
	(VarInspector::{var_inspected_signal, cleared_signal}): New methods.
	* src/persp/dbgperspective/nmv-var-inspector-dialog.cc
	(VarInspectorDialog::Priv::do_inspect_variable): Cleanup.
	(VarInspectorDialog::Priv::inspect_variable)
	(VarInspectorDialog::inspect_variable): New overload that takes a
	slot called upon inspection of the expression.  Re-write the
	former overload in terms of the new one.
	(VarInspectorDialog::Priv::on_variable_inspected): New default
	callback invoked upon expression inspection.
	(VarInspectorDialog::Priv::on_variable_inspector_cleared): New default
	callback invoked upon expression inspection.
	(VarInspectorDialog::Priv::build_dialog): Add comment.  Connect
	the new on_variable_inspector_cleared callback to the
	cleared_signal of the inspector.
(Continue reading)

Dodji Seketeli | 28 May 2012 23:55

[PATCH 4/5] Arrange for VarInspectorDialog et al. to be initialized

For better safety, this patch makes various components that are client
of the debugger interface to take a reference to IDebugger (or a naked
pointer), instead of taking a smart pointer to it.  The only thing
that is supposed to hold a smart pointer is the top-most debugging
perspective.  So VarInspectorDialog now stores a reference to
IDebugger.

Tested and applying to master.

	* src/dbgengine/nmv-i-var-list-walker.h
	(IVarListWalker::initialize): Take a naked IDebugger pointer.
	* src/dbgengine/nmv-var-list-walker.cc
	(VarListWalker::initialize): Likewise.
	(VarListWalker::m_debugger): Turn this into a naked pointer.
	(VarListWalker::VarListWalker): Initialize the naked m_debugger
	pointer.
	* nmv-i-var-walker.h (IVarWalker::connect): Likewise.
	(IVarWalker::get_debugger): Return a naked IDebugger pointer.
	* src/dbgengine/nmv-var-walker.cc (VarWalker::m_debugger): Turn
	this into a naked pointer.
	(VarWalker::VarWalker): Initialize it.
	(VarWalker::connect): Take a naked IDebugger pointer and adjust to
	the change.
	(VarWalker::get_debugger): Return a naked pointer.
	* src/dbgengine/nmv-varobj-walker.cc (VarobjWalker::m_debugger):
	Turn this into a naked pointer.
	(VarobjWalker::VarobjWalker): Initialize it.
	(VarobjWalker::connect): Take a naked IDebugger pointer.
	* src/persp/dbgperspective/nmv-dbg-perspective.cc
	(DBGPerspective::get_popup_var_inspector)
(Continue reading)


Gmane