From: Daniel Jacobowitz <drow@false.org>
To: Vladimir Prus <vladimir@codesourcery.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Ping: frozen variable objects
Date: Tue, 10 Apr 2007 19:03:00 -0000 [thread overview]
Message-ID: <20070410190335.GA22313@caradoc.them.org> (raw)
In-Reply-To: <200703251351.43195.vladimir@codesourcery.com>
On Sun, Mar 25, 2007 at 12:51:42PM +0300, Vladimir Prus wrote:
> --- gdb/doc/gdb.texinfo (/mirrors/gdb_mainline) (revision 3540)
> +++ gdb/doc/gdb.texinfo (/patches/gdb/frozen/gdb_mainline) (revision 3540)
> @@ -19730,6 +19730,8 @@ access this functionality:
> @tab set the value of this variable
> @item @code{-var-update}
> @tab update the variable and its children
> +@item @code{-var-set-frozen}
> +@tab set frozeness attribute
> @end multitable
>
> In the next subsection we describe each operation in detail and suggest
Hmm, that line at the bottom says there's detailed documentation
below. But you didn't add any for -var-set-frozen.
There's also this:
> + if (varobj_get_frozen (var))
> + ui_out_field_int (uiout, "frozen", 1);
Somewhere in the manual should mention how that can happen, and what
it means.
> + mi_check_varobj_value V1.nested.j 2 "check V1.nested.j: 2"
> + mi_check_varobj_value V1.nested.k 3 "check V1.nested.j: 3"
> + # Check that explicit update for elements of structures
> + # works.
> + # Update v1.j
> + mi_varobj_update V1.nested.j {V1.nested.j} "update V1.nested.j"
> + mi_check_varobj_value V1.i 1 "check V1.i: 1"
> + mi_check_varobj_value V1.nested.j 8 "check V1.nested.j: 8"
> + mi_check_varobj_value V1.nested.k 3 "check V1.nested.j: 3"
> + # Update v1.nested, check that children is updated.
> + mi_varobj_update V1.nested {V1.nested.k} "update V1.nested"
> + mi_check_varobj_value V1.i 1 "check V1.i: 1"
> + mi_check_varobj_value V1.nested.j 8 "check V1.nested.j: 8"
> + mi_check_varobj_value V1.nested.k 9 "check V1.nested.j: 9"
You've got a bunch of .j's in the test names that ought to be .k's.
Happens some more below.
> + if (argc != 2)
> + error (_("mi_cmd_var_set_format: Usage: NAME FROZEN_FLAG."));
I think we decided this should be "-var-set-format:" instead of the
function name.
> + /* Is this variable frozen. Frozen variables are never implicitly
> + updated by -var-update * or -var-update <direct-or-indirect-parent>.
> + */
Spaces between sentences, and */ on a line by itself - this is one of
the awkward bits of our formatting standards when the */ doesn't quite
fit on the previous line but I usually just wrap early. I think
emacs's M-q will too.
> @@ -943,10 +974,23 @@ install_new_value (struct varobj *var, s
> /* The new value might be lazy. If the type is changeable,
> that is we'll be comparing values of this type, fetch the
> value now. Otherwise, on the next update the old value
> - will be lazy, which means we've lost that old value. */
> + will be lazy, which means we've lost that old value. */
This added a bunch of trailing whitespace to the line for some reason.
> + if (frozen && initial)
> + {
> + /* For variables that are frozen, or are children of frozen
> + variables, we don't do fetch on initial assignment.
> + For non-initial assignemnt we do the fetch, since it means we're
> + explicitly asked to compare the new value with the old one. */
> + intentionally_not_fetched = 1;
> + }
Does this mean "-var-assign VAR value" is always going to read VAR?
If it's frozen that seems undesirable; maybe we should just assume
it's been updated.
For hardware mapped registers, some of this may not be right: I
noticed that we're saving the installed value, but the hardware could
swizzle it as it is entered. The most common place this happens is
with registers where a bit always reads as zero, no matter what you
write to it. But that's a read-sensitivity problem, not a frozen
varobjs problem.
> -
> - /* Quick comparison of NULL values. */
> - if (var->value == NULL && value == NULL)
> - /* Equal. */
> - ;
> - else if (var->value == NULL || value == NULL)
> + if (var->not_fetched && value_lazy (var->value))
> {
> - xfree (var->print_value);
> - var->print_value = value_get_print_value (value, var->format);
> + /* This is a frozen varobj and the value was never read.
> + Presumably, UI shows some "never read" indicator.
> + Now that we've fetched the real value, we need to report
> + this varobj as changed so that UI can show the real
> + value. */
> changed = 1;
> }
> - else
> + else
> {
You don't actually need to change the nesting here. You can just add
a leading if to the existing if / else if / else. That'd be easier to read.
> if (cvalue && value)
> {
> - *cvalue = value_cast (TYPE_FIELD_TYPE (type, index), value);
> + *cvalue = value_cast (TYPE_FIELD_TYPE (type, index), value);
> }
Random tab damage?
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2007-04-10 19:03 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-25 9:52 Vladimir Prus
2007-03-25 20:17 ` Eli Zaretskii
2007-04-10 19:03 ` Daniel Jacobowitz [this message]
2007-04-11 14:44 ` Vladimir Prus
2007-04-11 14:52 ` Daniel Jacobowitz
2007-04-11 18:38 ` Eli Zaretskii
2007-04-13 9:53 ` Eli Zaretskii
2007-04-14 16:14 ` Vladimir Prus
2007-04-14 16:19 ` Daniel Jacobowitz
2007-04-14 23:18 ` Nick Roberts
2007-04-15 10:32 ` Vladimir Prus
2007-04-15 10:35 ` Vladimir Prus
2007-04-15 11:46 ` Nick Roberts
2007-04-15 11:57 ` Vladimir Prus
2007-04-15 20:09 ` Nick Roberts
2007-04-15 20:16 ` Eli Zaretskii
2007-04-15 20:13 ` Eli Zaretskii
2007-04-14 20:32 ` Eli Zaretskii
2007-04-15 11:42 ` Vladimir Prus
2007-04-15 12:03 ` Nick Roberts
2007-04-16 2:40 ` Eli Zaretskii
2007-04-18 5:38 ` Vladimir Prus
2007-04-18 10:37 ` Nick Roberts
2007-04-18 22:23 ` Eli Zaretskii
2007-04-19 4:41 ` Eli Zaretskii
2007-04-15 20:14 ` Eli Zaretskii
2007-04-15 8:04 ` Nick Roberts
2007-04-18 10:22 ` [patch] fix insight (was: Re: Ping: frozen variable objects) Brian Dessent
2007-04-18 12:51 ` Maciej W. Rozycki
2007-04-18 13:01 ` Brian Dessent
2007-04-18 5:38 ` Ping: frozen variable objects Michael Snyder
2007-04-18 6:57 ` Vladimir Prus
2007-04-18 22:21 ` Michael Snyder
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=20070410190335.GA22313@caradoc.them.org \
--to=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
--cc=vladimir@codesourcery.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