Sha256: d416d0ee5214bb7258662e4b5fea39d7542a9ad8646af1ac288bc0d24849721d

Contents?: true

Size: 1.11 KB

Versions: 12

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

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
      <<-DESCRIPTION
        c[ont[inue]][ <line_number>]

        #{short_description}
      DESCRIPTION
    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

12 entries across 12 versions & 5 rubygems

Version Path
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/gems/byebug-10.0.2/lib/byebug/commands/continue.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/byebug-10.0.2/lib/byebug/commands/continue.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/byebug-10.0.2/lib/byebug/commands/continue.rb
dadapush_client-1.0.1 vendor/bundle/ruby/2.3.0/gems/byebug-10.0.2/lib/byebug/commands/continue.rb
jets-0.5.5 vendor/lambdagem/bundled/gems/ruby/2.5.0/gems/byebug-10.0.0/lib/byebug/commands/continue.rb
jets-0.5.4 vendor/lambdagem/bundled/gems/ruby/2.5.0/gems/byebug-10.0.0/lib/byebug/commands/continue.rb
jets-0.5.3 vendor/lambdagem/bundled/gems/ruby/2.5.0/gems/byebug-10.0.0/lib/byebug/commands/continue.rb
jets-0.5.2 vendor/lambdagem/bundled/gems/ruby/2.5.0/gems/byebug-10.0.0/lib/byebug/commands/continue.rb
jets-0.5.1 vendor/lambdagem/bundled/gems/ruby/2.5.0/gems/byebug-10.0.0/lib/byebug/commands/continue.rb
byebug-10.0.2 lib/byebug/commands/continue.rb
byebug-10.0.1 lib/byebug/commands/continue.rb
byebug-10.0.0 lib/byebug/commands/continue.rb