Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Marc Khouzam" <marc.khouzam@ericsson.com>
To: <gdb@sourceware.org>
Subject: RE: -var-update using formatted value
Date: Fri, 18 Jan 2008 15:31:00 -0000	[thread overview]
Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA2DE096@ecamlmw720.eamcs.ericsson.se> (raw)
In-Reply-To: <18320.559.863596.871051@kahikatea.snap.net.nz>


Answering two mails:

Vladimir wrote:

> 1. Generally, it's best to run gdb on the same system where you run IDE,
> and have it talk to remote stub on the target system. 

You make a good point.
I had started to blur the concept of GDB and target and I didn't pay
attention to this anymore.  Thanks for reminding me.

> 2. Even if you run gdb on target, changing varobj format is very fast,
> so I'm not sure caching formats is an important thing to do. Did you
> actually run into a case where the performance of changing format is
> unacceptable?

No actual measurements.
However, and I'm sorry for not letting this go, but what is the point of 
-var-update returning the list of changed variables, if it is so efficient
to go back to GDB to ask for values?  var-update might as well return nothing
and the let the front-end ask for values again.
(which is what I'll have to do if I can't cache all formats)

I thought var-update told the front-end which variables changed and more
importantly, which variables did -not- change, specifically so that the
front-end would not need to request values that did not change.
To be able to do this, the front-end must cache the value, even if it is
only in a single format.   
Why does it make sense to cache the value for one format but not for all?

> Here's a possible solution:
> 0. Apply my patch :-)
> 1. If a user changes format, use -var-set-format + -var-evaluate-expression,
> and cache the value.
> 2. After step, do -var-update. With my patch, this will compare the formatted
> value (recomputed after -var-set-format) with the new formatted value. 
> 3. If a variable is reported as changed, clear all cached formats for it.
> 
> The only case where it won't work is your example of floating variables
> -- when you have float and changed the format to integer, then change of
> value from 1.1 to 1.2 won't be detected.

Yes the float (and string) issue remains my last problem with the cache.
Even if this is a rare case, the cache must be right all the time,
not most of the time :-)  If not, I cannot have a cache.

Nick wrote:

> I don't like this change.  If I change the format to hexadecimal, 11 -> 0xb
> say, the display should change, so I would like GDB to report it through
> -var-update.

> Previously -var-evaluate-expression was needed because values weren't
> displayed when variable objects were created (-var-create now includes the
> value field, -var-list-children has the --all-values option).  Given that
> -var-update provides a record of all changes, I'm not sure that
> -var-evaluate-expression is necessary now.

It is starting to come together now :-)
What you are missing is for -var-set-format to have the --all-values flag.
Then, I believe you can stop using -var-evaluate-expression.  Using -var-update
instead of var-evaluate-expression or -var-set-format --all-values seems kind
of a hack...

What do you think of that?  Vladimir's patch and --all-values in set-format?
To me, it seems like the proper solution.

Marc


  reply	other threads:[~2008-01-18 15:31 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
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 [this message]
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=6D19CA8D71C89C43A057926FE0D4ADAA2DE096@ecamlmw720.eamcs.ericsson.se \
    --to=marc.khouzam@ericsson.com \
    --cc=gdb@sourceware.org \
    /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