Class: Byebug::ContinueCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/byebug/commands/continue.rb

Overview

Implements byebug “continue” command.

Constant Summary

Constants inherited from Command

Byebug::Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match, method_missing, options, register_setting_get, register_setting_set, register_setting_var, settings, settings_map

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



30
31
32
33
34
35
36
# File 'lib/byebug/commands/continue.rb', line 30

def description
  %{
    c[ont[inue]][ nnn]

    Run until program ends, hits a breakpoint or reaches line nnn
  }
end

.namesObject



26
27
28
# File 'lib/byebug/commands/continue.rb', line 26

def names
  %w(continue)
end

Instance Method Details

#executeObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/byebug/commands/continue.rb', line 12

def execute
  if @match[1] && !@state.context.dead?
    filename = File.expand_path(@state.file)
    return unless line_number = get_int(@match[1], "Continue", 0, nil, 0)
    return errmsg "Line #{line_number} is not a stopping point in file " \
                  "\"#{filename}\"\n" unless
      LineCache.trace_line_numbers(filename).member?(line_number)

    Byebug.add_breakpoint filename, line_number
  end
  @state.proceed
end

#regexpObject



8
9
10
# File 'lib/byebug/commands/continue.rb', line 8

def regexp
  /^\s* c(?:ont(?:inue)?)? (?:\s+(.*))? $/x
end