aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debugger/doc/src/i.xml
blob: 628b91e9e4e25aa568070995f3d319baa14499de (plain) (blame)
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>
  <header>
    <copyright>
      <year>1998</year><year>2016</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
 
          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    
    </legalnotice>

    <title>i</title>
    <prepared></prepared>
    <docno></docno>
    <date></date>
    <rev></rev>
  </header>
  <module>i</module>
  <modulesummary>Debugger/Interpreter Interface.</modulesummary>
  <description>
    <p>The <c>i</c> module provides short forms for some of
      the functions used by the graphical Debugger and some of
      the functions in module
      <seealso marker="int"><c>int</c></seealso>, the Erlang interpreter.</p>

    <p>This module also provides facilities for displaying status
      information about interpreted processes and break points.</p>

    <p>It is possible to attach to interpreted processes by giving
      the corresponding process identity only. By default, an attachment
      window is displayed. Processes at other Erlang nodes can be
      attached manually or automatically.</p>

    <p>By preference, these functions can be included in module
      <seealso marker="stdlib:shell_default"><c>shell_default</c></seealso>.
      By default, they are included in that module.</p>
  </description>

  <funcs>
    <func>
      <name>im() -> pid()</name>
      <fsummary>Start a graphical monitor.</fsummary>
      <desc>
	<p>Starts a new graphical monitor. This is the Monitor window,
	  the main window of Debugger. All the Debugger and
	  interpreter functionality is accessed from the Monitor window.
	  This window displays the status of all processes that 
	  have been or are executing interpreted modules.</p>
      </desc>
    </func>

    <func>
      <name>ii(AbsModules) -> ok</name>
      <name>ii(AbsModule) -> {module, Module} | error</name>
      <name>ini(AbsModules) -> ok</name>
      <name>ini(AbsModule) -> {module, Module} | error</name>
      <fsummary>Interpret a module.</fsummary>
      <type>
	<v>AbsModules = [AbsModule]</v>
	<v>AbsModule = Module | File</v>
	<v>&nbsp;Module = atom()</v>
	<v>&nbsp;File = string()</v>
      </type>
      <desc>
	<p>Interprets the specified module(s). <c>ii/1</c> interprets
	  the module(s) only at the current node, see
	  <seealso marker="int#i/1">int:i/1</seealso>. <c>ini/1</c>
	  interprets the module(s) at all known nodes, see
	  <seealso marker="int#ni/1">int:ni/1</seealso>.</p>
      </desc>
    </func>

    <func>
      <name>iq(AbsModule) -> ok</name>
      <name>inq(AbsModule) -> ok</name>
      <fsummary>Stop interpreting a module.</fsummary>
      <type>
	<v>AbsModule = Module | File</v>
	<v>&nbsp;Module = atom()</v>
	<v>&nbsp;File = string()</v>
      </type>
      <desc>
	<p>Stops interpreting the specified module. <c>iq/1</c> stops
	  interpreting the module only at the current node. <c>inq/1</c>
	  stops interpreting the module at all known nodes.</p>
      </desc>
    </func>

    <func>
      <name>il() -> ok</name>
      <fsummary>Make a printout of all interpreted modules</fsummary>
      <desc>
	<p>Makes a printout of all interpreted modules.
	  Modules are printed together with the full path name of the 
	  corresponding source code file.</p>
      </desc>
    </func>

    <func>
      <name>ip() -> ok</name>
      <fsummary>Print the current status of all interpreted
	processes.</fsummary>
      <desc>
	<p>Prints the current status of all interpreted processes.</p>
      </desc>
    </func>

    <func>
      <name>ic() -> ok</name>
      <fsummary>Clear information about processes executing interpreted
	code.</fsummary>
      <desc>
	<p>Clears information about processes executing interpreted code
	  by removing all information about terminated processes.</p>
      </desc>
    </func>

    <func>
      <name>iaa(Flags) -> true</name>
      <name>iaa(Flags, Function) -> true</name>
      <fsummary>Set when and how to attach to a process.</fsummary>
      <type>
	<v>Flags = [init | break | exit]</v>
	<v>Function = {Module,Name,Args}</v>
	<v>&nbsp;Module = Name = atom()</v>
	<v>&nbsp;Args = [term()]</v>
      </type>
      <desc>
	<p>Sets when and how to attach to a debugged process
          automatically, see
	  <seealso marker="int#auto_attach/0">int:auto_attach/2</seealso>.
	  <c>Function</c> defaults to the standard function used by
	  Debugger.</p>
      </desc>
    </func>

    <func>
      <name>ist(Flag) -> true</name>
      <fsummary>Set how to save call frames.</fsummary>
      <type>
	<v>Flag = all | no_tail | false</v>
      </type>
      <desc>
	<p>Sets how to save call frames in the stack, see
	  <seealso marker="int#stack_trace/0">int:stack_trace/1</seealso>.</p>
      </desc>
    </func>

    <func>
      <name>ia(Pid) -> ok | no_proc</name>
      <fsummary>Attache to a process.</fsummary>
      <type>
	<v>Pid = pid()</v>
      </type>
      <desc>
	<p>Attaches to the debugged process <c>Pid</c>. An
	  Attach Process window is opened for the process.</p>
      </desc>
    </func>

    <func>
      <name>ia(X,Y,Z) -> ok | no_proc</name>
      <fsummary>Attache to a process.</fsummary>
      <type>
	<v>X = Y = Z = int()</v>
      </type>
      <desc>
	<p>Same as <c>ia(Pid)</c>, where <c>Pid</c> is the result of
	  calling the shell function <c>pid(X,Y,Z)</c>.</p>
      </desc>
    </func>

    <func>
      <name>ia(Pid, Function) -> ok | no_proc</name>
      <fsummary>Attache to a process.</fsummary>
      <type>
	<v>Pid = pid()</v>
	<v>Function = {Module,Name}</v>
	<v>&nbsp;Module = Name = atom()</v>
      </type>
      <desc>
	<p>Attaches to the debugged process <c>Pid</c>. The interpreter
	  calls <c>spawn(Module, Name, [Pid])</c> (and ignores
	  the result).</p>
      </desc>
    </func>

    <func>
      <name>ia(X,Y,Z, Function) -> ok | no_proc</name>
      <fsummary>Attache to a process.</fsummary>
      <type>
	<v>X = Y = Z = int()</v>
	<v>Function = {Module,Name}</v>
	<v>&nbsp;Module = Name = atom()</v>
      </type>
      <desc>
	<p>Same as <c>ia(Pid, Function)</c>, where <c>Pid</c> is
	  the result of calling the shell function <c>pid(X,Y,Z)</c>.
	  An attached process is expected to call the unofficial
	  function <c>int:attached(Pid)</c> and to be able to handle
	  messages from the interpreter. For an example, see
	  <c>dbg_wx_trace.erl</c>.</p>
      </desc>
    </func>

    <func>
      <name>ib(Module, Line) -> ok | {error, break_exists}</name>
      <fsummary>Create a breakpoint.</fsummary>
      <type>
	<v>Module = atom()</v>
	<v>Line = int()</v>
      </type>
      <desc>
	<p>Creates a breakpoint at <c>Line</c> in <c>Module</c>.</p>
      </desc>
    </func>

    <func>
      <name>ib(Module, Name, Arity) -> ok | {error, function_not_found}
      </name>
      <fsummary>Create breakpoints in the specified function.</fsummary>
      <type>
	<v>Module = Name = atom()</v>
	<v>Arity = int()</v>
      </type>
      <desc>
	<p>Creates breakpoints at the first line of every clause of 
	  function <c>Module:Name/Arity</c>.</p>
      </desc>
    </func>

    <func>
      <name>ir() -> ok</name>
      <fsummary>Delete all breakpoints.</fsummary>
      <desc>
	<p>Deletes all breakpoints.</p>
      </desc>
    </func>

    <func>
      <name>ir(Module) -> ok</name>
      <fsummary>Delete all breakpoints in a module.</fsummary>
      <type>
	<v>Module = atom()</v>
      </type>
      <desc>
	<p>Deletes all breakpoints in <c>Module</c>.</p>
      </desc>
    </func>

    <func>
      <name>ir(Module, Line) -> ok</name>
      <fsummary>Delete a breakpoint.</fsummary>
      <type>
	<v>Module = atom()</v>
	<v>Line = int()</v>
      </type>
      <desc>
	<p>Deletes the breakpoint at <c>Line</c> in <c>Module</c>.</p>
      </desc>
    </func>

    <func>
      <name>ir(Module, Name, Arity) -> ok | {error, function_not_found}
      </name>
      <fsummary>Delete breakpoints from the specified function.</fsummary>
      <type>
	<v>Module = Name = atom()</v>
	<v>Arity = int()</v>
      </type>
      <desc>
	<p>Deletes the breakpoints at the first line of every clause of 
	  function <c>Module:Name/Arity</c>.</p>
      </desc>
    </func>

    <func>
      <name>ibd(Module, Line) -> ok</name>
      <fsummary>Make a breakpoint inactive.</fsummary>
      <type>
	<v>Module = atom()</v>
	<v>Line = int()</v>
      </type>
      <desc>
	<p>Makes the breakpoint at <c>Line</c> in <c>Module</c> inactive.</p>
      </desc>
    </func>

    <func>
      <name>ibe(Module, Line) -> ok</name>
      <fsummary>Make a breakpoint active.</fsummary>
      <type>
	<v>Module = atom()</v>
	<v>Line = int()</v>
      </type>
      <desc>
	<p>Makes the breakpoint at <c>Line</c> in <c>Module</c> active.</p>
      </desc>
    </func>

    <func>
      <name>iba(Module, Line, Action) -> ok</name>
      <fsummary>Set the trigger action of a breakpoint.</fsummary>
      <type>
	<v>Module = atom()</v>
	<v>Line = int()</v>
	<v>Action = enable | disable | delete</v>
      </type>
      <desc>
	<p>Sets the trigger action of the breakpoint at <c>Line</c> in
	  <c>Module</c> to <c>Action</c>.</p>
      </desc>
    </func>

    <func>
      <name>ibc(Module, Line, Function) -> ok</name>
      <fsummary>Set the conditional test of a breakpoint.</fsummary>
      <type>
	<v>Module = atom()</v>
	<v>Line = int()</v>
	<v>Function = {Module,Name}</v>
	<v>&nbsp;Name = atom()</v>
      </type>
      <desc>
	<p>Sets the conditional test of the breakpoint at <c>Line</c> in
	  <c>Module</c> to <c>Function</c>.</p>

	<p>The conditional test is performed by calling
	  <c>Module:Name(Bindings)</c>, where <c>Bindings</c> is
	  the current variable bindings. The function must return
	  <c>true</c> (break) or <c>false</c> (do not break).
	  To retrieve the value of a variable <c>Var</c>, use
	  <seealso marker="int#get_binding/2">int:get_binding(Var, Bindings)</seealso>.</p>
      </desc>
    </func>

    <func>
      <name>ipb() -> ok</name>
      <fsummary>Print all existing breakpoints.</fsummary>
      <desc>
	<p>Prints all existing breakpoints.</p>
      </desc>
    </func>

    <func>
      <name>ipb(Module) -> ok</name>
      <fsummary>Print all existing breakpoints in a module.</fsummary>
      <type>
	<v>Module = atom()</v>
      </type>
      <desc>
	<p>Prints all existing breakpoints in <c>Module</c>.</p>
      </desc>
    </func>

    <func>
      <name>iv() -> atom()</name>
      <fsummary>Return the current version number of the interpreter.
      </fsummary>
      <desc>
	<p>Returns the current version number of the interpreter.
	  Same as the version number of the Debugger application.</p>
      </desc>
    </func>

    <func>
      <name>help() -> ok</name>
      <fsummary>Print help text.</fsummary>
      <desc>
	<p>Prints help text.</p>
      </desc>
    </func>
  </funcs>

  <section>
  <title>See Also</title>
    <p><seealso marker="int"><c>int(3)</c></seealso></p>
  </section>
</erlref>