File: gprolog014.html

package info (click to toggle)
gprolog 1.3.0-6.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 13,512 kB
  • ctags: 8,954
  • sloc: ansic: 57,431; perl: 16,620; sh: 5,900; makefile: 1,284
file content (180 lines) | stat: -rw-r--r-- 8,472 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="gprolog.css">
<TITLE>
Debugger commands
</TITLE>
</HEAD>
<BODY TEXT=black BGCOLOR=white>
<A HREF="gprolog013.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="gprolog009.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="gprolog015.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H3 CLASS="subsection"><A NAME="htoc27">4.5</A>&nbsp;&nbsp;Debugger commands</H3>
<A NAME="Debugger-commands"></A>
When the debugger reaches a leashed port it shows the current goal followed
by the <TT>?</TT> symbol. At this point there are many commands available.
Typing <TT>RETURN</TT> will creep into the program. Continuing to creep will
show all the control flow. The debugger shows every port for every predicate
encountered during the execution. It is possible to select the ports at
which the debugger will prompt the user using the built-in predicate
<TT>leash/1</TT> (section&nbsp;<A HREF="gprolog012.html#Leashing-ports">4.3.2</A>). Each command is only one
character long:<BR>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1>
<TR><TD VALIGN=top ALIGN=center NOWRAP>Command</TD>
<TD VALIGN=top ALIGN=center NOWRAP>Name</TD>
<TD VALIGN=top ALIGN=left>Description</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>RET</TT> or <TT>c</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>creep</TD>
<TD VALIGN=top ALIGN=left>single-step to the next port</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>l</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>leap</TD>
<TD VALIGN=top ALIGN=left>continue the execution only stopping when a goal with a
spy-point is reached</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>s</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>skip</TD>
<TD VALIGN=top ALIGN=left>skip over the entire execution of the current goal. No
message will be shown until control returns</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>G</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>go to</TD>
<TD VALIGN=top ALIGN=left>ask for an invocation number and continue the execution
until a port is reached for that invocation number</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>r</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>retry</TD>
<TD VALIGN=top ALIGN=left>try to restart the invocation of the current goal by
failing until reaching the invocation of the goal. The state of
execution is the same as when the goal was initially invoked (except when
using side-effect predicates)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>f</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>fail</TD>
<TD VALIGN=top ALIGN=left>force the current goal to fail immediately</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>w</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>write</TD>
<TD VALIGN=top ALIGN=left>show the current goal using <TT>write/2</TT>
(section&nbsp;<A HREF="gprolog037.html#write-term/3">7.14.6</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>d</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>display</TD>
<TD VALIGN=top ALIGN=left>show the current goal using <TT>display/2</TT>
(section&nbsp;<A HREF="gprolog037.html#write-term/3">7.14.6</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>p</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>print</TD>
<TD VALIGN=top ALIGN=left>show the current goal using <TT>print/2</TT>
(section&nbsp;<A HREF="gprolog037.html#write-term/3">7.14.6</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>e</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>exception</TD>
<TD VALIGN=top ALIGN=left>show the pending exception. Only applicable to an
<TT>exception</TT> port</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>g</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>ancestors</TD>
<TD VALIGN=top ALIGN=left>show the list of ancestors of the current goal</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>A</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>alternatives</TD>
<TD VALIGN=top ALIGN=left>show the list of ancestors of the current goal
combined with choice-points</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>u</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>unify</TD>
<TD VALIGN=top ALIGN=left>ask for a term and unify the current goal with this
term. This is convenient for getting a specific solution. Only available at
a <TT>call</TT> port</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>.</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>father file</TD>
<TD VALIGN=top ALIGN=left>show the Prolog file name and the line number
where the current predicate is defined</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>n</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>no debug</TD>
<TD VALIGN=top ALIGN=left>switch the debugger off. Same as <TT>nodebug/0</TT>
(section&nbsp;<A HREF="gprolog012.html#Running-and-stopping-the-debugger">4.3.1</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>=</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>debugging</TD>
<TD VALIGN=top ALIGN=left>show debugger information. Same as
<TT>debugging/0</TT> (section&nbsp;<A HREF="gprolog012.html#Running-and-stopping-the-debugger">4.3.1</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>+</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>spy this</TD>
<TD VALIGN=top ALIGN=left>set a spy-point on the current goal. Uses
<TT>spy/1</TT> (section&nbsp;<A HREF="gprolog012.html#Spy-points">4.3.3</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>-</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>nospy this</TD>
<TD VALIGN=top ALIGN=left>remove a spy-point on the current goal. Uses
<TT>nospy/1</TT> (section&nbsp;<A HREF="gprolog012.html#Spy-points">4.3.3</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>*</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>spy conditionally</TD>
<TD VALIGN=top ALIGN=left>ask for a term <TT>Goal, Port, Test</TT>
(terminated by a dot) and set a conditional spy-point on the current
predicate. <TT>Goal</TT> and the current goal must have the same predicate
indicator. Uses <TT>spypoint_condition/3</TT> (section&nbsp;<A HREF="gprolog012.html#Spy-points">4.3.3</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>L</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>listing</TD>
<TD VALIGN=top ALIGN=left>list all the clauses associated with the current 
predicate. Uses <TT>listing/1</TT> (section&nbsp;<A HREF="gprolog046.html#listing/1">7.23.3</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>a</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>abort</TD>
<TD VALIGN=top ALIGN=left>abort the current execution. Same as <TT>abort/0</TT>
(section&nbsp;<A HREF="gprolog041.html#abort/0">7.18.1</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>b</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>break</TD>
<TD VALIGN=top ALIGN=left>invoke a recursive top-level. Same as <TT>break/0</TT>
(section&nbsp;<A HREF="gprolog041.html#abort/0">7.18.1</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>@</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>execute goal</TD>
<TD VALIGN=top ALIGN=left>ask for a goal and execute it</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>&lt;</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>set print depth</TD>
<TD VALIGN=top ALIGN=left>ask for an integer and set the print
depth to this value (<TT>-1</TT> for no depth limit)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>h</TT> or <TT>?</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>help</TD>
<TD VALIGN=top ALIGN=left>display a summary of available commands</TD>
</TR>
<TR><TD VALIGN=top ALIGN=center NOWRAP><TT>W</TT></TD>
<TD VALIGN=top ALIGN=center NOWRAP>WAM debugger</TD>
<TD VALIGN=top ALIGN=left>invoke the low-level WAM debugger
(section&nbsp;<A HREF="gprolog015.html#The-WAM-debugger">4.6</A>)</TD>
</TR></TABLE><BR>

<HR SIZE=2>
Copyright (C) 1999-2007 Daniel Diaz
<BR>
<BR>
Verbatim copying and distribution of this entire article is permitted in any
medium, provided this notice is preserved. <BR>
<BR>
<A HREF="index.html#copyright">More about the copyright</A>
<HR>
<A HREF="gprolog013.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="gprolog009.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="gprolog015.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>