next up previous contents index
Next: Definite Clause Grammars Up: Debugging Previous: High-Level Tracing   Contents   Index


Low-Level Tracing

XSB also provides a facility for low-level tracing of execution. This can be activated by invoking the emulator with the -T option (see Section 3.5), or through the predicate trace/0. It causes trace information to be printed out at every call (including those to system trap handlers). The volume of such trace information can very become large very quickly, so this method of tracing is not recommended in general.

XSB debugger also provides means for the low-level control of what must be traced. Normally, various low-level predicates are masked out from the trace, since these predicates do not make sense to the application programmer. However, if tracing below the application level is needed, you can retract some of the facts specified in the file syslib/debugger_data.P (and in some cases assert into them). All these predicates are documented in the header of that file. Here we only mention the four predicates that an XSB developer is more likely to need. To get more trace, you should retract from the first three predicates and assert into the last one.

In principle, by retracting all facts from the first three predicates and asserting enough facts into the last one, it is possible to achieve the behavior that approximates the -T option. However, unlike -T, debugging can be done interactively. This does not obviate -T, however. First, it is easier to use -T than to issue multiple asserts and retracts. Second, -T can be used when the error occurs early on, before the moment when XSB shows its first prompt.


next up previous contents index
Next: Definite Clause Grammars Up: Debugging Previous: High-Level Tracing   Contents   Index
Baoqiu Cui
2000-04-23