Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Greg Watson <g.watson@computer.org>
To: Vladimir Prus <vladimir@codesourcery.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: MI: frozen variable objects
Date: Thu, 16 Nov 2006 13:58:00 -0000	[thread overview]
Message-ID: <AA29CD66-FC7C-4C4E-B36A-7945B03AC283@computer.org> (raw)
In-Reply-To: <200611161547.46997.vladimir@codesourcery.com>

I don't really understand the motivation for putting this kind of  
functionality into gdb. Any GUI that is more than just a front-end  
for gdb will most likely have an internal data structure representing  
the value of the variable, and can retain or manage access to the  
value if required. It seems to me that adding functionality like this  
to gdb just adds to bloat when it is really a GUI function anyway.

Greg

On Nov 16, 2006, at 5:47 AM, Vladimir Prus wrote:

>
> This patch introduces so called "frozen" variable objects --  
> variable objects
> that are not implicitly updated by the "-var-update *" command or by
> "-var-update" on parent variable objects.
>
> Those are needed in two cases:
>
>     - GUI might want to capture a value of some variable in the  
> program
>     and don't update it automatically. For example, so that at a  
> later point
>     you can look at the current values, and compare them with  
> previous values.
>     Now, MI does not provide any mechanism to do it.
>
>     - Some values might be "read-sensitive" -- it might be some  
> memory-mapped
>     hardware register and reading from it will extact data from  
> FIFO, or
>     acknowledge an interrupt, so this is not something that can be  
> done
>     implicitly.
>
> Frozen variable object is a mechanism to handle those use cases.  
> The most
> important design aspects are:
>
>    - A variable object can be made frozen either by explicit  
> request from the
>     user, or automatically by gdb, if gdb detect that the value is
>     read-sensitive. The present patch does not implement such auto- 
> detection
>     but I'm prototyped such functionality too, and it will be  
> coming later.
>
>    - If a variable object is frozen, then the value of that object,  
> or any
>      children of it, will be fetched from the memory (via  
> value_fetch_lazy)
>      only by explicit -var-update for that variable object or a  
> child. No
>      other operations, importantly -var-update * and -var-update of  
> parents
>      of frozen variable object, and -var-list-children, will fetch  
> the value.
>
>    - It is possible that a frozen variable has no value fetched. In  
> that
>     case -var-evaluate-expression will return empty string -- it won't
>     implicitly fetch the value.
>
> The patch is not fully finished -- it does not include testcase  
> changes, and
> it does not include docs. Both will take quite some time, so I'd  
> like to pass
> the code patch itself for review first.
>
> Thanks,
> Volodya
>
> 	* varobj.h (varobj_set_frozen): New
> 	(varobj_get_frozen): New.
> 	(varobj_update): New parameter explicit.
> 	* varobj.c (struct varobj): New fields frozen
> 	and not_fetched.
> 	(varobj_set_frozen, varobj_get_frozen): New.
> 	(install_new_value): Don't fetch values for
> 	frozen variable object, or children thereof.  Allow
> 	a frozen variable object to have non-fetched value.
> 	(varobj_update): Allow updating child variables.
> 	Don't traverse frozen children.
> 	(new_variable): Initialize the frozen field.
> 	(c_value_of_variable): Return NULL for frozen
> 	variable without any value yet.
> 	* mi/mi-cmd-var.c (varobj_update_one): New parameter
> 	'explicit'.
> 	(mi_cmd_var_create): Output the 'frozen' field,
> 	as soon as testsuite is adjusted to expect that field.
> 	(mi_cmd_var_set_frozen): New.
> 	(mi_cmd_var_list_children): : Output the 'frozen' field,
> 	as soon as testsuite is adjusted to expect that field.
> 	(mi_cmd_var_update): Pass the 'explicit' parameter to
> 	varobj_update_one.
> 	* mi/mi-cmds.c (mi_cmds): Register '-var-set-frozen'.
> 	* mi/mi-cmds.h (mi_cmd_var_set_frozen): Declare.
> <frozen.diff>


  reply	other threads:[~2006-11-16 13:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-16 12:48 Vladimir Prus
2006-11-16 13:58 ` Greg Watson [this message]
2006-11-16 15:25   ` Frederic RISS
2006-11-16 15:55     ` Daniel Jacobowitz
2006-11-16 16:26       ` Frederic RISS
2006-11-16 16:34         ` Daniel Jacobowitz
2006-11-17 15:21       ` Greg Watson
2006-11-16 18:55     ` Vladimir Prus
2006-11-16 21:36       ` Frédéric Riss
2006-11-17  6:17         ` Vladimir Prus
2006-11-17  8:54           ` Frederic RISS
2006-11-16 18:47   ` Vladimir Prus
2006-11-17 15:09     ` Greg Watson
2006-11-17 15:15       ` Daniel Jacobowitz
2006-11-17 15:26         ` Greg Watson
2006-11-17 15:33           ` Daniel Jacobowitz
2006-11-17 15:41             ` Greg Watson
2006-11-17 15:45               ` Daniel Jacobowitz
2006-11-17 18:16               ` Daniel Jacobowitz
2006-11-17 15:35         ` Greg Watson
2006-11-17 15:27       ` Vladimir Prus
2006-11-16 21:53 Nick Roberts
2006-11-16 22:00 ` Daniel Jacobowitz
2006-11-16 23:07   ` Nick Roberts
2006-11-17 15:19     ` Daniel Jacobowitz
2006-11-17 20:52       ` Nick Roberts
2006-11-17 21:05         ` Daniel Jacobowitz
2006-11-17 23:12           ` Nick Roberts
2006-11-18 11:00           ` Eli Zaretskii
2006-11-17  6:25 ` Vladimir Prus
2006-11-17 18:14 ` Daniel Jacobowitz
2006-11-18  6:59 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=AA29CD66-FC7C-4C4E-B36A-7945B03AC283@computer.org \
    --to=g.watson@computer.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