Implements debugger “where” or “backtrace” command.
# File cli/ruby-debug/commands/frame.rb, line 180 def help(cmd) s = if cmd == 'where' %Q{ w[here]\tdisplay stack frames } else %Q{ bt|backtrace\t\talias for where - display stack frames } end s += %Q{ Print the entire stack frame. Each frame is numbered, the most recent frame is 0. frame number can be referred to in the "frame" command; "up" and "down" add or subtract respectively to frame numbers shown. The position of the current frame is marked with -->. } end
# File cli/ruby-debug/commands/frame.rb, line 176 def help_command %wwhere backtrace| end
# File cli/ruby-debug/commands/frame.rb, line 160 def execute (0...@state.context.stack_size).each do |idx| if idx == @state.frame_pos print "--> " else print " " end print_frame(idx) end if truncated_callstack?(@state.context, Debugger.start_sentinal) print "Warning: saved frames may be incomplete; compare with caller(0).\n" end end
# File cli/ruby-debug/commands/frame.rb, line 156 def regexp /^\s*(?:w(?:here)?|bt|backtrace)$/ end