Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <ghost@cs.msu.su>
To: "André Pönitz" <apoenitz@trolltech.com>
Cc: gdb@sources.redhat.com
Subject: Re: MI Development
Date: Tue, 04 Sep 2007 15:06:00 -0000	[thread overview]
Message-ID: <200709041906.23252.ghost@cs.msu.su> (raw)
In-Reply-To: <200709041628.15560.apoenitz@trolltech.com>

On Tuesday 04 September 2007 18:28:15 André Pönitz wrote:

> > Variable objects and RTTI
> > For C++, variable objects are not able to look at the real type of the object.
> > only the static type is shown. We should be able to implement display of
> > al type, using Apple's branch as reference.
> 
> Personally I think variable objects are not very well suited for C++ at all.
> Say, I want to display a "std::vector<int> x"in a frontend I usually do not
> want to show three pointers to some internal data. Instead I usually want
> to have  x[0]...x[x.size()-1] as children. This is doable with variable objects,
> but the result feels clumsy, and the "update" feature cannot really be
> used.

I think we can fix that. I'd imagine we can make gdb invoke a Python hook
on -var-list-children. That hook will compute values that correspond to vector
member and create variable objects out of those. There's some work on Python
scripting already; I'd hope this use case will be kept in mind.

There's extra problem is that MI is not prepared that the number of children
of a variable objects can change -- and it can change in case of a vector. We'd
need to fix that.
 
> > Variable objects don't care much about C++ scopes. For example, it's not possible to
> > create a variable object for a given expression in particular scope, which makes it impossible
> > to accurately implement variable tooltips. Also, it's not possible to list all local variables in the
> > entire function, which requires extraordinary effort to display all local variables as the enter
> > scope and leave scope.
> 
> Yup. And there seems to be no way to reliably tell whether a (C++) variable has already been
> constructed.

This is indeed big problem, and I don't know if anybody's working on getting gcc to produce
accurate debug information for that.

- Volodya


  parent reply	other threads:[~2007-09-04 15:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-04 13:40 Vladimir Prus
     [not found] ` <200709041628.15560.apoenitz@trolltech.com>
2007-09-04 15:06   ` Vladimir Prus [this message]
2007-09-05  5:31 ` Nick Roberts
2007-09-05  5:40   ` Vladimir Prus
2007-09-05  6:29     ` Nick Roberts
2007-09-05  6:33       ` Vladimir Prus
2007-09-05  6:43         ` 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=200709041906.23252.ghost@cs.msu.su \
    --to=ghost@cs.msu.su \
    --cc=apoenitz@trolltech.com \
    --cc=gdb@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