From KitwarePublic
< ITK‎ | GDBPretty
Revision as of 16:34, 17 November 2010 by Thewtex (Talk | contribs)

Jump to: navigation, search

Fedora 14 example

Install package dependencies

yum install gcc gcc-c++ git texinfo ncurses-devel flex bison python-devel

Build custom GDB

Build it

cd ~
mkdir gdb
cd gdb
git clone git:// source
mkdir build install
cd build
../source/configure --prefix=$(cd ../install && pwd)
make -j2 all
make install

Put it at the top of the system PATH

su -
cd /usr/local/bin
ln -s /home/user/gdb/install/bin/gdb

Replace user with your username.

Logout and login to a new shell to ensure the system follows the new path.

Install custom pretty-printers

Basic pretty-printers

yum install python-matplotlib cmake

Place the following in ~/.gdbinit

# C++ related beautifiers (optional)
set print pretty on
set print object on
set print static-members on
set print vtbl on
set print demangle on
set demangle-style gnu-v3
set print sevenbit-strings off
set multiple-symbols ask
# working with arrays
set print array on
set print elements 70

# gdb-pretty
import sys
sys.path.insert( 0, '/home/user/gdb/gdb-pretty' )
sys.path.insert( 0, '/home/user/gdb/gdb-pretty/itk/source' )
import gdb.pretty
gdb.pretty.register( 'libstdcxx.v6.printers', None )

require command view
require command alias

Replace user with your username.

mkdir ~/gdb/gdb-pretty

libstdcxx pretty-printers

cd ~/gdb/gdb-pretty
git clone libstdcxx

Try running the example

cd libstdcxx/examples
less readme.rst

Science related pretty-printers

Pretty printers in the Fedora repository

yum install Mayavi paraview

Install VV

Instructions on the VV homepage.

# Place this file in /etc/yum.repos.d/creatis.repo

name=Medical imaging from
yum update
yum install InsightToolkit InsightToolkit-devel InsightToolkit-data gengetopt  qt-devel

Build VTK 5.6 from source with VTK_USE_QT set to ON.

Download and build vv. Copy the executable to the system PATH, e.g.

mkdir ~/bin
cp vv ~/bin/

GDB setup

cd ~/gdb/gdb-pretty
git clone science
cd science
mkdir build
cmake -DCMAKE_INSTALL_PREFIX=~/gdb/install ..
make install

ITK pretty-printers

cd ~/gdb/gdb-pretty
git clone git:// itk

Try running the example

cd itk/examples
less readme.rst