Previous Up

5.6  The WAM debugger

In some cases it is interesting to have access to the WAM data structures. This sub-debugger allows the user to inspect/modify the contents of any stack or register of the WAM. The WAM debugger is invoked using the built-in predicate wam_debug/0 (section 5.3.1) or the W debugger command (section 5.5). The following table presents the specific commands of the WAM debugger:

CommandDescription
write A [N]write N terms starting at the address A using write/1 (section 8.14.6)
data A [N]display N words starting at the address A
modify A [N]display and modify N words starting at the address A
where Adisplay the real address corresponding to A
what RAdisplay what corresponds to the real address RA
deref Adisplay the dereferenced word starting at the address A
envir [SA]display the contents of the environment located at SA (or the current one)
backtrack [SA]display the contents of the choice-point located at SA (or the current one)
backtrack alldisplay all choice-points
quitquit the WAM debugger
helpdisplay a summary of available commands

In the above table the following conventions apply:

It is possible to only use the first letters of a commands and bank names when there is no ambiguity. Also the square brackets [ ] enclosing the index of a bank name can be omitted. For instance the following command (showing the contents of 25 consecutive words of the global stack from the index 3): data global[3] 25 can be abbreviated as: d g 3 25.


Copyright (C) 1999-2021 Daniel Diaz Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. More about the copyright
Previous Up