]> granicus.if.org Git - icinga2/commitdiff
Update gdb pretty printer docs w/ Python 3
authorMichael Friedrich <michael.friedrich@netways.de>
Tue, 21 Jul 2015 10:11:54 +0000 (12:11 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Tue, 21 Jul 2015 10:11:54 +0000 (12:11 +0200)
fixes #9686

doc/21-debug.md
tools/debug/gdb/gdbinit

index b7ecb466658ed709c96d1d64c41775a9a32c64a9..90ca0c6cb8e87f7e7b3012421c6c11cf5fdea25c 100644 (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,34 +73,38 @@ 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
 
     set print pretty on
-
+    
     python
     import sys
     sys.path.insert(0, '/home/michi/.gdb_printers/icinga2')
     from icingadbg import register_icinga_printers
     register_icinga_printers()
     end
-
+    
     python
     import sys
     sys.path.insert(0, '/home/michi/.gdb_printers/python')
     from libstdcxx.v6.printers import register_libstdcxx_printers
-    register_libstdcxx_printers(None)
+    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.
index 5242513be2247137e0c337f84dc691175122d627..a7e6b87207690f5964dff0960b6cd0f5087ca418 100644 (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