Short introduction into debugging in GAP by Thomas Breuer and Max Neunhöffer
(see library file lib/debug.g)
Debug(<func> [,<name>]); # opens an editor to insert debugging code
# the debugged function is stored under a number
A "debugged" function gets a number and can later be accessed either as
itself or via this number.
Debug(<func_or_nr>); # opens an editor to edit debugging code
UnDebug(<func_or_nr>); # restores the function to its old form
ShowDebug(); # show currently debugged functions
SetDebugCount(<func_or_nr>,<count>); # Set counter of counting break point
Keys in editor:
F12 : this help
F2 : Set break point before current line
F3 : Set watch point before current line
F4 : Set counting break point before current line
F5 : Set Print statement before current line
Put any other debugging code into the function.
Note that the function object itself will be changed "in place"!
This means that all places where this function is installed for example
as a method will be changed simultanously.
BEWARE of debugging functions that have been created within the scope
of another function possibly with access to the surrounding local
variables (see "Orbish" and friends)!
***Debugging of such functions does not work and might ruin them!***