[nemiver/varobjs-support] Unbreak the build with --disable-varobjs
- From: Dodji Seketeli <dodji src gnome org>
- To: svn-commits-list gnome org
- Subject: [nemiver/varobjs-support] Unbreak the build with --disable-varobjs
- Date: Thu, 21 May 2009 16:24:52 -0400 (EDT)
commit 896b295bbd5ba543545748dc464b47f0e48fcbea
Author: Dodji Seketeli <dodji redhat com>
Date: Thu May 21 18:29:08 2009 +0200
Unbreak the build with --disable-varobjs
* src/persp/dbgperspective/nmv-dbg-perspective.cc: Protect use of
features depending on varobjs support with #ifdef WITH_VAROBJS.
* src/persp/dbgperspective/nmv-var-inspector.cc:
(VarInspector::Priv::set_variable): Add a new boolean parameter to control
the expansion of the added variable.
(VarInspector::set_variable): Likewise.
(VarInspector::inspect_variable): Likewise.
---
src/persp/dbgperspective/nmv-dbg-perspective.cc | 10 ++++++++++
src/persp/dbgperspective/nmv-var-inspector.cc | 18 ++++++++++++------
src/persp/dbgperspective/nmv-var-inspector.h | 6 ++++--
3 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/src/persp/dbgperspective/nmv-dbg-perspective.cc b/src/persp/dbgperspective/nmv-dbg-perspective.cc
index 455383e..358d76b 100644
--- a/src/persp/dbgperspective/nmv-dbg-perspective.cc
+++ b/src/persp/dbgperspective/nmv-dbg-perspective.cc
@@ -277,7 +277,9 @@ private:
void on_continue_until_action ();
void on_set_breakpoint_action ();
void on_set_breakpoint_using_dialog_action ();
+#ifdef WITH_VAROBJS
void on_set_watchpoint_using_dialog_action ();
+#endif
void on_refresh_locals_action ();
void on_toggle_breakpoint_action ();
void on_toggle_breakpoint_enabled_action ();
@@ -557,7 +559,9 @@ public:
const int a_line_num);
void set_breakpoint_using_dialog (const UString &a_function_name);
void set_breakpoint_from_dialog (SetBreakpointDialog &a_dialog);
+#ifdef WITH_VAROBJS
void set_watchpoint_using_dialog ();
+#endif
void refresh_locals ();
void inspect_variable ();
@@ -1413,6 +1417,7 @@ DBGPerspective::on_set_breakpoint_using_dialog_action ()
NEMIVER_CATCH
}
+#ifdef WITH_VAROBJS
void
DBGPerspective::on_set_watchpoint_using_dialog_action ()
{
@@ -1424,6 +1429,7 @@ DBGPerspective::on_set_watchpoint_using_dialog_action ()
NEMIVER_CATCH
}
+#endif
void
DBGPerspective::on_refresh_locals_action ()
@@ -2881,6 +2887,7 @@ DBGPerspective::init_actions ()
ActionEntry::DEFAULT,
"<control><shift>B"
},
+#ifdef WITH_VAROBJS
{
"SetWatchPointUsingDialogMenuItemAction",
nil_stock_id,
@@ -2892,6 +2899,7 @@ DBGPerspective::init_actions ()
ActionEntry::DEFAULT,
"<control>T"
},
+#endif
{
"InspectVariableMenuItemAction",
nil_stock_id,
@@ -5878,6 +5886,7 @@ DBGPerspective::set_breakpoint_using_dialog (const UString &a_function_name)
set_breakpoint_from_dialog (dialog);
}
+#ifdef WITH_VAROBJS
void
DBGPerspective::set_watchpoint_using_dialog ()
{
@@ -5898,6 +5907,7 @@ DBGPerspective::set_watchpoint_using_dialog ()
mode & WatchpointDialog::WRITE_MODE,
mode & WatchpointDialog::READ_MODE);
}
+#endif
void
DBGPerspective::refresh_locals ()
diff --git a/src/persp/dbgperspective/nmv-var-inspector.cc b/src/persp/dbgperspective/nmv-var-inspector.cc
index b4e11e6..42a2595 100644
--- a/src/persp/dbgperspective/nmv-var-inspector.cc
+++ b/src/persp/dbgperspective/nmv-var-inspector.cc
@@ -45,6 +45,7 @@ class VarInspector::Priv : public sigc::trackable {
bool requested_variable;
bool requested_type;
+ bool expand_variable;
IDebuggerSafePtr debugger;
IDebugger::VariableSafePtr variable;
VarsTreeViewSafePtr tree_view;
@@ -82,7 +83,8 @@ class VarInspector::Priv : public sigc::trackable {
tree_store->clear ();
}
- void set_variable (const IDebugger::VariableSafePtr &a_variable)
+ void set_variable (const IDebugger::VariableSafePtr &a_variable,
+ bool a_expand)
{
LOG_FUNCTION_SCOPE_NORMAL_DD;
@@ -98,7 +100,7 @@ class VarInspector::Priv : public sigc::trackable {
parent_iter,
var_row);
LOG_DD ("set variable" << a_variable->name ());
- if (var_row) {
+ if (a_expand && var_row) {
tree_view->expand_row (tree_store->get_path (var_row), false);
}
}
@@ -200,7 +202,7 @@ class VarInspector::Priv : public sigc::trackable {
NEMIVER_TRY
- set_variable (a_var);
+ set_variable (a_var, expand_variable);
NEMIVER_CATCH
}
@@ -214,6 +216,7 @@ public:
Priv (IDebuggerSafePtr &a_debugger) :
requested_variable (false),
requested_type (false),
+ expand_variable (false),
debugger (a_debugger)
{
build_widget ();
@@ -241,19 +244,22 @@ VarInspector::widget () const
}
void
-VarInspector::set_variable (IDebugger::VariableSafePtr &a_variable)
+VarInspector::set_variable (IDebugger::VariableSafePtr &a_variable,
+ bool a_expand)
{
THROW_IF_FAIL (m_priv);
- m_priv->set_variable (a_variable);
+ m_priv->set_variable (a_variable, a_expand);
}
void
-VarInspector::inspect_variable (const UString &a_variable_name)
+VarInspector::inspect_variable (const UString &a_variable_name,
+ bool a_expand)
{
if (a_variable_name == "") {return;}
THROW_IF_FAIL (m_priv);
m_priv->requested_variable = true;
+ m_priv->expand_variable = a_expand;
IVarWalkerSafePtr var_walker = m_priv->get_var_walker ();
THROW_IF_FAIL (var_walker);
var_walker->connect (m_priv->debugger, a_variable_name);
diff --git a/src/persp/dbgperspective/nmv-var-inspector.h b/src/persp/dbgperspective/nmv-var-inspector.h
index 82cd243..9a85df5 100644
--- a/src/persp/dbgperspective/nmv-var-inspector.h
+++ b/src/persp/dbgperspective/nmv-var-inspector.h
@@ -50,8 +50,10 @@ public:
VarInspector (IDebuggerSafePtr &a_debugger);
virtual ~VarInspector ();
Gtk::Widget& widget () const;
- void set_variable (IDebugger::VariableSafePtr &a_variable);
- void inspect_variable (const UString &a_variable_name);
+ void set_variable (IDebugger::VariableSafePtr &a_variable,
+ bool a_expand = false);
+ void inspect_variable (const UString &a_variable_name,
+ bool a_expand = false);
IDebugger::VariableSafePtr get_variable () const;
void clear ();
};//end class VarInspector
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]