Sha256: 8a99474ec71dd4ab32ebadcb82f6a38185af5b6d2d04db63e4df398fb8444665

Contents?: true

Size: 923 Bytes

Versions: 12

Compression:

Stored size: 923 Bytes

Contents

module Debugger

  require 'pp'
  require 'nodepp'
  require 'classtree'
  require 'parse_tree'
  class Disassemble < Command # :nodoc:
    self.allow_in_control = false
    @@parse_tree = ParseTree.new(true)
    
    def regexp
      /^\s*(dis(?:assemble)?)\s+/
    end

    def execute
      expr = @match ? @match.post_match : @input
      binding = @state.context ? get_binding : TOPLEVEL_BINDING
      method_str = "method(:#{expr})"
      if method_obj = debug_eval(method_str, binding)
        print @@parse_tree.parse_tree_for_method(method_obj.class, 
                                                 method_str).inspect
        print "#{method_obj}\n"
      end
    end

    class << self
      def help_command
        %w|disassemble method-name|
      end

      def help(cmd)
          %{
            dis[assemble] method-name\tdo live unparsing of method name
          }
      end
    end
  end if false
end

Version data entries

12 entries across 12 versions & 4 rubygems

Version Path
candlepin-api-0.4.0 bundle/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/disassemble.RB
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/disassemble.RB
vim-jar-0.1.2 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/disassemble.RB
vim-jar-0.1.1 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/disassemble.RB
vim-jar-0.1.0 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/disassemble.RB
vim-jar-0.0.3 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/disassemble.RB
vim-jar-0.0.2 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/disassemble.RB
vim-jar-0.0.1 bundler/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/disassemble.RB
ruby-debug-0.10.4 cli/ruby-debug/commands/disassemble.RB
rackjour-0.1.8 vendor/gems/gems/ruby-debug-0.10.3/cli/ruby-debug/commands/disassemble.RB
ruby-debug-0.10.1 cli/ruby-debug/commands/disassemble.RB
ruby-debug-0.10.3 cli/ruby-debug/commands/disassemble.RB