3
Invoking dgawk is similar to gawk. Run dgawk with all options and arguments as
4
you would supply to gawk. Command line scripts can not be debugged using dgawk.
5
dgawk expects at least one program text included via the -f option. If you include
6
programs using the --source option, dgawk will not stop at instructions originating
28
prints a list of all commands and short descriptions.
29
'help command' prints the information about command 'command'.
31
* info source|sources|variables|functions|break|frame|args|locals|display|watch
33
name of the current source file. Each time the program stops, the
34
current source file is the file containing the current instruction.
35
When dgawk first starts, the current source file is the first file
36
included via the -f option. The 'list filename:lineno' command can
37
be used at any time to change the current source.
39
list all program sources.
41
list all global variables.
43
list all function definitions including source file names and
46
list all currently set breakpoints.
48
description of the selected stack frame.
50
arguments of the selected frame.
52
local variables of the selected frame.
54
list of all items in the automatic display list.
56
list of all items in the watch list.
58
* list [-|+|n|filename:n|m-n|function]
59
prints specified lines (default 15) from the current source file
60
or file named 'filename'.
61
- print lines before the lines last printed.
62
+ print lines after the lines last printed.
63
list without any argument does the same thing.
64
n print lines centered around line number 'n'.
65
m-n print lines from 'm' to 'n'.
66
filename:n print lines centered around line number 'n' in
67
source file 'filename'. May change current source file.
68
function print lines centered around beginning of the
69
function 'function'. May change current source file.
71
* break [[filename:]n|function]
72
Without any argument, sets a breakpoint at the next instruction
73
to be executed in the selected stack frame.
74
n set a breakpoint at line number 'n' in the current
76
filename:n set a breakpoint at line number 'n' in source file
78
function set a breakpoint at entry to function (first instruction)
81
* tbreak [[filename:]n|function]
82
set a temporary breakpoint (enabled for only one stop).
84
* disable [n1 n2 ...] [m-n]
85
disable specified breakpoints or a range of breakpoints. Without
86
any argument, disables all breakpoints.
88
* enable [once|del] [n1 n2 ...] [m-n]
89
enable specified breakpoints or a range of breakpoints. Without
90
any argument, enables all breakpoints.
91
once enable breakpoint(s) temporarily, then disable it when
92
the program stops at the breakpoint.
93
del enable breakpoint(s) tempoarily, then delete it when
94
the program stops at the breakpoint.
96
* delete [n1 n2 ...] [m-n]
97
delete specified breakpoints or a range of breakpoints. Deletes
98
all defined breakpoints if no argument is supplied.
100
* clear [[filename:]n|function]
101
without any argument, deletes any breakpoint at the next instruction
102
to be executed in the selected stack frame. If the program stops at
103
a breakpoint, this will delete that breakpoint so that the program
104
does not stop at that location again.
105
n delete breakpoint(s) set at line number 'n' in current
107
filename:n delete breakpoint(s) set at line number 'n' in source
109
function delete breakpoint(s) set at entry to function 'function'.
112
ignore breakpoint N COUNT times before stopping.
115
starts/restarts execution of the program. When restarting, dgawk retains
116
current breakpoints, watchpoints, command history, automatic display
117
variables and debugger options.
120
select and print (frame number, function and argument names, source file,
121
and the source line) stack frame N. Frame 0 is the currently executing
122
or innermost frame (function call), frame 1 is the frame that called the
123
innermost one. The highest numbered frame is the one for 'main'.
126
move COUNT (default 1) frames up the stack toward the outermost frame.
127
selects and prints the frame.
130
move COUNT (default 1) frames down the stack toward the innermost frame.
131
selects and prints the frame.
134
print backtrace of all function calls (stack frames), or innermost COUNT
135
frames if COUNT > 0. Prints outermost -COUNT frames for COUNT < 0.
136
Displays name and arguments to each function, source filename and line number.
139
resume program execution. If continued from a breakpoint and COUNT is
140
specified, ignores the breakpoint at that location next COUNT times before
144
continue execution until control reaches a different source line in the
145
current stack frame. Step steps inside any function called within the line.
146
If the argument COUNT is supplied, steps that many times before stopping,
147
unless it encounters a breakpoint (or watchpoint).
150
continue execution to the next source line, stepping over function calls.
151
The argument COUNT controls how many times to repeat the action as
155
execute one (or COUNT) instruction(s), stepping inside function calls.
158
execute one (or COUNT) instruction(s), stepping over function calls.
161
execute program until the selected stack frame returns.
162
Prints the returned value.
165
cancel execution of a function call. If 'value' (either string or number)
166
is specified, it is used as the function's return value. If used in a
167
frame other than the the innermost one (currently executing function i.e.
168
frame number 0), discards all outer frames in addition to the selected one,
169
and the caller of that frame becomes the innermost frame.
171
* until [[filename:]n|function]
172
without any argument, continues execution until a line past the current
173
line in current stack frame is reached. With argument,
174
continues execution until the specified location is reached, or the current
177
* print var1[,|\s|\t var2 ...]
178
print the value of a gawk variable or field. Fields must be referenced by
181
prints the third field in the input record (if the specified field does not
182
exist, it will print 'Null field'). Variable can be an array element, with
183
the subscripts being constant values. To print the contents of an array,
184
prefix the name of the array with the '@' symbol:
186
prints the index and the corresponding value for all elements in array 'a'.
188
* printf format, [arg], ...
189
print formatted text. May include escape sequences, such as `\n'.
190
No newline is printed unless specified one.
193
assign a constant (number or string) value to a gawk variable or field.
194
String values must be enclosed between double quotes(").
197
add variable 'var' (or field $n) to the automatic display list. The
198
value of the variable or field is displayed each time the program stops.
199
Each variable added to the list is identified by a unique number:
202
displays the assigned item number, the variable name and its current value.
203
If the display variable refers to a function parameter, it is silently
204
deleted from the list as soon as the execution reaches a context where
205
no such variable of the given name exists.
206
Without argument, displays the current values of items on the list.
209
remove item number N (or all items) from the automatic display list.
212
add variable 'var' (or field $n) to the watch list. dgawk will stop whenever
213
the value of the variable or field changes. Each watched item is assigned a
214
number which can be used to delete it from the watch list using the
218
remove item number N (or all items) from the watch list.
220
* option [name[=value]]
221
without argument, displays the available debugger options
222
and their current values. 'option name' shows the current
223
value of the named option. 'option name=value' assigns
224
a new value to the named option.
227
the number of lines that list prints. The default is 15.
229
debugger prompt. The default is "dgawk> ".
231
turns instruction tracing on or off. The default is off.
233
sends gawk output to a file; debugger output still goes
234
to stdout. An empty string ("") resets output to stdout.
235
* save_history [on|off]
236
save command history to file ./.dgawk_history. The default is 'on'.
238
maximum no of lines to keep in history file ./.dgawk_history.
240
* save_options [on|off]
241
save current options to file ./.dgawkrc on quit. The default is 'on'.
242
Options are read back in next session on startup.
247
'commands' sets list of commands to be executed when stopped at
248
a breakpoint or watchpoint. N is the breakpoint or watchpoint number.
249
Without a number, refers to the last one set. The actual commands follow
250
starting on the next line and are terminated by the 'end' command.
251
If the command 'silent' is in the list, the usual messages about stopping
252
at a breakpoint and the sourceline are not printed. Any command
253
in the list that resumes execution (e.g. continue) terminates the list
254
(an implicit end), and subsequent commands are ignored.
258
> printf "A silent breakpoint; i = %d\n", i
266
run command(s) from a file; an error in any command does not
267
terminate execution of subsequent commands. Comments (lines starting
268
with #) are allowed in a command file. Empty lines are ignored, does not
269
repeat last command. Can't restart program by having more than one run
271
Can also use the '-R file' OR '--command=file' command line option to
272
execute commands from a file non-interactively.
275
saves the commands from the current session to the given filename,
276
so it can be replayed using the source command.
284
If compiled with readline library, you can take advantage of its command
285
completion and history expansion feature. The following types of completion
289
* source filename completion
290
source file names. Relevant commands are list, break, tbreak, until,
292
* argument completion
293
non-number arguments to a command. Relevant commands are info and enable.
294
* variable name completion
295
global variable names, and function arguments in the current context
296
if the program is running. Relevant commands are print, set, watch,
301
* Debugging with GDB, the manual for the GNU Source-Level Debugger.
302
Much of the contents of this README shamelessly stolen and adapted from it.
303
* GNU Readline User's Manual
304
* GNU History User's Manual