Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <ghost@cs.msu.su>
To: gdb@sources.redhat.com
Subject: RE: -var-update using formatted value
Date: Tue, 15 Jan 2008 18:43:00 -0000	[thread overview]
Message-ID: <fmius3$rv6$1@ger.gmane.org> (raw)
In-Reply-To: <6D19CA8D71C89C43A057926FE0D4ADAA2DE08C@ecamlmw720.eamcs.ericsson.se>

Marc Khouzam wrote:

> 
>> > For example, in your example of strings changing from
>> > natural value: 0x804a018 "GNU" to
>> > natural value: 0x804a018 "GDB"
>> > If the variable object tracking this has its format set to anything
>> > else than natural, the actual string is not printed and the value seems
>> > to stay the same so -var-update will not detect the change in value.
>> 
>> That is deliberate.  I reread your message, and I still can't see a
>> good reason for -var-update to report a changed variable if
>> -var-evaluate-expression is going to continue to display it the same
>> way, i.e. as if no update has occurred.  If you're worried about
>> multiple formats, maybe you should keep a varobj for each instead of
>> switching one around?
> 
> I had assumed var-update to be an indication of when the actual content of
> a variable
> has changed.  Although, truth be told, the documentation is clear that
> var-update will trigger only if -var-evaluate-expression changed (for the
> current format.) And I do see your point for this logic.
> 
> You are right that my issue is with multiple formats and your suggestions
> of different variable objects would work fine.
> However, in my case, where we work with embedded systems and we want to
> minimize the requests to the (potentially very slow) back-end, I was
> hoping to share the same variable
> object and to cache the value of each format.

I don't understand the above. Changing format of a variable object is not
supposed to refetch if from the target, so caching string representation
on frontend side is not necessary.

> This use-case requires a 
> var-update that will indicate if a value has changed in any format, not
> just the current one, so as to know to invalidate the cache.
> But I believe I can achieve this by setting the format to natural before
> every -var-update, which I have to do anyway until the -var-update fix for
> binary numbers and floats (please see other bug description below) is
> available.
> 
> For the sake of completeness, let me just point out that the current
> var-update implementation
> can often show a change when var-evaluate-expression still displays the
> same thing.  This is because the stored 'print_value' is not updated with
> each -var-evaluate-expression request e.g.,
>     int z = 0xb;
> 
>     -var-create - * z   (print value is remembered to be 11)
>     -var-set-format var1 hex
>     -var-evaluate-expression var1 => Oxb
>     -exec-step
>     -var-update var1              => will show var1 to have changed

As I've said before, it's a bug -- -var-set-format should recompute the stored
value. 

In fact, whereas a variable object hold the formatted string, that string
appears to be not used when reporting variable value. -var-evaluate-expression
goes to c_value_of_variable eventually, and that uses value_get_print_value.

I think we need to:

1. Make -var-evaluate-expression directly return stored printed value
2. Make -var-set-format recompute the stored printed value.

Comments?

- Volodya



  reply	other threads:[~2008-01-15 18:43 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-11 15:13 Marc Khouzam
2008-01-11 17:40 ` Vladimir Prus
2008-01-11 18:31   ` Marc Khouzam
2008-01-11 19:40     ` Marc Khouzam
2008-01-11 22:26     ` Nick Roberts
2008-01-11 22:53       ` Andreas Schwab
2008-01-11 22:59         ` Daniel Jacobowitz
2008-01-11 23:40           ` Nick Roberts
2008-01-11 23:52             ` Daniel Jacobowitz
2008-01-12  3:41               ` Marc Khouzam
2008-01-12  3:49                 ` Daniel Jacobowitz
2008-01-14  2:36                   ` Marc Khouzam
2008-01-15 18:43                     ` Vladimir Prus [this message]
2008-01-15 19:36                       ` Marc Khouzam
2008-01-15 20:32                         ` Vladimir Prus
2008-01-17 14:57                           ` Marc Khouzam
2008-01-17 18:05                             ` Vladimir Prus
2008-01-18  1:35                             ` Nick Roberts
2008-01-18 15:31                               ` Marc Khouzam
2008-01-18 15:41                                 ` Daniel Jacobowitz
2008-01-18 17:17                                   ` Marc Khouzam
2008-01-18 17:53                                     ` Daniel Jacobowitz
2008-01-18 19:26                                       ` Marc Khouzam
2008-01-18 21:10                                 ` Nick Roberts
2008-01-18 22:21                                   ` Marc Khouzam
2008-01-19  0:31                                     ` Nick Roberts
2008-01-19  1:46                                       ` Marc Khouzam
2008-01-19  8:27                                         ` Nick Roberts
2008-01-19 11:17                                         ` Vladimir Prus
2008-01-21 15:47                                       ` Marc Khouzam
2008-01-21 21:44                                         ` Nick Roberts
2008-01-17 23:10                           ` Nick Roberts
2008-01-19 11:06                             ` Vladimir Prus
2008-01-19 22:02                               ` Nick Roberts
2008-01-20 10:04                                 ` Vladimir Prus
2008-01-20 20:16                                   ` Nick Roberts
2008-01-20 20:28                                     ` Vladimir Prus
2008-01-21 15:15                                       ` Marc Khouzam
2008-01-21 22:35                                         ` Nick Roberts
2008-01-29 21:20                           ` Daniel Jacobowitz
2008-02-03 22:21                             ` Nick Roberts
2008-02-04  6:15                               ` Vladimir Prus
2008-01-18  0:53                     ` Nick Roberts
2008-01-18  2:13                       ` Marc Khouzam
2008-01-18 21:00                         ` Nick Roberts
2008-01-18 22:04                           ` Marc Khouzam
2008-01-14  6:34               ` Nick Roberts
2008-01-29 21:26                 ` Daniel Jacobowitz
2008-01-29 23:49                   ` Nick Roberts
2008-01-30  0:04                     ` Daniel Jacobowitz
2008-01-30  4:25                       ` 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='fmius3$rv6$1@ger.gmane.org' \
    --to=ghost@cs.msu.su \
    --cc=gdb@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