Sha256: 7494ae3fe89573bb0a1a424d6ae114fd8d673eab1996e6668fa2426e21a9fb50

Contents?: true

Size: 1.06 KB

Versions: 23

Compression:

Stored size: 1.06 KB

Contents

require 'byebug/command'
require 'byebug/helpers/parse'

module Byebug
  #
  # Implements the continue command.
  #
  # Allows the user to continue execution until the next stopping point, a
  # specific line number or until program termination.
  #
  class ContinueCommand < Command
    include Helpers::ParseHelper

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

    def self.description
      <<-EOD
        c[ont[inue]][ <line_number>]

        #{short_description}
      EOD
    end

    def self.short_description
      'Runs until program ends, hits a breakpoint or reaches a line'
    end

    def execute
      if @match[1]
        num, err = get_int(@match[1], 'Continue', 0, nil)
        return errmsg(err) unless num

        filename = File.expand_path(frame.file)
        unless Breakpoint.potential_line?(filename, num)
          return errmsg(pr('continue.errors.unstopped_line', line: num))
        end

        Breakpoint.add(filename, num)
      end

      processor.proceed!

      Byebug.stop if Byebug.stoppable?
    end
  end
end

Version data entries

23 entries across 22 versions & 3 rubygems

Version Path
dirwatch-0.0.2 vendor/bundle/ruby/2.3.0/gems/byebug-9.1.0/lib/byebug/commands/continue.rb
tdiary-5.0.6 vendor/bundle/gems/byebug-9.1.0/lib/byebug/commands/continue.rb
byebug-9.1.0 lib/byebug/commands/continue.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/byebug-9.0.6/lib/byebug/commands/continue.rb
tdiary-5.0.5 vendor/bundle/gems/byebug-9.0.6/lib/byebug/commands/continue.rb
tdiary-5.0.4 vendor/bundle/gems/byebug-9.0.6/lib/byebug/commands/continue.rb
byebug-9.0.6 lib/byebug/commands/continue.rb
byebug-9.0.5 lib/byebug/commands/continue.rb
byebug-9.0.4 lib/byebug/commands/continue.rb
byebug-9.0.3 lib/byebug/commands/continue.rb
byebug-9.0.2 lib/byebug/commands/continue.rb
byebug-9.0.1 lib/byebug/commands/continue.rb
byebug-9.0.0 lib/byebug/commands/continue.rb
byebug-8.2.5 lib/byebug/commands/continue.rb
byebug-8.2.4 lib/byebug/commands/continue.rb
byebug-8.2.3 lib/byebug/commands/continue.rb
byebug-8.2.2 lib/byebug/commands/continue.rb
byebug-8.2.1 lib/byebug/commands/continue.rb
byebug-8.2.0 lib/byebug/commands/continue.rb
byebug-8.1.0 lib/byebug/commands/continue.rb