Sha256: 10fdf470f985795babae1be7ee4d2cd1bb2f0aaa224729cfaf4d9daf5c5f1904

Contents?: true

Size: 1.93 KB

Versions: 23

Compression:

Stored size: 1.93 KB

Contents

module Johnson #:nodoc:
  module SpiderMonkey #:nodoc:
    class Debugger # native
      JSTRAP_ERROR    = 0
      JSTRAP_CONTINUE = 1
      JSTRAP_RETURN   = 2
      JSTRAP_THROW    = 3
      JSTRAP_LIMIT    = 4
      attr_accessor :logger
      def initialize(logger)
        @logger = logger
      end

      def interrupt_handler(context, script, bytecode)
        line_num  = line_number(context, script, bytecode)
        f_name    = file_name(context, script)
        logger.debug("interrupt_handler #{f_name} #{line_num}")
        JSTRAP_CONTINUE
      end

      def new_script_hook(filename, linenum)
        logger.debug("new_script_hook: #{filename} #{linenum}")
      end

      def destroy_script_hook
        logger.debug("destroy_script_hook")
      end

      def debugger_handler(context, script, bytecode)
        line_num  = line_number(context, script, bytecode)
        f_name    = file_name(context, script)
        logger.debug("debugger_handler: #{bytecode}")
        JSTRAP_CONTINUE
      end

      def source_handler(filename, line_number, str)
        logger.debug("source_handler: #{filename}(#{line_number}): #{str}")
      end

      # +call_hook+ is called before and after script execution.  +before+
      # is +true+ if before, +false+ otherwise.
      def execute_hook(context, stack_frame, before, ok)
        logger.debug("execute_hook: #{before} #{ok}")
      end

      # +call_hook+ is called before and after a function call.  +before+
      # is +true+ if before, +false+ otherwise.
      def call_hook(before, ok)
        logger.debug("call_hook: #{before} #{ok}")
      end

      def object_hook(is_new)
        logger.debug("object_hook: #{is_new}")
      end

      # This hook can change the control
      def throw_hook(bytecode)
        logger.debug("throw_hook: #{bytecode}")
        JSTRAP_CONTINUE
      end

      def debug_error_hook(message)
        logger.debug("debug_error_hook: #{message}")
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 3 rubygems

Version Path
jbarnette-johnson-1.0.0.200806240111 lib/johnson/spidermonkey/debugger.rb
jbarnette-johnson-1.0.0.200807291507 lib/johnson/spidermonkey/debugger.rb
jbarnette-johnson-1.0.0.200808062051 lib/johnson/spidermonkey/debugger.rb
jbarnette-johnson-1.0.0.200808062111 lib/johnson/spidermonkey/debugger.rb
jbarnette-johnson-1.0.0.200811251942 lib/johnson/spidermonkey/debugger.rb
jbarnette-johnson-1.0.0.20081126120511 lib/johnson/spidermonkey/debugger.rb
jbarnette-johnson-1.0.0.20090127202936 lib/johnson/spidermonkey/debugger.rb
jbarnette-johnson-1.0.0.20090225110820 lib/johnson/spidermonkey/debugger.rb
jbarnette-johnson-1.0.0.20090326122910 lib/johnson/spidermonkey/debugger.rb
jbarnette-johnson-1.0.0.20090326154650 lib/johnson/spidermonkey/debugger.rb
jbarnette-johnson-1.0.0.20090326161333 lib/johnson/spidermonkey/debugger.rb
jbarnette-johnson-1.0.0.20090402144841 lib/johnson/spidermonkey/debugger.rb
jbarnette-johnson-1.0.0.20090402155420 lib/johnson/spidermonkey/debugger.rb
johnson-2.0.0.pre1 lib/johnson/spidermonkey/debugger.rb
johnson-2.0.0.pre0 lib/johnson/spidermonkey/debugger.rb
johnson-1.2.0 lib/johnson/spidermonkey/debugger.rb
smparkes-johnson-1.1.2.6 lib/johnson/spidermonkey/debugger.rb
smparkes-johnson-1.1.2.5 lib/johnson/spidermonkey/debugger.rb
smparkes-johnson-1.1.2.4 lib/johnson/spidermonkey/debugger.rb
smparkes-johnson-1.1.2.3 lib/johnson/spidermonkey/debugger.rb