From: Tom Tromey <tromey@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] embryo of type/main_type pretty_printing...
Date: Tue, 22 Dec 2009 18:42:00 -0000 [thread overview]
Message-ID: <m3aaxa7sw7.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20091220074121.GG2804@adacore.com> (Joel Brobecker's message of "Sun, 20 Dec 2009 11:41:21 +0400")
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> As discussed with Daniel and Tom on IRC, I started looking at
Joel> writing pretty printers for struct type and struct main_type.
Excellent.
I like the approach you took; I think it is elegant.
Joel> class StructTypePrettyPrinter:
[...]
Joel> def to_string(self):
[...]
Joel> return "\n{" + ",\n ".join(fields) + "}"
It would be better to have a 'children' method that returns a container
(tuple or list, whatever is convenient). See the Pretty Printing node
in the manual for details of the contents.
This is better for a few reasons. From the CLI, it will mean that the
results are printed more nicely: they will respect indentation and "set
print pretty". From MI, they will show up as children of the type
object.
Regardless of whether you decide to change this, I think you should
check this in. That will make it simpler for us to improve it.
Tom
next prev parent reply other threads:[~2009-12-22 18:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-20 7:41 Joel Brobecker
2009-12-22 18:42 ` Tom Tromey [this message]
2009-12-23 7:08 ` Joel Brobecker
2010-01-05 23:12 ` Tom Tromey
2010-01-06 3:51 ` Joel Brobecker
2009-12-22 19:24 ` Daniel Jacobowitz
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=m3aaxa7sw7.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@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