users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: debugging


From: Adam Russell
Subject: Re: debugging
Date: Fri, 7 May 2021 02:12:48 +0000

Yes, the usual trace/0 and spy points abilities are available http://www.gprolog.org/manual/html_node/gprolog013.html

Here is a simple example

$ gprolog
GNU Prolog 1.4.5 (32 bits)
Compiled Dec  3 2020, 00:37:14 with gcc
By Daniel Diaz
Copyright (C) 1999-2020 Daniel Diaz
| ?- [user].
compiling user for byte code...
something(A):- something_else(A).
something_else(A):- A is 2 + 2.

user compiled, 2 lines read - 414 bytes written, 19475 ms

(10 ms) yes
| ?- spy(something_else).
Spypoint placed on something_else/1
The debugger will first leap -- showing spypoints (debug)

(1 ms) yes
{debug}
| ?- something(X).
 +    2    2  Call: something_else(_23) ?
      3    3  Call: _23 is 2+2 ?
      3    3  Exit: 4 is 2+2 ?
 +    2    2  Exit: something_else(4) ?
      1    1  Exit: something(4) ?

X = 4

(1 ms) yes
{debug}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]