From: Andrew Oakley <andrew@ado.is-a-geek.net>
To: gdb@sourceware.org
Subject: Python API - nested pretty printers MI implications
Date: Sun, 14 Aug 2011 16:11:00 -0000 [thread overview]
Message-ID: <20110814171023.19db4f49@ado-gentoo> (raw)
I've got a patch to allow the Python pretty printer children iterators
to return more pretty printers so they can create "phony groups" a bit
like this:
class outer_pretty_printer:
class inner_pretty_printer:
def __init__(self, ...):
...
def to_string(self):
...
def children(self):
...
def __init__(self, val):
...
def to_string(self):
...
def children(self):
yield ("normal variable", "some value")
yield ("phony group 1", inner_pretty_printer(...))
yield ("phony group 2", inner_pretty_printer(...))
This seems to work well but I'm not quite sure how to handle the for MI.
As far as I can tell I need to create "fake" varobj structures with no
underlying value or type (because I don't have one). This appears to
already happen and is tested for with CPLUS_FAKE_CHILD, but I'm not
quite sure what that is for. Does this seem like a reasonable thing to
do (after searching around for CPLUS_FAKE_CHILD)?
My other worry is varobj invalidation and update. Am I correct in
thinking that updates can only happen from a "root" varobj? If so it
should be possible to reconstruct the "fake" varobj structures in
varobj_update (I don't think it will be straightforward though).
Am I correct in assuming you would want MI to work before accepting
patches?
--
Andrew Oakley
next reply other threads:[~2011-08-14 16:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-14 16:11 Andrew Oakley [this message]
2011-08-14 22:18 ` Daniel Jacobowitz
2011-08-15 12:36 ` André Pönitz
2011-08-15 13:26 ` Pedro Alves
2011-08-15 14:33 ` André Pönitz
2011-08-15 14:49 ` Pedro Alves
2011-08-15 15:36 ` André Pönitz
2011-08-16 22:12 ` Andrew Oakley
2011-08-16 22:23 ` [PATCH] Allow nested python pretty printers andrew
2011-08-17 9:56 ` Phil Muldoon
2011-08-17 13:28 ` Andrew Oakley
2011-08-15 12:58 ` Python API - nested pretty printers MI implications Pedro Alves
2011-08-15 14:06 ` Andrew Oakley
2011-08-15 14:30 ` Pedro Alves
2011-08-16 22:12 ` Andrew Oakley
2011-08-17 12:49 ` Pedro Alves
2011-08-17 18:31 ` Andrew Oakley
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=20110814171023.19db4f49@ado-gentoo \
--to=andrew@ado.is-a-geek.net \
--cc=gdb@sourceware.org \
/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