Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: "Srrr" <ibx@gmx.net>
Cc: <gdb@sourceware.org>
Subject: Re: BUG: MI reporting wrong attributes for casted variables
Date: Thu, 21 Jun 2007 20:17:00 -0000	[thread overview]
Message-ID: <18042.56547.598273.973421@kahikatea.snap.net.nz> (raw)
In-Reply-To: <000001c7b427$5822d330$02b2a8c0@insanenotebook>

 > unsigned int myValue;
 > 
 > It is possible to create a casted MI variable like
 > 
 > 1096-var-create - * (int)myValue
 > 1096^done,name="var4",numchild="0",value="0",type="int"
 > 
 > GDB reports this to be an editable variable:
 > 
 > 1097-var-show-attributes var4
 > 1097^done,attr="editable"
 > 
 > But in fact, it is not. GDB does not allow assiging values to casted
 > variables. So GDB should not report this to be editable.
 > 
 > 1100-var-assign var4 1
 > 1100^error,msg="mi_cmd_var_assign: Could not assign expression to varible
 > object"
 > 
 > This bug is causing trouble in Eclipse CDT because casted vars show up as
 > editable when they are not.
 > 
 > GDB Snapshot from around 26.5.2007.

Report it as a bug to the Eclipse CDT team.  They have misinterpreted the
meaning of the "editable" attribute.

This has been reported at leasted once before, possibly by you (or at least
another Sascha using Eclipse CDT) when I said:

  The fact that the var has the attribute "editable" is a bit of a red herring.
  A value can't be assigned because (int)myValue isn't an lvalue.  You get the
  same error if you do:

  -var-create - * 2*myValue
  ^done,name="var36",numchild="0",value="2",type="int"

  -var-assign var36 0x1234

  I think it only makes sense to watch such values.

Having said all that, I think we should add another field "lvalue" or
"unassignable", say, to the output of -var-show-attributes so that IDE's
like Eclipse can determine which variables can be assigned a value.

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


  reply	other threads:[~2007-06-21 20:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-21 17:12 Srrr
2007-06-21 20:17 ` Nick Roberts [this message]
2007-06-21 20:25   ` Daniel Jacobowitz
2007-06-21 21:31     ` Nick Roberts
2007-06-22  4:57       ` Vladimir Prus
2007-06-22  6:21       ` Sascha Radike
     [not found]   ` <000301c7b493$5ca88a50$02b2a8c0@insanenotebook>
2007-06-22  7:11     ` Nick Roberts
2007-06-22 10:51       ` Sascha Radike

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=18042.56547.598273.973421@kahikatea.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=gdb@sourceware.org \
    --cc=ibx@gmx.net \
    /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