File: debug_interface.rst

package info (click to toggle)
squirrel3 3.1-8.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,380 kB
  • sloc: cpp: 12,722; ansic: 917; makefile: 316; python: 40
file content (72 lines) | stat: -rw-r--r-- 2,534 bytes parent folder | download | duplicates (7)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.. _api_ref_debug_interface:

===============
Debug interface
===============

.. _sq_getfunctioninfo:

.. c:function:: SQRESULT sq_getfunctioninfo(HSQUIRRELVM v, SQInteger level, SQFunctionInfo * fi)

    :param HSQUIRRELVM v: the target VM
    :param SQInteger level: calls stack level
    :param SQFunctionInfo * fi: pointer to the SQFunctionInfo structure that will store the closure informations
    :returns: a SQRESULT.
    :remarks: the member 'funcid' of the returned SQFunctionInfo structure is a unique identifier of the function; this can be useful to identify a specific piece of squirrel code in an application like for instance a profiler. this method will fail if the closure in the stack is a native C closure.



*.eg*

::


    typedef struct tagSQFunctionInfo {
        SQUserPointer funcid; //unique idetifier for a function (all it's closures will share the same funcid)
        const SQChar *name; //function name
        const SQChar *source; //function source file name
    }SQFunctionInfo;







.. _sq_setdebughook:

.. c:function:: void sq_setdebughook(HSQUIRRELVM v)

    :param HSQUIRRELVM v: the target VM
    :remarks: In order to receive a 'per line' callback, is necessary to compile the scripts with the line informations. Without line informations activated, only the 'call/return' callbacks will be invoked.

pops a closure from the stack an sets it as debug hook. When a debug hook is set it overrides any previously set native or non native hooks. if the hook is null the debug hook will be disabled.





.. _sq_setnativedebughook:

.. c:function:: void sq_setnativedebughook(HSQUIRRELVM v, SQDEBUGHOOK hook)

    :param HSQUIRRELVM v: the target VM
    :param SQDEBUGHOOK hook: the native hook function
    :remarks: In order to receive a 'per line' callback, is necessary to compile the scripts with the line informations. Without line informations activated, only the 'call/return' callbacks will be invoked.

sets the native debug hook. When a native hook is set it overrides any previously set native or non native hooks. if the hook is NULL the debug hook will be disabled.





.. _sq_stackinfos:

.. c:function:: SQRESULT sq_stackinfos(HSQUIRRELVM v, SQInteger level, SQStackInfos * si)

    :param HSQUIRRELVM v: the target VM
    :param SQInteger level: calls stack level
    :param SQStackInfos * si: pointer to the SQStackInfos structure that will store the stack informations
    :returns: a SQRESULT.

retrieve the calls stack informations of a ceratain level in the calls stack.