Sha256: 73880fbedc1f6ebd6e0a2b8828ed9abbe86510b54f1f0e55e11353779eedc744
Contents?: true
Size: 1.37 KB
Versions: 1
Compression:
Stored size: 1.37 KB
Contents
# frozen_string_literal: true module RubyJard ## # Centralized flow control and data storage to feed into screens. Each # process supposes to have only one instance of this class. # TODO: If attachment event happens after any threads are created, race # condition may happen. Should use a mutex to wrap around. # TODO: This class is created to store data, but byebug data structures are # leaked, and accessible from outside and this doesn't work if screens stay in # other processes. Therefore, an internal, jard-specific data mapping should # be built. class Session attr_reader :screen_manager, :backtrace, :frame, :contexts, :current_context def initialize(options = {}) @options = options @backtrace = [] @frame = nil @contexts = [] @started = false @screen_manager = RubyJard::ScreenManager.new(session: self) end def start return if started? @screen_manager.start @started = true end def started? @started == true end def attach start unless started? Byebug.attach Byebug.current_context.step_out(2, false) end def refresh @backtrace = Byebug.current_context.backtrace @frame = Byebug.current_context.frame @contexts = Byebug.contexts @current_context = Byebug.current_context @screen_manager.refresh end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ruby_jard-0.1.0 | lib/ruby_jard/session.rb |