Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "André Pönitz" <andre.poenitz@nokia.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: Python API - nested pretty printers MI implications
Date: Mon, 15 Aug 2011 15:36:00 -0000	[thread overview]
Message-ID: <201108151736.30905.andre.poenitz@nokia.com> (raw)
In-Reply-To: <201108151548.55558.pedro@codesourcery.com>

On Monday 15 August 2011 16:48:55 ext Pedro Alves wrote:
> > [...]
> > Just to confirm I understood correctly: Assuming everything would work as 
> > planned, a good strategy for frontends is to call '-var-update ... *'. Then
> > gdb would walk the whole varobj hierarchy, running pretty printers as 
> > appropriate, and produce a "diff" against the last reported state which is
> > output as a changelist, announcing potential new children to the FE, 
> > which in turn could ask for that in another roundtrip.
> 
> Yes.  I believe things could be extended to avoid extra roundtrips.
> 
> > If so, isn't this very similar to the "fat script" approach, where a python 
> > command (fed with a list of "names" of the expanded items) does all
> > the tree walking by itself? That would put everything into "user space",
> > let the pretty printers output additional data that's not of "general"
> > (i.e. for all FEs) interest, and would make implementation of pretty 
> > printers with multiple phony levels straightforward?
> 
> Probably.  But doesn't that mean library writters would get to write
> pretty printers for each FE out there?

If the library writer wants to "support" every fancy feature of every FE,
then, perhaps, yes.

However, without that flexibility we are in "one size fits all" mode, where
gdb hardcodes which kind of data is deemed useful for every FE, and the
FE has to jump through hoops (like extra roundtrips to retrieve "missing"
 information, or ignore unneeded data) to get hold of what it (the FE) 
actually wants to display. [That's not just anticipation, I had that kind
of situations in the past when a varobj based "full display" of a QObject
based class resulted in 50 or more roundtrips, basically rendering the
whole approach non-viable]

Anyway, in practice I would expect most implementors of "library pretty 
printers" to just provide the "usual" data (i.e. most likely what the current
varobjs display looks like), and the FE to override a handful of them with
an FE-specific "enriched" version - if at all. A schism on an individual 
pretty printer level is certainly much easier to handle (especially if the
maintainance burden for "fancy stuff" is solely on the individual FE side)
than a schism on the fundamental "varobj vs fat script" level.

Andre'


  reply	other threads:[~2011-08-15 15:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-14 16:11 Andrew Oakley
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 [this message]
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=201108151736.30905.andre.poenitz@nokia.com \
    --to=andre.poenitz@nokia.com \
    --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