Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: Vincent Benony <vbenony@nordnet.fr>
Cc: gdb-patches@sources.redhat.com
Subject: Re: GDB C plugin system, and STL container viewer as an example
Date: Fri, 23 May 2008 20:46:00 -0000	[thread overview]
Message-ID: <200805232046.20299.vladimir@codesourcery.com> (raw)
In-Reply-To: <1211560307.6621.26.camel@bsr-desktop>

On Friday 23 May 2008 20:31:47 Vincent Benony wrote:
> Le vendredi 23 mai 2008 à 18:43 +0400, Vladimir Prus a écrit :
> 
> > 
> > What happens for vector< vector<int> >? It does not seem like you handle the
> > inner items.
> > 
> 
> I do, my plugin can handle this kind of STL type imbrication.

Can you clarify how? Suppose I have varobj V, of vector <vector<int> > type.
V has two children, V.0 and V.1, which are both empty. The first child is
resized and -var-update V is send to GDB.

If I read your patch correctly, then you'll only check V itself -- I don't
see where the V's children will be updated. Can you point me at the code.

> > > 
> > > It seems to work well into KDevelop 
> > 
> > Strange, I don't know any codepath in KDevelop 3.5 that could possible handle this.
> > Which version did you try with?
> > 
> 
> 3.5.1
> 
> indeed, it seems there is a problem with KDevelop
> 
> If you try a very simple project like that :
> 
> #include <vector>
> 
> int main(int, char **)
> {
> 	std::vector<int> v;
> 	v.push_back(1);
> 	v.push_back(2);
> 	v.push_back(3);
> 	v.push_back(4);
> 	v[2]=5;
> 	*(v.begin()) = 6;
> 	return 0;
> }
> 
> 	in KDevelop, place a breakpoint on the "v.push_back(2);" line, add a
> watch expression to 'v'.
> 
> 	Expand local and watch views of 'v' variable. Then step line by line,
> and you'll see that 'watch' part is correctly updated, 

This is because all versions of GDB except for CVS HEAD is uncapable of properly
supporting watches via MI interface. As result, KDevelop has to reevaluate watches
at each step, which probably leads to this "workiness"

> whereas 'local' 
> part is not.
> 
> 	Could it be fixed by something in my GDB patch, or is it a KDevelop
> problem, ie does KDevelop assumes that an array never changes its size ?

Current version of MI assumes so -- there's no way to say that the number of
children has changed, and nothing says that if a variable object is reported
as changed, the frontend is required to re-get the list of children. 

- Volodya


      reply	other threads:[~2008-05-23 16:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-23 18:34 Vincent Benony
2008-05-23 19:30 ` Vladimir Prus
2008-05-23 19:53   ` Daniel Jacobowitz
2008-05-27 18:17     ` Vincent Bénony
2008-05-27 18:21       ` Thiago Jung Bauermann
2008-05-23 19:59   ` Vincent Benony
2008-05-23 20:31     ` Vladimir Prus
2008-05-23 20:39       ` Vincent Benony
2008-05-23 20:46         ` 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=200805232046.20299.vladimir@codesourcery.com \
    --to=vladimir@codesourcery.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=vbenony@nordnet.fr \
    /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