aboutsummaryrefslogtreecommitdiffhomepage
path: root/notes/debugging.txt
blob: 77f7766c599914852878c081132f1be900b2b48b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

Debugging
=========
Debuggers are often inconvenient to use, since the commands often have to
be repeated over and over again (unless reverse execution is supported).
Debugging via the text editor could make this much easier.

Solution 1: In-line debugging
-----------------------------

    func somefunc()
    {
    \debuginclude
        var int a = 123
        do_stuff(var a, 1)
    \debugpoint
        do_stuff(var a, 2)
    }

When the \debugpoint is reached, all variables are printed. If there is
at least one \debuginclude, then only those variables are printed.
Variables could also be skipped by marking them with \debugexclude.

The debugger could be told to rescan the source for \debug... lines via
IPC via some CLI command (or via an IDE).

Solution 2: Separate-file debugging
-----------------------------------
somedebugfile.cfg:

    @source1.slul somefunc
    var_include a
    debugpoint after do_stuff 1

Then some command could be run to debug using this file:

    $ slul debug -f somedebugfile.cfg