From: Matei David <matei@cs.toronto.edu>
To: gdb@sourceware.org
Subject: subtype printing ignores type printers: API deficiency?
Date: Thu, 12 Mar 2015 22:45:00 -0000 [thread overview]
Message-ID: <20150312184219.3496aaa6@ara-vm-ku1404-3> (raw)
Hi,
While working on pretty printers for Boost, I found something which
might be a deficiency of the default built-in value printer, or of the
python API:
When type `A` is a base class of type `B`, and gdb attempts to print an
object `b` of type `B`, the default built-in printer produces something
like:
{ <A> = [invoke value printer for A], [other fields of B] }
The problem is that in doing so, it ignores any type printer for A.
A full example is here:
https://github.com/ruediger/Boost-Pretty-Printer/issues/11#issuecomment-78616860
I would expect the output to look like:
{ <[invoke type printer for A]> = [invoke value printer for A], [other
fields of B] }
Is there a way to achieve this? That is, to customize how A gets
printed as a base class?
Naturally, this is all fixed by writing a custom value printer for B.
But if A is a type in a library and B is a user type, it would be nice
to have the option to customize the value/type printing of A, not B.
Thanks,
Matei
reply other threads:[~2015-03-12 22:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20150312184219.3496aaa6@ara-vm-ku1404-3 \
--to=matei@cs.toronto.edu \
--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