Sofware changes quickly, check the date of this document (bottom of page) !
setup cdfsoft2 4.2.0 cd ~ newrel -t 4.2.0 420 cd 420 addpkg -h ExampleMyModule gmake
Example: break main one the program is running and stops at your favorite entry point (i.e. function/method name) the source is loaded in the gdb and you can set further breakpoints with the command break NNN where NNN is the line number you want to stop at Example: break 132 There is one problem with C++, entry points are not simply the method names, becasue of overloading also thse arguments have to be indicated with the proper name. I.e.: break main is OK (as any C function) break ExampleTrackAnalysis::event is not valid break ExampleTrackAnalysis::(AbsEvent* anEvent) does not work either ! break ExampleTrackAnalysis::(AbsEvent* event) does not work either ! Apparently none of the ways ExampleTrackAnalysis::event appears in the offline favorite example ExampleMyModule.cc or ExampleMyModule.hh is accepted by gdb. The way out I found is to use gdb automatic name completion. Type: bre 'ExampleTrackAnalysis::event<TAB> Note the single quote ! When you press the TAB key gdb will complete the name to break 'ExampleTrackAnalysis::event(EventRecord *)' which works. Note that the single quote is the one on the double quote key, next to colon, on the right side of the keyboard. Not the one on the ~ key, this latter one will not work.
(gdb) break main (gdb) run ExampleMyModule/run.tclthen the program runs until...
Breakpoint 1, main (argc=2, argv=0xbfffb7d4) at /home/cdfsoft/dist/packages/Framework/V00-06-98/src/APPMain.cc:90 90 in /home/cdfsoft/dist/packages/Framework/V00-06-98/src/APPMain.ccat which point the libExampleMyModule.so is loaded and you can do
(gdb) bre 'ExampleTrackAnalysis::event(EventRecord *)' Breakpoint 2 at 0x4002203c: file /home/belforte/420/ExampleMyModule/ExampleTrackAnalysis.cc, line 111.
(gdb) run Starting program: /home/belforte/420/bin/Linux2-KCC_4_0/ExampleMyModule_test /home/belforte/420/bin/Linux2-KCC_4_0/ExampleMyModule_test: error while loading shared libraries: libExampleMyModule.so: cannot open shared object file: No such file or directory Program exited with code 0177.The way out is to tell SRT to use absolute path names, so you cd to the release top directory, then issue the command "srt_setup -a". (Thanks to Liz Sexton for this tip!)
belforte@fcdflnx1/~...420 > pwd /cdf/home/belforte/ana/420 belforte@fcdflnx1/~...420 > echo $LD_LIBRARY_PATH ./shlib/Linux2-KCC_4_0:/cdf/code/cdfsoft/dist/releases/4.2.0/shlib/Linux2-KCC_4_0:./lib/Linux2-KCC_4_0:/cdf/code/cdfsoft/dist/releases/4.2.0/lib/Linux2-KCC_4_0:.:/cdf/code/cdfsoft/products/kai/v4_0f/Linux+2.2/KCC_BASE/lib:/cdf/code/cdfsoft/products/oracle_client/v8_1_6a_lite/Linux+2/lib:/cdf/code/cdfsoft/products/root/v3_01_06aKCC_4_0/Linux+2.2/lib belforte@fcdflnx1/~...420 > srt_setup -a belforte@fcdflnx1/~...420 > echo $LD_LIBRARY_PATH /cdf/home/belforte/ana/420/shlib/Linux2-KCC_4_0:/cdf/code/cdfsoft/dist/releases/4.2.0/shlib/Linux2-KCC_4_0:/cdf/home/belforte/ana/420/lib/Linux2-KCC_4_0:/cdf/code/cdfsoft/dist/releases/4.2.0/lib/Linux2-KCC_4_0:.:/cdf/code/cdfsoft/products/kai/v4_0f/Linux+2.2/KCC_BASE/lib:/cdf/code/cdfsoft/products/oracle_client/v8_1_6a_lite/Linux+2/lib:/cdf/code/cdfsoft/products/root/v3_01_06aKCC_4_0/Linux+2.2/lib
break ExampleTrackAnalysis::event(EventRecord *)possibly substituting your favorite module(s) name.