Class: Byebug::ContinueCommand

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

Overview

Implements byebug “continue” command.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



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

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

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

.namesObject



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

def names
  %w(continue)
end

Instance Method Details

#executeObject



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

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



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

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