Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH]: MI -var-set-format
Date: Fri, 05 May 2006 23:30:00 -0000	[thread overview]
Message-ID: <17499.57333.952984.589237@farnswood.snap.net.nz> (raw)
In-Reply-To: <20060505181111.GI31029@nevyn.them.org>

 > > I would like to add the value in the (new) current format, which I find
 > > much more useful:
 > > 
 > >   -var-set-format var1 hexadecimal
 > >   ^done,format="hexadecimal",value="0x12"
 > > 
 > > OK to apply if I update the testsuite accordingly?
 > 
 > This seems reasonable; I doubt anyone will object.
 > 
 > I was wondering how to handle potential error conditions.  I see at
 > least two:
 > 
 >   - The return of varobj_get_value can be NULL.  You should check for
 >     that.

That often happens already.  I don't see a real problem: the null string
gets returned and nothing gets printed for the value.

 >   - common_val_print might fail to transform the struct value * into
 >     a string for some reason.  I believe it may call error() if that
 >     happens.

I don't know what the reason would be.  However, the value is printed via
varobj_get_value for many other MI commands e.g -var-evaluate-expression,
-var-list-children --all-values, -var-update --all-values -- and I've
not seen it call an error yet

 > Should -var-set-format fail in those cases, or should it omit the
 > value, or should it supply a default value string (e.g. <error>)?  It
 > will have changed the varobj's settings, so I don't think ^error
 > is appropriate.

Eventually I guess it might be a good idea to distinguish between a
NULL pointer and a string that has the value NULL, but I presume any
such changes would be to varobj_get_value and so are orthogonal to my
patch.


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


  reply	other threads:[~2006-05-05 23:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-02  6:19 Nick Roberts
2006-05-05 18:11 ` Daniel Jacobowitz
2006-05-05 23:30   ` Nick Roberts [this message]
2006-05-15 17:07     ` Daniel Jacobowitz
2006-05-16  3:46       ` Nick Roberts
2008-01-22 20:13         ` Daniel Jacobowitz
2008-01-23  3:25           ` Nick Roberts
2008-01-23  3:48             ` Daniel Jacobowitz
2008-01-23  6:24               ` Nick Roberts
2008-01-23 13:17                 ` Daniel Jacobowitz
2008-01-23 21:17                   ` Nick Roberts
2008-01-23 21:24                     ` Daniel Jacobowitz
2008-01-23 22:30                       ` Nick Roberts
2008-01-24 21:49 Marc Khouzam
2008-01-25 10:38 ` Eli Zaretskii
2008-01-25 15:46   ` Marc Khouzam

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=17499.57333.952984.589237@farnswood.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=drow@false.org \
    --cc=gdb-patches@sources.redhat.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