CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
Short introduction into debugging in GAP by Thomas Breuer and Max Neunhöffer
2
(see library file lib/debug.g)
3
4
Debug(<func> [,<name>]); # opens an editor to insert debugging code
5
# the debugged function is stored under a number
6
7
A "debugged" function gets a number and can later be accessed either as
8
itself or via this number.
9
10
Debug(<func_or_nr>); # opens an editor to edit debugging code
11
UnDebug(<func_or_nr>); # restores the function to its old form
12
ShowDebug(); # show currently debugged functions
13
SetDebugCount(<func_or_nr>,<count>); # Set counter of counting break point
14
15
Keys in editor:
16
17
F12 : this help
18
F2 : Set break point before current line
19
F3 : Set watch point before current line
20
F4 : Set counting break point before current line
21
F5 : Set Print statement before current line
22
23
Put any other debugging code into the function.
24
25
Note that the function object itself will be changed "in place"!
26
This means that all places where this function is installed for example
27
as a method will be changed simultanously.
28
29
BEWARE of debugging functions that have been created within the scope
30
of another function possibly with access to the surrounding local
31
variables (see "Orbish" and friends)!
32
***Debugging of such functions does not work and might ruin them!***
33
34