I can’t seem to be able to interract with any root classes while debugging with gdb on lxplus.
I’ve attached a test program. extract and type make with ROOTSYS pointing to a root installation directory.
Then do:
gdb ./test
br test.cpp:19
run
Then, when the program breaks, try to inspect the variable ‘test_hist’
print test_hist
gives:
(gdb) print test_hist
No symbol “test_hist” in current context.
In fact, any variable in that program which is from root somehow doesn’t exist.
I’ve made sure that the libraries in my ROOTSYS are not stripped.
file output showing that the libraries are not stripped: file_libHist.so.txt (173 Bytes)
ldd output showing that my test executable is linking to the correct libraries: ldd_test.txt (2.49 KB)
However, working out this example has led me to discover one of my problems.
See, I’ve been trying to use gcc 4.8 lately. I’ve been sourcing /afs/cern.ch/sw/lcg/contrib/gcc/4.8.1/x86_64-slc6-gcc48-opt/setup.sh
To get gcc 4.8.
So, removing all traces of gcc 4.8 from my PATH and LD_LIBRARY_PATH,
I get for the simple test: simple_gdb_test_output_2.txt (1.14 KB)
I get for the root test: gdb_output_2.txt (1.33 KB)
This eliminates one problem, in that now gdb knows about simple classes, However: If you look at ptype test_hist, you can see get that class TH2D is an incomplete type! This is no good, since I need to inspect members of root classes as my program executes.
So now, there are two questions:
1.) Why won’t the lxplus version of gdb work with gcc 4.8? What can I do to make it work?
2.) Why doesn’t gdb have a full definition of TH2D?