using GDB
GDB reference 1. compilemake 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 -lfind 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` runthen load the lib:
gSystem->Load("libX.so")
then press ^C back to GDB, you can now set breakpoints and continue