From: Vladimir Prus <ghost@cs.msu.su>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: gdb-patches@sources.redhat.com
Subject: Re: RFC: MI - Detecting change of string contents with variable objects
Date: Fri, 22 Dec 2006 07:23:00 -0000 [thread overview]
Message-ID: <200612221023.31460.ghost@cs.msu.su> (raw)
In-Reply-To: <17803.34115.206621.977511@kahikatea.snap.net.nz>
On Friday 22 December 2006 10:12, Nick Roberts wrote:
> > > Because -var-evaluate-expression uses varobj_get_value so they will always
> > > return the same value?
> >
> > Then, there are two solutions:
>
> We seem to be agree that the patch does the right thing and are just talking
> about implementation details.
Yes.
>
> > 1. Make c_value_of_variable and friends accept struct value as opposed to
> > taking struct varobj.
>
> c_value_of_variable, as it's name implies, requires a struct varobj as it's
> argument.
You can renamed it to anything you want, say "c_format_value", or whatever.
> > 2. Extra the part of c_value_of_variable that you've based your function on
> > into a separate function. Make both c_value_of_variable and install_new_value
> > call the new function.
>
> value_get_print_value is quite a small function. After you've wrapped
> some statements in if clauses and worked out how to call them with a
> common argument, I can't see that you would gain much.
>
> > I'm not sure which approach you find better, but I don't think copy-pasting
> > is a solution to anything.
>
> Clearly it is *a* solution, it's just a question of whether it's the *best*
> solution in this case. Anyway, it's not a straight copy-paste (the asserts are
> removed, for example).
Probably it's perfectionism, but if we want -var-update to return a varobj if the
result of -var-evaluate-expression would be different, then we must execute
the same code as for -var-evaluate-expression when deciding if the value has changed.
If you run some other code, however similar *now*, it's very likely that soon things
will break.
> I think if you look through the code you'll find
> numerous examples where one section of code is a slight variation of another.
Yes. I'd like to remove all such cases.
- Volodya
next prev parent reply other threads:[~2006-12-22 7:23 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-18 2:42 Nick Roberts
2006-12-18 7:01 ` Vladimir Prus
2006-12-18 8:15 ` Nick Roberts
2006-12-18 8:36 ` Vladimir Prus
2006-12-18 13:38 ` Daniel Jacobowitz
2006-12-18 21:57 ` Nick Roberts
2006-12-21 15:25 ` Vladimir Prus
2006-12-21 22:28 ` Nick Roberts
2006-12-22 6:16 ` Vladimir Prus
2006-12-22 7:16 ` Nick Roberts
2006-12-22 7:23 ` Vladimir Prus [this message]
2007-01-03 22:46 ` Daniel Jacobowitz
2007-01-04 4:13 ` Nick Roberts
2007-01-04 4:20 ` Daniel Jacobowitz
2007-01-04 6:10 ` Nick Roberts
2007-01-04 19:40 ` Daniel Jacobowitz
2007-01-04 20:35 ` Nick Roberts
2007-01-04 20:50 ` Daniel Jacobowitz
2007-01-04 21:00 ` Vladimir Prus
2007-01-05 4:46 ` Nick Roberts
2007-01-05 14:49 ` Daniel Jacobowitz
2007-01-05 21:54 ` Nick Roberts
2007-01-06 7:07 ` Vladimir Prus
2007-01-08 15:51 ` Daniel Jacobowitz
2007-01-08 21:30 ` Nick Roberts
2007-01-08 21:41 ` Daniel Jacobowitz
2007-01-04 20:57 ` Vladimir Prus
2007-01-05 2:26 ` Nick Roberts
2007-01-04 21:05 ` Vladimir Prus
2007-01-05 1:09 ` Nick Roberts
2007-01-05 14:44 ` Daniel Jacobowitz
2007-01-05 14:49 ` Vladimir Prus
2007-01-05 16:04 ` Jim Blandy
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=200612221023.31460.ghost@cs.msu.su \
--to=ghost@cs.msu.su \
--cc=gdb-patches@sources.redhat.com \
--cc=nickrob@snap.net.nz \
/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