This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix PR python/10646. Add libstdc++ Python pretty-printers for -D_GLIBCXX_DEBUG cases.


> 2009-09-30  Phil Muldoon <pmuldoon@redhat.com>
> 
>      PR python/10646
> 
>      * python/libstdcxx/v6/printers.py (StdListPrinter):
>      Add -D_GLIBCXX_DEBUG implementation changes. Receive typename
> from printer registration.
>      (StdListIteratorPrinter): Likewise.
>      (StdDebugIteratorPrinter): New printer.
>      (build_libstdcxx_dictionary): Add -D_GLIBCXX_DEBUG registration
>      entries.  Always pass a typename where the type can change.
>      (StdSlistPrinter) Receive typename from printer registration.
> Use in printer output.
>      (StdBitsetPrinter): Likewise.
>      (StdDequePrinter): Likewise.

Seems fine to me. Thanks for doing this. Is there any chance we can get
some additions about using the python pretty-printers in the docs? I'm
thinking on the main debug page (see debug.gdb in file
doc/xml/manual/debug.xml), in the gdb section? I would also like to see
some mention of this on the gcc-4.5/changes.html page, in the libstdc++
section. 

When I look at this silky smooth output, my eyes wander to the tuple
representation and think that perhaps there is room for improvement.
Only obvious because the rest of it is so nice now:

t_pqueue = std::priority_queue wrapping: std::vector of length 4,
capacity 4 = {8, 3, 4, 0} t_uptr = {
  <std::_Tuple_impl<0ul, char*, std::default_delete<char []> >> = {
    <std::_Tuple_impl<1ul, std::default_delete<char []> >> = {
      <std::_Tuple_impl<2ul>> = {<No data fields>}, 
      <std::_Head_base<1ul, std::default_delete<char []>, true>> = {
        <std::default_delete<char []>> = {<No data fields>}, <No data
fields>}, <No data fields>}, <std::_Head_base<0ul, char*, false>> = {
      _M_head_impl = 0x61b7b0 "z"
    }, <No data fields>}, <No data fields>}
t_uoset = std::unordered_set with 3 elements = {
  [0] = 1,
  [1] = 5,
  [2] = 9
}

-benjamin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]