Some facilities are provided to ease the debugging of recipes and primitives. These are as follows.
-w
switch should be used during development in order to trap and fix any warnings
detected by the Perl interpreter at runtime. In many cases, these warnings are indicative
of code that makes assumptions about state (warnings on use of undef
) or scope (my
declarations masking variables defined in a higher scope).
If warnings are raised from the orac-dr core please contact the authors and they will be fixed.10
-verbose
switch can be used to turn on messages from the algorithm engines. This
is sometimes useful to make sure that the external task is doing the expected operation.
oracdr_parse_recipe
command is provided to translate a recipe into Perl code. It
takes a recipe name as argument and sends the translated recipe to standard output. This
command can be used to check the syntax of the recipe (by compiling the perl code and
exiting immediately) by using the –syntax
option.
-debug
switch. This creates a file
in ORAC_DATA_OUT
called ORACDR.DEBUG
containing the contents of each message sent to
external tasks with an obeyw
. This can be used to find out what the final message sent to
a task was before the recipe crashed. If a recipe crashes when the debugging is turned on
the full contents of the recipe buffer (i.e. the fully parsed recipe) will also be written to
a file in ORAC_DATA_OUT
called ORACDR_RECIPE.dump
. This would be identical to running
the oracdr_parse_recipe
command.
The Perl debugger should be used with care since it is possible to hang the message bus if the program
is frozen during a message transaction and the debugger is not optimized for use with the use of
nested eval
common in the pipeline internals.
10currently the one known issue is multiple declarations of the ORAC_PRIMITIVE
variable.