using GDB

GDB reference 1. compile
make CXXFLAGS="-g -O0"
2. run gdb

working with ROOT

method 1:

run ROOT, load all .so libs

start gdb, e.g.

gdb --args `which root.exe` -b -l
find the process id and attach to it using "attach ".

when you set breakpoints, the name e.g. 'makePi0Tree::process_event(PHCompositeNode*)' should be in single quotes, because this the C++ functions contain ()'s

method 2:

start ROOT, you can also specify options by --args telling GDB the options you want to use:

gdb `which root.exe`
run
then load the lib:
gSystem->Load("libX.so")
then press ^C back to GDB, you can now set breakpoints and continue