# debug.nas -- debugging helpers #------------------------------------------------------------------------------ # # 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 # 2 frames (of which the first one is incomplete). # # 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.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.isnan() returns 1 if argument is an invalid number (NaN), # 0 if it's a valid number, and nil in all other cases # # debug.benchmark(, [, [, ]]) # ... runs function times (default: nil) # and prints total execution time in seconds, # prefixed with