| Class | Debugger::FinishCommand |
| In: |
cli/ruby-debug/commands/finish.rb
|
| Parent: | Command |
Implements the debugger ‘finish’ command.
# File cli/ruby-debug/commands/finish.rb, line 29
29: def help(cmd)
30: %{
31: fin[ish] [frame-number]\tExecute until selected stack frame returns.
32:
33: If no frame number is given, we run until the currently selected frame
34: returns. The currently selected frame starts out the most-recent
35: frame or 0 if no frame positioning (e.g "up", "down" or "frame") has
36: been performed. If a frame number is given we run until that frame
37: returns.
38: }
39: end
# File cli/ruby-debug/commands/finish.rb, line 11
11: def execute
12: max_frame = @state.context.stack_size - @state.frame_pos
13: if !@match[1] or @match[1].empty?
14: frame_pos = @state.frame_pos
15: else
16: frame_pos = get_int(@match[1], "Finish", 0, max_frame-1, 0)
17: return nil unless frame_pos
18: end
19: @state.context.stop_frame = frame_pos
20: @state.frame_pos = 0
21: @state.proceed
22: end