subtype printing ignores type printers: API deficiency?
Matei David <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <20150312184219.3496aaa6@ara-vm-ku1404-3> |
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