§•Debugger |
---|
Abstraction: |
States of type §•Debugger let the user interact with the compiler.
|
---|
In the interactive mode of the compiler, a state of type §•Debugger is present in every environment for interactive evaluation. This state is always named •db, and there is no way to create other states. See interactive.html for a more pedagogical treatment of the actual use of §•Debugger states. |
Mutators |
---|
|
• << |
---|
There are no tack-on mutators. |
|
(•) |
---|
The state cannot be peeked. |
|
freeze • |
---|
The state cannot be frozen. |
|
resume
alias: r |
result:expr → §Void |
---|
Side effect: |
|
---|
If result is not provided, the expression where evaluation was interrupted is made the next expression to evaluate (with the corresponding lexical and dynamic environments), rather than actually passing the corresponding thunk expr to the continuation. The special treatment of the default for result also includes making sure that a breakpoint is not triggered immediately, which is very convenient if evaluation was previously interrupted at a breakpoint.
For instance,
•db.[resume void]
shall be equivalent to
(escape_continue resume void)
and
•db.[resume]
(at a breakpoint) shall be similar to
•db.[breakIgnore]
(escape_continue resume expr)
|
|
|
backtrace
alias: t |
→ §String |
---|
The returned string will display the backtrace when printed by the interactive continuation. Here, a backtrace refers to the chain of continuations starting from the current continuation. When the chain reaches an interactive continuation, it is continued at its ..Shapes..Debug..C—resume.
|
|
env
alias: e |
→ §String |
---|
The returned string will display the lexical environment at the point of interaction.
|
|
dyn
alias: d |
→ §String |
---|
The returned string will display the dynamic environment at the point of interaction.
|
|
breakList
alias: bl |
→ §String |
---|
The returned string displays information about the currently existing breakpoints. The first column lists the current index of a breakpoint, but note that this number may change over time as breakpoints are cleared or created. The second column (within parentheses) tells if the breakpoint is enabled (on) or not (off), optionally followed by other information about the breakpoint. Following a colon, each line ends with the breakpoint location.
|
|
breakAt
alias: ba |
file::§String line::§Integer column:0::§Integer enable::§Boolean → §Void |
---|
Side effect: |
Enable, disable, or toggle breakpoint at a given source location.
|
---|
If enable is not provided, it defaults to toggle the breakpoint.
The expression pointed out is defined as the expression with the smallest source location that includes the given position.
|
|
breakIn
alias: bi |
function::§UserFunction enable::§Boolean → §Void |
---|
Side effect: |
Enable, disable, or toggle breakpoint at the body of a function.
|
---|
If enable is not provided, it defaults to toggle the breakpoint.
|
|
breakIgnore
alias: bg |
index:0::§Integer count:1::§Integer → §Void |
---|
Side effect: |
Set count for how many times a breakpoint shall be ignored.
|
---|
The default value for index refers to the expression where evaluation was interrupted. Any other value is interpreted by the indices listed by §•Debugger/breakList.
|
|
breakClear
alias: bc |
index:0::§Integer → §Void |
---|
Side effect: |
Remove breakpoint completely.
|
---|
The default value for index refers to the expression where evaluation was interrupted. Any other value is interpreted by the indices listed by §•Debugger/breakList.
|
|
|
step
alias: s |
count:1::§Integer → §Void |
---|
Continue program evaluation until reaching an expression which is not lexically inside the current expression.
The argument count tells how many times to continue evaluation before actually interrupting again.
| See also: | §•Debugger/resume |
|
|
stepc
alias: sc |
→ §Void |
---|
Step program evaluation to the next child expression of the current expression.
Uses temporary breakpoints internally. If no breakpoints are set, the stepping is aborted. The ignore count (see §•Debugger/breakIgnore) is not affected, which means that it can be used to avoid stopping in some of the expressions where temporary breakpoints are set.
| See also: | §•Debugger/steps |
|
steps
alias: ss |
→ §Void |
---|
Step program evaluation to the next sibling expression of the current expression.
|
|
contUp
alias: cu |
count:1::§Integer → §Void |
---|
Side effect: |
|
---|
Replace the current interactive context with one where ..Shapes..Debug..C—resume is found by following the backtrace count steps up.
Since this mutator has side effects on the involved state, it is not possible to go past the next interactive continuation in the backtrace. (Doing so would break the rule that only states appearing in an expression may be modified by that expression. Exactly reaching the next interactive continuation is possible since it is then possible to reuse that interactive context as is.)
| See also: | §•Debugger/resume §•Debugger/backtrace §•Debugger/contExit |
|
|