Tuesday, May 24, 2005

Debugging ORCA code

Ok, so sometimes your orca job will seg fault or crash for no reason. If it does nothing at all (eg. it doesn't enter your analysis block) check that you have :
PKBuilder eventAnalyser("QQH_L1TriggerTest");
as the lasst line in your code. If you get crash you may want to run your program through a debugger, usually GDB, and to do this you must build debug libraries. Here's a mail from Lassi Turra:
If this is scramv1 project, edit your BuildFile and add a line
<
Flags CXXFLAGS="-g -O0">

and rebuild (scramv1 b clean && scramv1 b).

If it's old scram, edit config/compiler.mk (CXXFLAGS) to disable optimisation (remove -O2) and enable debugging (add -g), then rebuild your code (scram b clean && scram b).

You can now run the program with GDB. Information on GDB Usage can be found here.