The Erlang interpreter provides mechanisms for breakpoints and
stepwise execution of code. It is primarily intended to be used by
Debugger, see the User's Guide and
The following can be done from the shell:
By attaching to a process executing interpreted code, it
is possible to examine variable bindings and order stepwise
execution. This is done by sending and receiving information
to/from the process through a third process, called the meta
process. You can implement your own attached process. See
The interpreter depends on the Kernel, STDLIB, and GS applications. This means that modules belonging to any of these applications are not allowed to be interpreted, as it could lead to a deadlock or emulator crash. This also applies to modules belonging to the Debugger application.
Breakpoints are specified on a line basis. When a process executing code in an interpreted module reaches a breakpoint, it stops. This means that a breakpoint must be set at an executable line, that is, a code line containing an executable expression.
A breakpoint has the following:
By default, a breakpoint is active, has trigger action
Interprets the specified module(s).
A module can be specified by its module name (atom) or filename.
If specified by its module name, the object code
If specified by its filename, the filename can include a path
and the
The interpreter requires both the source code and the object
code. The object code must include debug
information, that is, only modules compiled with option
The functions returns
The argument can also be a list of modules or filenames, in
which case the function tries to interpret each module as
specified earlier. The function then always returns
Stops interpreting the specified module.
As for
Returns a list with all interpreted modules.
Returns the source code filename
Checks if a module can be interpreted. The module can be
specified by its module name
The function returns
The function returns
No source code is found.
It is assumed that the source code and object code are located
either in the same directory, or in
No object code is found.
It is assumed that the source code and object code are located
either in the same directory, or in
The module has not been compiled with option
Notice that the function can return
Gets and sets when and how to attach automatically to a
process executing code in interpreted modules.
When the specified event occurs, the function
spawn(Module, Name, [Pid | Args])
Gets and sets how to save call frames in the stack. Saving call frames makes it possible to inspect the call chain of a process, and is also used to emulate the stack trace if an error (an exception of class error) occurs. The following flags can be specified:
Save information about all current calls, that is, function calls that have not yet returned a value.
Save information about current calls, but discard previous information when a tail recursive call is made. This option consumes less memory and can be necessary to use for processes with long lifetimes and many tail recursive calls. This is the default.
Save no information about currentcalls.
Creates a breakpoint at
Deletes the breakpoint at
Creates a breakpoint at the first line of every clause of
function
Deletes the breakpoints at the first line of every clause of
function
Deletes all breakpoints, or all breakpoints in
Makes the breakpoint at
Makes the breakpoint at
Sets the trigger action of the breakpoint at
Sets the conditional test of the breakpoint at
Retrieves the binding of
Gets all breakpoints, or all breakpoints in
Gets information about all processes executing interpreted code.
Clears information about processes executing interpreted code by removing all information about terminated processes.
Resumes process execution for