]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
debug.xml: Rewrite and expand GDB Python pretty-printer section.
authorPhil Muldoon <pmuldoon@redhat.com>
Thu, 8 Oct 2009 08:27:24 +0000 (08:27 +0000)
committerPhil Muldoon <pmuldoon@gcc.gnu.org>
Thu, 8 Oct 2009 08:27:24 +0000 (08:27 +0000)
2009-10-07  Phil Muldoon <pmuldoon@redhat.com>

* doc/xml/manual/debug.xml: Rewrite and expand GDB Python
pretty-printer section.

From-SVN: r152554

libstdc++-v3/ChangeLog
libstdc++-v3/doc/xml/manual/debug.xml

index 1526c6809f87af6876f9b650aab5f96532ba9b64..ebedbf294d40d6ec4d4a18884430cf204531cf89 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-07  Phil Muldoon <pmuldoon@redhat.com>
+
+       * doc/xml/manual/debug.xml: Rewrite and expand GDB Python
+       pretty-printer section.
+
 2009-10-07  Chris Jefferson  <chris@bubblescope.net>
 
        * testsuite/25_algorithms/rotate/moveable2.cc: New.
index 5648ba5713d958a0353374b00cee37640da136dd..ca0912681499f9189cd415d27ad6f2cafd479874 100644 (file)
 </programlisting>
 
 <para>
-  GDB 7.0 will include support for writing pretty-printers in Python.
- A library of printers for STL classes already exists within the
- libstdc++ svn repository. For information on enabling these printers,
- and for other GDB STL support options: please see
- <ulink url="http://sourceware.org/gdb/wiki/STLSupport"> "GDB Support
- for STL" </ulink> in the GDB wiki. Additionally, in-depth
- documentation and discussion of this feature can be found in the GDB
- manual. Please see:
- <ulink url="http://sourceware.org/gdb/current/onlinedocs//gdb_24.html#SEC260">
- "23.2.2.6 Pretty Printing" </ulink>
+  Starting with version 7.0, GDB includes support for writing
+  pretty-printers in Python.  Pretty printers for STL classes are
+  distributed with GCC from version 4.5.0.  The most recent version of
+  these printers are always found in libstdc++ svn repository.
+  To enable these printers, check-out the latest printers to a local
+  directory:
+</para>
+
+<programlisting>
+  svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python 
+</programlisting>
+
+<para>
+  Next, add the following section to your ~/.gdbinit  The path must
+  match the location where the Python module above was checked-out.
+  So if checked out to: /home/maude/gdb_printers/, the path would be as
+  written in the example below.
+</para>
+
+<programlisting>
+  python
+  import sys
+  sys.path.insert(0, '/home/maude/gdb_printers/python')
+  from libstdcxx.v6.printers import register_libstdcxx_printers
+  register_libstdcxx_printers (None)
+  end
+</programlisting>
+
+<para>
+  The path should be the only element that needs to be adjusted in the
+  example.  Once loaded, STL classes that the printers support
+  should print in a more human-readable format.  To print the classes
+  in the old style, use the /r (raw) switch in the print command
+  (i.e., print /r foo).  This will print the classes as if the Python
+  pretty-printers were not loaded.
+</para>
+
+<para>
+  For additional information on STL support and GDB please visit:
+  <ulink url="http://sourceware.org/gdb/wiki/STLSupport"> "GDB Support
+  for STL" </ulink> in the GDB wiki.  Additionally, in-depth
+  documentation and discussion of the pretty printing feature can be
+  found in "Pretty Printing" node in the GDB manual.  You can find
+  on-line versions of the GDB user manual in GDB's homepage, at
+  <ulink url="http://sourceware.org/gdb/"> "GDB: The GNU Project
+  Debugger" </ulink>.
 </para>
 
 </sect2>