From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb-patches@sources.redhat.com
Subject: -var-update @
Date: Wed, 26 Mar 2008 14:54:00 -0000 [thread overview]
Message-ID: <200803261754.10513.vladimir@codesourcery.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 755 bytes --]
I've checked it the attached patch which allows one to issue
-var-update @
and have all @-varobjs (or floating varobjs, as Nick suggested to name them),
updated. I believe this is the only reasonable way to make @ varobjs, which
are not bound to thread/frame/block to adequately work in MT program. Otherwise,
if frontend switches thread or frame and wishes to update floating varobjs,
it should either to "-var-update *", which is extra work, or update varobjs
one-by-one, which is also not very nice.
- Volodya
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.
[-- Attachment #2: commit.diff --]
[-- Type: text/x-diff, Size: 2232 bytes --]
Index: varobj.c
===================================================================
RCS file: /cvs/src/src/gdb/varobj.c,v
retrieving revision 1.107
diff -u -p -r1.107 varobj.c
--- varobj.c 26 Mar 2008 14:11:18 -0000 1.107
+++ varobj.c 26 Mar 2008 14:48:37 -0000
@@ -1868,6 +1868,15 @@ varobj_value_is_changeable_p (struct 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.
Index: varobj.h
===================================================================
RCS file: /cvs/src/src/gdb/varobj.h,v
retrieving revision 1.16
diff -u -p -r1.16 varobj.h
--- varobj.h 24 Mar 2008 17:33:30 -0000 1.16
+++ varobj.h 26 Mar 2008 14:48:37 -0000
@@ -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 */
Index: mi/mi-cmd-var.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-var.c,v
retrieving revision 1.46
diff -u -p -r1.46 mi-cmd-var.c
--- mi/mi-cmd-var.c 24 Mar 2008 17:33:30 -0000 1.46
+++ mi/mi-cmd-var.c 26 Mar 2008 14:48:39 -0000
@@ -558,7 +558,7 @@ mi_cmd_var_update (char *command, char *
/* 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 *
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);
next reply other threads:[~2008-03-26 14:54 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-26 14:54 Vladimir Prus [this message]
2008-03-27 5:17 ` Nick Roberts
2008-03-27 7:00 ` Vladimir Prus
2008-03-27 9:54 ` Nick Roberts
2008-03-27 10:38 ` Vladimir Prus
2008-03-27 13:25 ` Marc Khouzam
2008-03-27 13:37 ` Vladimir Prus
2008-03-27 20:58 ` Nick Roberts
2008-03-28 14:32 ` Marc Khouzam
2008-03-28 16:22 ` Vladimir Prus
2008-03-28 16:33 ` Marc Khouzam
2008-04-01 13:37 ` André Pönitz
2008-04-01 13:56 ` Marc Khouzam
2008-04-01 14:30 ` André Pönitz
2008-04-03 19:10 ` Daniel Jacobowitz
2008-04-03 19:31 ` Daniel Jacobowitz
2008-04-03 20:05 ` Michael Snyder
2008-03-29 5:16 ` Nick Roberts
2008-03-29 6:38 ` Vladimir Prus
2008-03-30 3:54 ` Nick Roberts
2008-04-03 18:55 ` Vladimir Prus
2008-04-03 21:30 ` Nick Roberts
2008-04-04 11:45 ` Vladimir Prus
2008-04-11 22:01 ` Vladimir Prus
2008-04-11 23:22 ` Nick Roberts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200803261754.10513.vladimir@codesourcery.com \
--to=vladimir@codesourcery.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox