Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: Vladimir Prus <ghost@cs.msu.su>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] MI: lvalues and variable_editable
Date: Tue, 30 Oct 2007 11:15:00 -0000	[thread overview]
Message-ID: <18215.4053.151140.671560@kahikatea.snap.net.nz> (raw)
In-Reply-To: <200710301222.03459.ghost@cs.msu.su>

 > I believe that var->value will be NULL.

Yes, that looks good.  I'll use:

  if (!var->value || !VALUE_LVAL(var->value))
    return 0;

and that should keep us both happy.

 > > When it's created it can be in a different frame according to the syntax.
 > > However, in Emacs I only create watch expressions in the selected frame
 > > (the manual suggests that "*" sets the value in the current frame but
 > > there are many anomalies like this).
 > 
 > Are you suggesting that GDB code should only work when used from Emacs? 

If I was, I would probably say something like "I suggest that GDB code should
only work when used from Emacs".  You're free read it how you like, but I was
just giving an example of real use.

 >                                                                        GDB,
 > as it stands, allows you to create a variable object in any frame, and your
 > patch does not work with that. So, either creating variable objects in any
 > frame should be disallowed, 

Actually I think that would be a good idea.  Generally a user would create a
watch expression in the frame he's examining.  If not, the frontend would have
to prompt for the frame.  Does KDevelop do this?

 >...
 > > Likewise I think variable assignment should only be done in the selected
 > > frame.
 > 
 > Err, why? I might have varobj for global variable called like 'g'. When I
 > assign value to that varobj, I don't really want any local variable called
 > 'g' to get in.  Of course, real program would have the variable named
 > differently, but still.

I'm not talking about global variables as they're valid in all frames.

 >...
 > > That's what I've just said.
 > 
 > So, in essence, the primary think you test is that this message now
 > say "Variable object is not editable"?

It's not just the message but that it's now triggered by:

  if (!(varobj_get_attributes (var) & 0x00000001))

instead of:

  if (!varobj_set_value (var, expression))

 > I personally think that the fact that -var-show-attributes reports rvalues
 > as non-editable is equally important, but if you don't feel like writing a
 > test for that, up to you -- in which case I'll probably submit a patch
 > myself (and maybe even make the 'editable' field into regular varobj
 > printing, as opposed to this 'attribute' thing).

mi_cmd_var_show_attributes calls varobj_get_attributes.  Like I said:
it's basically the same test.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


  reply	other threads:[~2007-10-30 11:05 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-26 22:59 Nick Roberts
2007-10-27  6:29 ` Vladimir Prus
2007-10-27 12:15   ` Nick Roberts
2007-10-27 14:22     ` Vladimir Prus
2007-10-30  8:55       ` Nick Roberts
2007-10-30  9:55         ` Vladimir Prus
2007-10-30 11:15           ` Nick Roberts [this message]
2007-10-30 13:41             ` Daniel Jacobowitz
2007-10-30 18:30               ` Nick Roberts
2007-10-30 19:26                 ` Daniel Jacobowitz
2007-10-30 19:27                   ` Daniel Jacobowitz
2007-11-01  4:42               ` Nick Roberts
2007-10-31 14:16             ` Vladimir Prus
2007-11-01  4:52               ` Nick Roberts
2007-11-01  7:52                 ` Vladimir Prus
2007-11-01 15:40                   ` Daniel Jacobowitz
2007-11-02  4:23                     ` Nick Roberts
2007-11-02 11:36                       ` Daniel Jacobowitz
2007-11-03  9:23                         ` Nick Roberts
2007-11-03  9:48                           ` Vladimir Prus
2007-11-03 23:14                             ` Nick Roberts
2007-11-20 13:39                               ` Vladimir Prus
2007-11-03 11:09                           ` Nick Roberts
2007-11-20 13:55                           ` Daniel Jacobowitz
2007-11-20 19:55                             ` 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=18215.4053.151140.671560@kahikatea.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=gdb-patches@sources.redhat.com \
    --cc=ghost@cs.msu.su \
    /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