# debug.nas -- debugging helpers #------------------------------------------------------------------------------ # # debug.color(); ... turns terminal colors on (1) or off (0) # # debug.dump() ... dumps contents of variable to terminal; # abbreviation for print(debug.string(v)) # # debug.local([]) ... dump local variables of current # or given frame # # debug.backtrace([]} ... writes backtrace with local variables # (similar to gdb's "bt full) # # debug.proptrace([]]) ... trace property write/add/remove # events under the subtree for # a number of frames. Defaults are "/" and # 1 frame. # # debug.tree([ [, ]) ... dump property tree under property path # or props.Node hash (default: root). If # is unset or 0, use flat mode # (similar to props.dump()), otherwise # use space indentation # # debug.exit() ... exits fgfs # # debug.bt() ... abbreviation for debug.backtrace() # # debug.string() ... returns contents of variable as string # debug.attributes( [, ]) ... returns attribute string for a given property. # ose is by default 1, and suppressed the # node's refcounter if 0. # # debug.benchmark(, []) # ... calls function with optional args and # prints execution time in seconds, # prefixed with