We hope you find the gawk
debugger useful and enjoyable to work with,
but as with any program, especially in its early releases, it still has
some limitations. A few that it’s worth being aware of are:
gawk
internals),
you will realize that much of the internal manipulation of data
in gawk
, as in many interpreters, is done on a stack.
Op_push
, Op_pop
, and the like are the “bread and butter” of
most gawk
code.
Unfortunately, as of now, the gawk
debugger does not allow you to examine the stack’s contents.
That is, the intermediate results of expression evaluation are on the
stack, but cannot be printed. Rather, only variables that are defined
in the program can be printed. Of course, a workaround for
this is to use more explicit variables at the debugging stage and then
change back to obscure, perhaps more optimal code later.
awk
programmer, you are expected to know the meaning of
/[^[:alnum:][:blank:]]/
.
gawk
debugger is designed to be used by running a program (with all its
parameters) on the command line, as described in How to Start the Debugger.
There is no way (as of now) to attach or “break into” a running program.
This seems reasonable for a language that is used mainly for quickly
executing, short programs.
gawk
debugger only accepts source code supplied with the -f option.
If you have a shell script that provides an awk
program as a command
line parameter, and you need to use the debugger, you can write the script
to a temporary file, and use that as the program, with the -f option. This
might look like this:
cat << \EOF > /tmp/script.$$ ... Your program here EOF gawk -D -f /tmp/script.$$ rm /tmp/script.$$