Hello,
I type
?- trace.
at the prompt, and then execute my query and ciao doesn't trace.
The same occurs with ?- debug.
Hi Jim, the Ciao debugger is modular, so that you can turn debugging on or off for each of the modules of a large project. This allows easily mixing code not being debugged (compiled for speed, space savings) with code compiled in debug mode. It also has source debugging capabilities, i.e., it traces execution through the source code (graphically if within Emacs or other environments). In order to use it, assuming we want to trace file foo.pl:
- Easiest way: within Emacs, open foo.pl and type 'C-c d' (or, via menus CiaoDbg->(Un)Debug buffer source). The foo module will be automatically reloaded in debug mode and set to trace, and queries to it will be traced in the source file.
- You can also do it manually (e.g., at a shell, outside the graphical environment). You mark the module or user file for debugging and reload. The debugger then needs to be set to trace:
- For a module:
?- debug_module(user). ?- use_module('/tmp/foo.pl'). ?- trace.
- For a 'user file' (file with no module declaration):
?- debug_module(foo). ?- ensure_loaded('/tmp/foo.pl'). ?- trace.
Then:
?- p(X). 1 1 Call: user:p(X) ?
Using debug_module_source(...) makes the debugger print source location information (works best within Emacs, etc.).
Let us know if you have any problems!
MH