Boost logo

Boost Users :

Subject: Re: [Boost-users] Support of Pretty print
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2009-06-26 11:42:34


Zachary Turner wrote:

> On Fri, Jun 26, 2009 at 9:49 AM, Mario Chacon<the.masch_at_[hidden]> wrote:
>> eheh... I do not know enough to write pretty prints, it's will be help if
>> there are some example that other can continue, Do you know if exist some
>> pretty print boost exampless?
>>
>
>
> It's nothing specific to boost, you just have to learn the GDB macro
> language. One of the difficulties in writing GDB pretty prints is
> that, unlike with Visual Studio debug visualizers, GDB pretty printing
> does not happen "automatically". You have to write a special command
> for every single type you want to pretty print. "printboostvariant",
> "printboostany", "printboostfspath", etc. It's a little bit annoying
> for sure. You can get around this even by writing a GDB plugin.

I guess much of confusion has resulted from the fact that Mario did not
say what exactly he is talking about. The GDB pretty-printers he mention
have nothing to do with that inadequate-for-anything GDB macro language.
These are Python pretty-printers. See:

        http://tromey.com/blog/?p=524

These are also documented in the development version of the GDB.

> If you want to write a GDB plugin, there is not as much available
> info, but you can refer to this page:
>
> http://sourceware.org/ml/gdb-patches/2008-05/msg00671.html
>
> in which someone submitted a plugin for GDB to automatically display
> correctly STL types just by using the normal "print" statement.

That specific patch did not went further, since Python support was already
in development.

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net