Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <ghost@cs.msu.su>
To: gdb-patches@sources.redhat.com
Subject: Re: Type information in -data-evaluate-expression
Date: Tue, 31 Jul 2007 08:09:00 -0000	[thread overview]
Message-ID: <f8mnq3$2t4$1@sea.gmane.org> (raw)
In-Reply-To: <200707301733.59718.apoenitz@trolltech.com>

André Pönitz wrote:

> On Monday 30 July 2007 15:52:10 Vladimir Prus wrote:
>> André Pönitz wrote:
>> > While playing around with gdb's "mi" interface (which looks rather
>> > nice for scripting btw...) I came across a few places where I think
>> > the interface might be made even more convienient without much
>> > effort.
>> > 
>> > One example: As far as I can see currently the only way to obtain
>> > the type of an expression is to use -var-create & -var-delete.
>> > It would be more convienient for me if I could get that information
>> > with a single command without creating a variable which will be
>> > thrown away immediatedly afterwards.
>> 
>> What is the use case where you need to just get the type of an
>> expression, without doing anything with it?
> 
> One use case would be to display values in a graphical frontend
> when hovering (or even moving) the mouse over some expression.
> My current "best practice" here is to create a variable called "tooltip",
> extract value and type and delete it again, only to create it again
> with a slightly different expression etc. So I need two roundtrips
> and need some syncronization to handle the two partial results
> whereas the proposed "enhanced" version would allow a simple
> hit-and-run implementation...

Yes, but in the long run, your frontend will need a mechanism to
handle chain of several commands, anyway. In fact, I think the best
design would be to talk to gdb in a separate thread, so that
you need a straight-forward procedural code, not callback-based code.
At least, that's the design I plan to use in KDevelop4.

> Also, there are times when I would like to call "custom data dumpers"
> (think std::string or std::vector) instead of using the content of the
> value field. To trigger those dumpers quickly I need to get hold of type
> information quickly, preferably after the first round trip. I understand
> that a delay of a few dozen milliseconds for a round trip is a non-issue
> for the typical command line use, however these add up easily to a more
> significant amount if one "needs" lots of them...

If you query the type for expression under cursor, then you have only one
expression, no? Therefore, the difference between 1ms and 2ms is not important.

- Volodya



      parent reply	other threads:[~2007-07-31  7:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-30 13:52 André Pönitz
2007-07-30 15:34 ` Vladimir Prus
2007-07-30 17:06   ` André Pönitz
2007-07-30 23:17     ` Nick Roberts
     [not found]       ` <200707310922.14919.apoenitz@trolltech.com>
2007-07-31  9:13         ` Nick Roberts
2007-07-31  9:40           ` André Pönitz
2007-07-31 10:39             ` Nick Roberts
2007-07-31 11:02               ` Vladimir Prus
2007-07-31 11:25                 ` Nick Roberts
2007-07-31 11:06               ` Daniel Jacobowitz
2007-07-31 13:35                 ` Nick Roberts
2007-07-31 10:14           ` Vladimir Prus
2007-07-31 10:29             ` Nick Roberts
2007-07-31  8:09     ` Vladimir Prus [this message]

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='f8mnq3$2t4$1@sea.gmane.org' \
    --to=ghost@cs.msu.su \
    --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