This library implements predicates which are normally used in the interactive top-level shell to debug programs. A subset of them are available in the embeddable debugger.
Usage:debug_module(Module)
To debug the predicates in a module that module needs to be marked for debugging and re-loaded to be compiled in debug mode. This predicate marks module Module for debugging. This has two effects: The debugger will mark the module so that when predicates in this module are called the debugger is entered. In addition, the module is marked specially so that when (re)loaded it will be (re)compiled in debug mode. It also marks the module as 'modified' so that (re)loading this file or a main file that uses this module will force it to acrually be recompiled. Note that in addition to marking it for debugging the module needs to be reloaded after marking it, for all this to occur. In other words, the proper sequence to debug module m is:
This allows selecting which parts of the program are being debugged at the module level. It also allows having some modules loaded compiled in debug mode and others in standard mode (faster).
Usage:debug_module_source(Module)
The debugger will take into acount module Module (assuming it is is loaded in source-level debug mode). When issuing this command at the toplevel shell, the compiler is instructed also to set to interpret the loading mode of files defining that module and also to mark it as 'modified' so that (re)loading this file or a main file that uses this module will force it to be reloaded for source-level debugging.
Usage:nodebug_module(Module)
Unmark module Module for debugging. The debugger will not enter debug mode for module Module. When issuing this command at the toplevel shell, the compiler is instructed also to set to compile the loading mode of the iles defining that module, i.e., the module will be compiled in standard mode if reloaded.
Usage:
Switches the debugger on. The interpreter will stop at all ports of procedure boxes of spied predicates.
Usage:
Switches the debugger off. If there are any spy-points set then they will be kept but disabled.
Usage:
Start tracing, switching the debugger on if needed. The interpreter will stop at all leashed ports of procedure boxes of predicates either belonging to debugged modules or called from clauses of debugged modules. A message is printed at each stop point, expecting input from the user (write h to see the available options).
Usage:maxdepth(MaxDepth)
Set maximum invocation depth in debugging to MaxDepth. Calls to compiled predicates are not included in the computation of the depth.
Usage:spy(PredSpec)
Set spy-points on predicates belonging to debugged modules and which match PredSpec, switching the debugger on if needed. This predicate is defined as a prefix operator by the toplevel.
Usage:nospy(PredSpec)
Remove spy-points on predicates belonging to debugged modules which match PredSpec. This predicate is defined as a prefix operator by the toplevel.
Usage:
Remove all spy-points.
Usage:
Display debugger state.
Usage:leash(Ports)
Leash on ports Ports, some of call, exit, redo, fail. By default, all ports are on leash.
Usage:breakpt(Pred,Src,Ln0,Ln1,Number,RealLine)
Set a breakpoint in file Src between lines Ln0 and Ln1 at the literal corresponding to the Number'th occurence of (predicate) name Pred. The pair Ln0-Ln1 uniquely identifies a program clause and must correspond to the start and end line numbers for the clause. The rest of the arguments provide enough information to be able to locate the exact literal that the RealLine line refers to. This is normally not issued by users but rather by the emacs mode, which automatically computes the different argument after selecting a point in the source file.
Usage:
Prints out the location of all breakpoints. The location of the breakpoints is showed usual by referring to the source file, the lines between which the predicate can be found, the predicate name and the number of occurrence of the predicate name of the literal.
Usage:nobreakpt(Pred,Src,Ln0,Ln1,Number,RealLine)
Remove a breakpoint in file Src between lines Ln0 and Ln1 at the Number'th occurence of (predicate) name Pred (see breakpt/6). Also normally used from de emacs mode.
Usage:
Remove all breakpoints.