NAME
PBS::Debug - debugger support for PBS
SYNOPSIS
use PBS::Debug ;
AddBreakpoint
(
'hi'
, DEPEND => 1
, PRE => 1
, ACTIONS =>
[
sub
{
PrintDebug "Hi there.\n" ;
}
]
) ;
ActivateBreakpoints('hi') ;
DESCRIPTION
This module defines subs that manipulate PBS breakpoints (explained in PBS reference manual).
sub PrintBanner: display a friendly message when run under the perl debugger sub EnableDebugger sub p_h: display a help within the perl debugger sub p_b_wizard: not implemented sub p_list sub p_tree pretty print a tree sub p_dependencies pretty print the dependencies of a node sub p_node pretty prints a node
sub AddBreakpoint add a PBS breakpoint sub RemoveBreakpoints remove one or more PBS breakpoint according to the name regex passed as argument sub ListBreakpoints list all the breakpoints defined within PBS sub ActivateBreakpoints activates one or more PBS breakpoints sub DeactivateBreakpoints does the opposite of the above sub ActivatePerlDebugger activates wether a breakpoint (or breapoints) jumps to the perl debbugger sub DeactivatePerlDebugger does the opposite of the above
sub CheckBreakpoint
Aliases
p_list_breakpoints or p_L = ListBreakpoints p_activate_breakpoints or p_ab = ActivateBreakpoints p_deactivate_breakpoints or p_db = DeactivateBreakpoints p_jump_in_debugger or p_j = ActivatePerlDebugger p_B = RemoveBreakpoints
EXPORT
EnableDebugger AddBreakpoint RemoveBreakpoints ListBreakpoints ActivateBreakpoints DeactivateBreakpoints ActivatePerlDebugger DeactivatePerlDebugger CheckBreakpoint
and their aliases
BREAKPOINTs
AddBreakpoint
(
'hi'
, DEPEND => 1
, PRE => 1
, ACTIONS =>
[
sub
{
PrintDebug "Hi there.\n" ;
}
]
) ;
Breakpoint position
Some breakpoints cab be triggered before or after (or both) something happends in the system.
if PRE is set, the breakpoints triggers before the action takes place. The breakpoint is triggered after the action takes place if after the action if POST is set. This allows you to take a snapshot before something happends and compare after it has happened.
Types
BUILD (PRE/POST): when building a node.
POST_BUILD (PRE/POST): when a post build action is to be performed
TREE: when a tree (or sub tree) is finished depending
INSERT When a node is inserted in the dependency tree.
VARIABLE: when a variable is set.
DEPEND (PRE/POST) when depending a node. DEPEND+TRIGGERED+POST can be used to trigger a breakpoint only when a rule has matched the node.
Breakpoint filtering
You can set any of the following to a qr// or string. Only actions matching all the regexes you set will trigger a breakpoint.
RULE_REGEX
NODE_REGEX
PACKAGE_REGEX
PBSFILE_REGEX
Actions
ACTIONS
ACTIONS is an array reference containing sub references. All the subs are run. All debugging functionality (ie activating or adding breakpoints) are available within the subs.
USE_DEBUGGER
USE_DEBUGGER if running under the perl debugger and USE_DEBUGGER is set, PBS will jump into the debugger after the breakpoint.
AUTHOR
Khemir Nadim ibn Hamouda. nadim@khemir.net
SEE ALSO
PBS reference manual / debug section.