From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26484 invoked by alias); 14 Aug 2011 16:11:15 -0000 Received: (qmail 26470 invoked by uid 22791); 14 Aug 2011 16:11:08 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from adoakley.name (HELO ado.is-a-geek.net) (46.4.104.242) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 14 Aug 2011 16:10:54 +0000 Received: from ado-gentoo.moore.slainvet.net ([2001:8b0:393:0:223:54ff:fe39:b789] helo=ado-gentoo) by ado.is-a-geek.net with esmtpa (Exim 4.76) (envelope-from ) id 1QsdEv-00053R-TF for gdb@sourceware.org; Sun, 14 Aug 2011 16:08:42 +0000 Date: Sun, 14 Aug 2011 16:11:00 -0000 From: Andrew Oakley To: gdb@sourceware.org Subject: Python API - nested pretty printers MI implications Message-ID: <20110814171023.19db4f49@ado-gentoo> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-08/txt/msg00036.txt.bz2 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