I'd expect some instructions on how to enable the pretty printers in the gcc info manual.
You install GCC and the printers get installed alongside them, and when gdb loads libstdc++.so.6.0.16 it automatically loads libstdc++.so.6.0.16-gdb.py ... what more do you need to know? What needs to be documented?
On 05/09/2013 02:48 PM, redi at gcc dot gnu.org wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57226 > > --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- > You install GCC and the printers get installed alongside them, and when gdb > loads libstdc++.so.6.0.16 it automatically loads libstdc++.so.6.0.16-gdb.py ... > what more do you need to know? What needs to be documented? > First, mentioning that the pretty printers existst, and are installed with gcc, and not with gdb. Second, what to do if someone installs gcc in a non-standard location that is not known by gdb. I agree that by reading the gdb info one can come up with these commands in his .gdbinit, add-auto-load-safe-path /home/marco/local/gcc-4.8.0/share/gcc-4.8.0/python python import sys sys.path.insert(0, '/home/marco/local/gcc-4.8.0/share/gcc-4.8.0/python') from libstdcxx.v6.printers import register_libstdcxx_printers register_libstdcxx_printers (None) end but reporting them in gcc's manual would help.
On 05/09/2013 02:48 PM, redi at gcc dot gnu.org wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57226 > > --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- > You install GCC and the printers get installed alongside them, and when gdb > loads libstdc++.so.6.0.16 it automatically loads libstdc++.so.6.0.16-gdb.py ... > what more do you need to know? What needs to be documented? > First, mentioning that the pretty printers do exist and that they are installed with gcc, not with gdb. Second, what to do if someone installs gcc in a non-standard location that is not known by gdb. I agree that by reading the gdb info one can come up with these commands in his .gdbinit, ------------- add-auto-load-safe-path GCC_INSTALL_PREFIX/share/gcc-4.8.0/python python import sys sys.path.insert(0, 'GCC_INSTALL_PREFIX/share/gcc-4.8.0/python') from libstdcxx.v6.printers import register_libstdcxx_printers register_libstdcxx_printers (None) end ------------ but reporting them in gcc's manual would help.
(In reply to marco.morandini from comment #3) > Second, what to do if someone installs gcc in a non-standard location > that is not known by gdb. Then the executable will not find libstdc++.so and will not work anyway. If the executable finds the correct libstdc++.so then GDB will find it too. It's automatic. > I agree that by reading the gdb info one can come up with these commands > in his .gdbinit, > > ------------- > add-auto-load-safe-path GCC_INSTALL_PREFIX/share/gcc-4.8.0/python > > python > import sys > sys.path.insert(0, 'GCC_INSTALL_PREFIX/share/gcc-4.8.0/python') > from libstdcxx.v6.printers import register_libstdcxx_printers > register_libstdcxx_printers (None) > end > ------------ > > but reporting them in gcc's manual would help. Those commands are not necessary if your executable links to the right libstdc++.so
(In reply to Jonathan Wakely from comment #4) I've misread your comment #1. Apologize for the noise. I'm still convinced that it would be worth mentioning them in the doc. At the very least because this gdb warning warning: File "/home/marco/local/gcc-4.8.0/lib64/libstdc++.so.6.0.18-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load". To enable execution of this file add add-auto-load-safe-path /home/marco/local/gcc-4.8.0/lib64/libstdc++.so.6.0.18-gdb.py could be somewhat cryptic if someone does not know that these pretty printers are installed by gcc. Anyway, I'm closing this as invalid.
Ah, I haven't seen that warning. If you'd mentioned that warning I would have agreed it might be worth documenting, but as you only talked about how to install them (which happens automatically) I didn't understand the issue. I'll see what I can do to document it, maybe in the FAQ.
Author: redi Date: Wed Jan 29 23:46:31 2014 New Revision: 207288 URL: http://gcc.gnu.org/viewcvs?rev=207288&root=gcc&view=rev Log: PR libstdc++/57226 * doc/xml/manual/debug.xml (debug.gdb): Update documentation for installation and use of python printers. * doc/xml/manual/status_cxx2011.xml: Update. * doc/html/*: Regenerate. Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/doc/html/api.html trunk/libstdc++-v3/doc/html/faq.html trunk/libstdc++-v3/doc/html/index.html trunk/libstdc++-v3/doc/html/manual/abi.html trunk/libstdc++-v3/doc/html/manual/algorithms.html trunk/libstdc++-v3/doc/html/manual/api.html trunk/libstdc++-v3/doc/html/manual/appendix_contributing.html trunk/libstdc++-v3/doc/html/manual/appendix_free.html trunk/libstdc++-v3/doc/html/manual/appendix_gpl.html trunk/libstdc++-v3/doc/html/manual/appendix_porting.html trunk/libstdc++-v3/doc/html/manual/atomics.html trunk/libstdc++-v3/doc/html/manual/backwards.html trunk/libstdc++-v3/doc/html/manual/bitmap_allocator_impl.html trunk/libstdc++-v3/doc/html/manual/bugs.html trunk/libstdc++-v3/doc/html/manual/concurrency.html trunk/libstdc++-v3/doc/html/manual/configure.html trunk/libstdc++-v3/doc/html/manual/containers.html trunk/libstdc++-v3/doc/html/manual/debug.html trunk/libstdc++-v3/doc/html/manual/debug_mode_using.html trunk/libstdc++-v3/doc/html/manual/diagnostics.html trunk/libstdc++-v3/doc/html/manual/documentation_hacking.html trunk/libstdc++-v3/doc/html/manual/ext_compile_checks.html trunk/libstdc++-v3/doc/html/manual/ext_preface.html trunk/libstdc++-v3/doc/html/manual/extensions.html trunk/libstdc++-v3/doc/html/manual/facets.html trunk/libstdc++-v3/doc/html/manual/index.html trunk/libstdc++-v3/doc/html/manual/intro.html trunk/libstdc++-v3/doc/html/manual/io.html trunk/libstdc++-v3/doc/html/manual/iterators.html trunk/libstdc++-v3/doc/html/manual/localization.html trunk/libstdc++-v3/doc/html/manual/memory.html trunk/libstdc++-v3/doc/html/manual/numerics.html trunk/libstdc++-v3/doc/html/manual/parallel_mode.html trunk/libstdc++-v3/doc/html/manual/parallel_mode_using.html trunk/libstdc++-v3/doc/html/manual/policy_data_structures.html trunk/libstdc++-v3/doc/html/manual/policy_data_structures_design.html trunk/libstdc++-v3/doc/html/manual/policy_data_structures_using.html trunk/libstdc++-v3/doc/html/manual/profile_mode.html trunk/libstdc++-v3/doc/html/manual/profile_mode_design.html trunk/libstdc++-v3/doc/html/manual/profile_mode_diagnostics.html trunk/libstdc++-v3/doc/html/manual/status.html trunk/libstdc++-v3/doc/html/manual/std_contents.html trunk/libstdc++-v3/doc/html/manual/strings.html trunk/libstdc++-v3/doc/html/manual/support.html trunk/libstdc++-v3/doc/html/manual/test.html trunk/libstdc++-v3/doc/html/manual/unordered_associative.html trunk/libstdc++-v3/doc/html/manual/using.html trunk/libstdc++-v3/doc/html/manual/using_exceptions.html trunk/libstdc++-v3/doc/html/manual/using_headers.html trunk/libstdc++-v3/doc/html/manual/utilities.html trunk/libstdc++-v3/doc/xml/manual/debug.xml trunk/libstdc++-v3/doc/xml/manual/status_cxx2011.xml
fixed for 4.9.0