aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2008-03-26 14:51:28 +0000
committerVladimir Prus <vladimir@codesourcery.com>2008-03-26 14:51:28 +0000
commit5a413362ba31657af57ca223df47809344d2532e (patch)
treed69aed3ff648c23d31ce9141abfcdc47361acb3d /gdb
parentb21c9cb44026744541fb5e8f8ede89c6c2220c6d (diff)
downloadgdb-5a413362ba31657af57ca223df47809344d2532e.zip
gdb-5a413362ba31657af57ca223df47809344d2532e.tar.gz
gdb-5a413362ba31657af57ca223df47809344d2532e.tar.bz2
* varobj.h (varobj_floating_p): Declare.
* varobj.c (varobj_floating_p): New. * mi/mi-cmd-var.c (mi_cmd_var_update): When passed '@' as the name, update all floating varobjs.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/mi/mi-cmd-var.c5
-rw-r--r--gdb/varobj.c9
-rw-r--r--gdb/varobj.h2
4 files changed, 22 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index fe1c56f..a26b5d5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,12 +1,19 @@
2008-03-26 Vladimir Prus <vladimir@codesourcery.com>
+ * varobj.h (varobj_floating_p): Declare.
+ * varobj.c (varobj_floating_p): New.
+ * mi/mi-cmd-var.c (mi_cmd_var_update): When passed
+ '@' as the name, update all floating varobjs.
+
+2008-03-26 Vladimir Prus <vladimir@codesourcery.com>
+
* varobj.c (struct varobj_root): Rename use_selected_frame to
floating, and clarify the meaning.
(varobj_create, varobj_update, new_root_variable): Adjust.
(value_of_root): Don't use type_changed as in variable,
adjust comment.
(c_value_of_root): Adjust.
-
+
2008-03-25 Pedro Alves <pedro@codesourcery.com>
* linux-nat.c (linux_nat_attach): Add the pid we attached to, to
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index dc873ca..301126d 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -558,7 +558,7 @@ mi_cmd_var_update (char *command, char **argv, int argc)
/* Check if the parameter is a "*" which means that we want
to update all variables */
- if ((*name == '*') && (*(name + 1) == '\0'))
+ if ((*name == '*' || *name == '@') && (*(name + 1) == '\0'))
{
nv = varobj_list (&rootlist);
cleanup = make_cleanup (xfree, rootlist);
@@ -574,7 +574,8 @@ mi_cmd_var_update (char *command, char **argv, int argc)
cr = rootlist;
while (*cr != NULL)
{
- varobj_update_one (*cr, print_values, 0 /* implicit */);
+ if (*name == '*' || varobj_floating_p (*cr))
+ varobj_update_one (*cr, print_values, 0 /* implicit */);
cr++;
}
do_cleanups (cleanup);
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 56f3726..3e75507 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -1868,6 +1868,15 @@ varobj_value_is_changeable_p (struct varobj *var)
return r;
}
+/* Return 1 if that varobj is floating, that is is always evaluated in the
+ selected frame, and not bound to thread/frame. Such variable objects
+ are created using '@' as frame specifier to -var-create. */
+int
+varobj_floating_p (struct varobj *var)
+{
+ return var->root->floating;
+}
+
/* Given the value and the type of a variable object,
adjust the value and type to those necessary
for getting children of the variable object.
diff --git a/gdb/varobj.h b/gdb/varobj.h
index 4033b4b..0926d72 100644
--- a/gdb/varobj.h
+++ b/gdb/varobj.h
@@ -124,4 +124,6 @@ extern void varobj_invalidate (void);
extern int varobj_editable_p (struct varobj *var);
+extern int varobj_floating_p (struct varobj *var);
+
#endif /* VAROBJ_H */