Update gdb pretty printer docs w/ Python 3

fixes #9686
This commit is contained in:
Michael Friedrich 2015-07-21 12:11:54 +02:00 committed by Gunnar Beutner
parent f71a2ca340
commit e08a95e0e3
2 changed files with 20 additions and 11 deletions

View File

@ -51,10 +51,12 @@ SLES/openSUSE:
Install the `boost`, `python` and `icinga2` pretty printers. Absolute paths are required,
so please make sure to update the installation paths accordingly (`pwd`).
Boost Pretty Printers:
$ mkdir -p ~/.gdb_printers && cd ~/.gdb_printers
$ git clone https://github.com/ruediger/Boost-Pretty-Printer.git && cd Boost-Pretty-Printer
Boost Pretty Printers compatible with Python 3:
$ git clone https://github.com/mateidavid/Boost-Pretty-Printer.git && cd Boost-Pretty-Printer
$ git checkout python-3
$ pwd
/home/michi/.gdb_printers/Boost-Pretty-Printer
@ -71,7 +73,7 @@ Icinga 2 Pretty Printers:
Now you'll need to modify/setup your `~/.gdbinit` configuration file.
You can download the one from Icinga 2 and modify all paths.
Example on Fedora:
Example on Fedora 22:
$ wget https://raw.githubusercontent.com/Icinga/icinga2/master/tools/debug/gdb/gdbinit -O ~/.gdbinit
$ vim ~/.gdbinit
@ -89,16 +91,20 @@ Example on Fedora:
import sys
sys.path.insert(0, '/home/michi/.gdb_printers/python')
from libstdcxx.v6.printers import register_libstdcxx_printers
try:
register_libstdcxx_printers(None)
except:
pass
end
python
import sys
sys.path.insert(0, '/home/michi/.gdb_printers/Boost-Pretty-Printer')
from boost.printers import register_printer_gen
register_printer_gen(None)
import boost_print
boost_print.register_printers()
end
If you are getting the following error when running gdb, the `libstdcxx`
printers are already preloaded in your environment and you can remove
the duplicate import in your `~/.gdbinit` file.

View File

@ -11,7 +11,10 @@ python
import sys
sys.path.insert(0, '/home/gbeutner/gdb_printers/python')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers(None)
try:
register_libstdcxx_printers(None)
except:
pass
end
python