Docs: Fix gdb pretty printers

fixes #8048
This commit is contained in:
Michael Friedrich 2014-12-15 11:26:22 +01:00
parent 8d0db56f33
commit 85af84c9fb
2 changed files with 19 additions and 21 deletions

View File

@ -262,7 +262,7 @@ so please make sure to update the installation paths accordingly (`pwd`).
Boost Pretty Printers:
$ mkdir ~/.gdb_printers && cd ~/.gdb_printers
$ mkdir -p ~/.gdb_printers && cd ~/.gdb_printers
$ git clone https://github.com/ruediger/Boost-Pretty-Printer.git && cd Boost-Pretty-Printer
$ pwd
/home/michi/.gdb_printers/Boost-Pretty-Printer
@ -274,24 +274,18 @@ Python Pretty Printers:
Icinga 2 Pretty Printers:
$ mkdir -p ~/.gdb_printers/icinga2 && ~/.gdb_printers/icinga2
$ mkdir -p ~/.gdb_printers/icinga2 && cd ~/.gdb_printers/icinga2
$ wget https://raw.githubusercontent.com/Icinga/icinga2/master/tools/debug/gdb/icingadbg.py
Now you'll need to modify/setup your `~/.gdbinit` configuration file.
You can download the one from Icinga 2 and modify all paths.
> **Note**
>
> The path to the `pthread` library varies on distributions. Use
> `find /usr/lib* -type f -name '*libpthread.so*'` to get the proper
> path.
Example on Fedora 20 x64:
$ wget https://raw.githubusercontent.com/Icinga/icinga2/master/tools/debug/gdb/gdbinit -O ~/.gdbinit
$ vim ~/.gdbinit
set env LD_PRELOAD /usr/lib64/libpthread.so
set print pretty on
python
import sys
@ -314,7 +308,11 @@ Example on Fedora 20 x64:
register_printer_gen(None)
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.
RuntimeError: pretty-printer already registered: libstdc++-v6
### <a id="development-debug-gdb-run"></a> GDB Run

View File

@ -1,4 +1,4 @@
set env LD_PRELOAD /lib/x86_64-linux-gnu/libpthread.so.0
set print pretty on
python
import sys