manpagez: man pages & more
info gawk
Home | html | info | man

gawk: Miscellaneous Debugger Commands

 
 14.3.6 Miscellaneous Commands
 -----------------------------
 
 There are a few more commands that do not fit into the previous
 categories, as follows:
 
 'dump' [FILENAME]
      Dump byte code of the program to standard output or to the file
      named in FILENAME.  This prints a representation of the internal
      instructions that 'gawk' executes to implement the 'awk' commands
      in a program.  This can be very enlightening, as the following
      Program::) demonstrates:
 
           gawk> dump
           -|        # BEGIN
           -|
           -| [  1:0xfcd340] Op_rule           : [in_rule = BEGIN] [source_file = brini.awk]
           -| [  1:0xfcc240] Op_push_i         : "~" [MALLOC|STRING|STRCUR]
           -| [  1:0xfcc2a0] Op_push_i         : "~" [MALLOC|STRING|STRCUR]
           -| [  1:0xfcc280] Op_match          :
           -| [  1:0xfcc1e0] Op_store_var      : O
           -| [  1:0xfcc2e0] Op_push_i         : "==" [MALLOC|STRING|STRCUR]
           -| [  1:0xfcc340] Op_push_i         : "==" [MALLOC|STRING|STRCUR]
           -| [  1:0xfcc320] Op_equal          :
           -| [  1:0xfcc200] Op_store_var      : o
           -| [  1:0xfcc380] Op_push           : o
           -| [  1:0xfcc360] Op_plus_i         : 0 [MALLOC|NUMCUR|NUMBER]
           -| [  1:0xfcc220] Op_push_lhs       : o [do_reference = true]
           -| [  1:0xfcc300] Op_assign_plus    :
           -| [   :0xfcc2c0] Op_pop            :
           -| [  1:0xfcc400] Op_push           : O
           -| [  1:0xfcc420] Op_push_i         : "" [MALLOC|STRING|STRCUR]
           -| [   :0xfcc4a0] Op_no_op          :
           -| [  1:0xfcc480] Op_push           : O
           -| [   :0xfcc4c0] Op_concat         : [expr_count = 3] [concat_flag = 0]
           -| [  1:0xfcc3c0] Op_store_var      : x
           -| [  1:0xfcc440] Op_push_lhs       : X [do_reference = true]
           -| [  1:0xfcc3a0] Op_postincrement  :
           -| [  1:0xfcc4e0] Op_push           : x
           -| [  1:0xfcc540] Op_push           : o
           -| [  1:0xfcc500] Op_plus           :
           -| [  1:0xfcc580] Op_push           : o
           -| [  1:0xfcc560] Op_plus           :
           -| [  1:0xfcc460] Op_leq            :
           -| [   :0xfcc5c0] Op_jmp_false      : [target_jmp = 0xfcc5e0]
           -| [  1:0xfcc600] Op_push_i         : "%c" [MALLOC|STRING|STRCUR]
           -| [   :0xfcc660] Op_no_op          :
           -| [  1:0xfcc520] Op_assign_concat  : c
           -| [   :0xfcc620] Op_jmp            : [target_jmp = 0xfcc440]
           -|
           ...
           -|
           -| [     2:0xfcc5a0] Op_K_printf         : [expr_count = 17] [redir_type = ""]
           -| [      :0xfcc140] Op_no_op            :
           -| [      :0xfcc1c0] Op_atexit           :
           -| [      :0xfcc640] Op_stop             :
           -| [      :0xfcc180] Op_no_op            :
           -| [      :0xfcd150] Op_after_beginfile  :
           -| [      :0xfcc160] Op_no_op            :
           -| [      :0xfcc1a0] Op_after_endfile    :
           gawk>
 
 'exit'
      Exit the debugger.  See the entry for 'quit', later in this list.
 
 'help'
 'h'
      Print a list of all of the 'gawk' debugger commands with a short
      summary of their usage.  'help COMMAND' prints the information
      about the command COMMAND.
 
 'list' ['-' | '+' | N | FILENAME':'N | N-M | FUNCTION]
 'l' ['-' | '+' | N | FILENAME':'N | N-M | FUNCTION]
      Print the specified lines (default 15) from the current source file
      or the file named FILENAME.  The possible arguments to 'list' are
      as follows:
 
      '-' (Minus)
           Print lines before the lines last printed.
 
      '+'
           Print lines after the lines last printed.  'list' without any
           argument does the same thing.
 
      N
           Print lines centered around line number N.
 
      N-M
           Print lines from N to M.
 
      FILENAME':'N
           Print lines centered around line number N in source file
           FILENAME.  This command may change the current source file.
 
      FUNCTION
           Print lines centered around the beginning of the function
           FUNCTION.  This command may change the current source file.
 
 'quit'
 'q'
      Exit the debugger.  Debugging is great fun, but sometimes we all
      have to tend to other obligations in life, and sometimes we find
      the bug and are free to go on to the next one!  As we saw earlier,
      if you are running a program, the debugger warns you when you type
      'q' or 'quit', to make sure you really want to quit.
 
 'trace' ['on' | 'off']
      Turn on or off continuous printing of the instructions that are
      about to be executed, along with the 'awk' lines they implement.
      The default is 'off'.
 
      It is to be hoped that most of the "opcodes" in these instructions
      are fairly self-explanatory, and using 'stepi' and 'nexti' while
      'trace' is on will make them into familiar friends.
 
© manpagez.com 2000-2018
Individual documents may contain additional copyright information.