class Byebug::DebugCommand - byebug-9.0.6 Documentation

# class Byebug::DebugCommand

Spawns a subdebugger and evaluates the given expression

### Public Class Methods

description() click to toggle source

    # File lib/byebug/commands/debug.rb, line 15
    def self.description
      <<-EOD
        debug <expression>

        #{short_description}

        Allows, for example, setting breakpoints on expressions evaluated from
        the debugger's prompt.
      EOD
    end

regexp() click to toggle source

    # File lib/byebug/commands/debug.rb, line 11
    def self.regexp
      /^\s* debug (?:\s+(\S+))? \s*$/x
    end

short_description() click to toggle source

    # File lib/byebug/commands/debug.rb, line 26
    def self.short_description
      'Spawns a subdebugger'
    end

### Public Instance Methods

execute() click to toggle source

    # File lib/byebug/commands/debug.rb, line 30
    def execute
      return puts(help) unless @match[1]

      puts safe_inspect(separate_thread_eval(@match[1]))
    end