This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
considering changes to pretty-printing
- From: Tom Tromey <tromey at redhat dot com>
- To: Project Archer <archer at sourceware dot org>
- Date: Mon, 03 Nov 2008 15:58:03 -0700
- Subject: considering changes to pretty-printing
- Reply-to: tromey at redhat dot com
I've been working on a fairly complete set of pretty-printers for
libstdc++. I thought this would help point out problems.
>From this, I learned two things I would like to change.
First, I'd like to completely unify the MI- and CLI-cases. I haven't
wanted to separate the two yet and I think it would be simpler, and
would allow some nice features, if the two cases were treated
identically.
For example, consider std::queue. This is a container adapter, not a
container. So, we want to delegate pretty-printing to the underlying
container's printer. But how do we find that? If we have unified the
two cases, we can call gdb.get_default_visualizer.
Second, I'd like to change how visualizers are constructed. Right now
we pass a value to the to_string and children methods. Instead, I'd
like to simply pass the value to the constructor. In the MI case, I'd
then like to make a new visualizer each time a refresh is done.
I think this is preferable because it better reflects the typical
implementation of a visualizer. Smart caching is still possible by
having the visualizer "constructor" be a smarter function.
Please comment.
Tom