Discussion:
getting into trace mode.
James Lipton
2014-07-27 14:08:23 UTC
Permalink
Hello,

I type


?- trace.

at the prompt, and then execute my query and ciao doesn't trace.

The same occurs with
?- debug.

What do i need to do?

Regards
JL
c***@clip.dia.fi.upm.es
2014-08-04 11:35:04 UTC
Permalink
Post by James Lipton
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
--
----------------------- The Ciao System Development Team --------------------
The CLIP Group | IMDEA Software Institute
***@clip.dia.fi.upm.es | and Technical University of Madrid
http://www.ciao-lang.org / http://www.cliplab.org
-----------------------------------------------------------------------------
c***@clip.dia.fi.upm.es
2014-08-12 23:42:45 UTC
Permalink
Sorry, a correction (I got the debug_module commands backwards):

- For a 'user file' (file with no module declaration):

?- debug_module(user).
?- ensure_loaded('/tmp/foo.pl').
?- trace.

- For a module:

?- debug_module(foo).
?- use_module('/tmp/foo.pl').
?- trace.

Then:

?- p(X).
1 1 Call: user:p(X) ?
--
----------------------- The Ciao System Development Team --------------------
The CLIP Group | IMDEA Software Institute
***@clip.dia.fi.upm.es | and Technical University of Madrid
http://www.ciao-lang.org / http://www.cliplab.org
-----------------------------------------------------------------------------
Loading...