Sha256: 581602275d7f244a77874ddaa8d8c1ffb84c2ed45327e95c231786ef2611fc50

Contents?: true

Size: 799 Bytes

Versions: 2

Compression:

Stored size: 799 Bytes

Contents

require 'byebug/helpers/thread'

module Byebug
  #
  # Reopens the +thread+ command to define the +stop+ subcommand
  #
  class ThreadCommand < Command
    #
    # Stops the specified thread
    #
    class StopSubcommand < Command
      include Helpers::ThreadHelper

      def regexp
        /^\s* st(?:op)? (?: \s* (\d+))? \s*$/x
      end

      def execute
        return puts(help) unless @match[1]

        context, err = context_from_thread(@match[1])
        return errmsg(err) if err

        context.suspend
        display_context(context)
      end

      def short_description
        'Stops the execution of the specified thread'
      end

      def description
        <<-EOD
          th[read] st[op] <thnum>

          #{short_description}
        EOD
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/byebug-5.0.0/lib/byebug/commands/thread/stop.rb
byebug-5.0.0 lib/byebug/commands/thread/stop.rb