Sha256: 5e63aea4c805639fe90d905fa3bb508e262704d9c195ff512cb52712d1b6a194

Contents?: true

Size: 1.11 KB

Versions: 8

Compression:

Stored size: 1.11 KB

Contents

module Debase
  class Context
    def frame_locals(frame_no=0)
      result = {}
      binding = frame_binding(frame_no)
      locals = eval("local_variables", binding)
      if locals.respond_to?(:each)
        locals.each {|local| result[local.to_s] = eval(local.to_s, binding)}
      else
        result[locals.to_s] = eval(locals.to_s, binding)
      end
      result
    end  

    def frame_class(frame_no=0)
      frame_self(frame_no).class
    end

    def frame_args_info(frame_no=0)
      nil
    end

    def handler
      Debase.handler or raise "No interface loaded"
    end

    def at_breakpoint(breakpoint)
      handler.at_breakpoint(self, breakpoint)
    end

    def at_catchpoint(excpt)
      handler.at_catchpoint(self, excpt)
    end

    def at_tracing(file, line)
      @tracing_started = true if File.identical?(file, File.join(Debugger::INITIAL_DIR, Debugger::PROG_SCRIPT))
      handler.at_tracing(self, file, line) if @tracing_started
    end

    def at_line(file, line)
      handler.at_line(self, file, line)
    end

    def at_return(file, line)
      handler.at_return(self, file, line)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
debase-0.1.7 lib/debase/context.rb
debase-0.1.6 lib/debase/context.rb
debase-0.1.5 lib/debase/context.rb
debase-0.1.4 lib/debase/context.rb
debase-0.1.3 lib/debase/context.rb
debase-0.1.3.beta1 lib/debase/context.rb
debase-0.1.2 lib/debase/context.rb
debase-0.1.1 lib/debase/context.rb