14.3.5 Obtaining Information About The Program and The Debugger State
Besides looking at the values of variables, there is often a need to get
other sorts of information about the state of your program and of the
debugging environment itself. dgawk has one command which
provides this information, appropriately called info
. info
is used with one of a number of arguments that tell it exactly what
you want to know:
info
whati
what- The value for what should be one of the following:
args
- Arguments of the selected frame.
break
- List all currently set breakpoints.
display
- List all items in the automatic display list.
frame
- Description of the selected stack frame.
functions
- List all function definitions including source file names and
line numbers.
locals
- Local variables of the selected frame.
source
- The name of the current source file. Each time the program stops, the
current source file is the file containing the current instruction.
When dgawk first starts, the current source file is the first file
included via the -f option. The
‘list filename:lineno’ command can
be used at any time to change the current source.
sources
- List all program sources.
variables
- List all global variables.
watch
- List all items in the watch list.
Additional commands give you control over the debugger, the ability to
save the debugger's state, and the ability to run debugger commands
from a file. The commands are:
option
[name[=
value]]o
[name[=
value]]- Without an argument, display the available debugger options
and their current values. ‘option name’ shows the current
value of the named option. ‘option name=value’ assigns
a new value to the named option.
The available options are:
history_size
- The maximum number of lines to keep in the history file ./.dgawk_history.
The default is 100.
listsize
- The number of lines that
list
prints. The default is 15.
outfile
- Send gawk output to a file; debugger output still goes
to standard output. An empty string (
""
) resets output to
standard output.
prompt
- The debugger prompt. The default is ‘dgawk> ’.
save_history
[on
| off
]- Save command history to file ./.dgawk_history.
The default is
on
.
save_options
[on
| off
]- Save current options to file ./.dgawkrc upon exit.
The default is
on
.
Options are read back in to the next session upon startup.
trace
[on
| off
]- Turn instruction tracing on or off. The default is
off
.
save
filename- Save the commands from the current session to the given file name,
so that they can be replayed using the source command.
source
filename- Run command(s) from a file; an error in any command does not
terminate execution of subsequent commands. Comments (lines starting
with ‘#’) are allowed in a command file.
Empty lines are ignored; they do not
repeat the last command.
You can't restart the program by having more than one
run
command in the file. Also, the list of commands may include additional
source
commands; however, dgawk will not source the
same file more than once in order to avoid infinite recursion.
In addition to, or instead of the source
command, you can use
the -R file or --command=file command-line
options to execute commands from a file non-interactively
(see Options.