Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions lib/irb/debug.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,14 @@ def setup(irb)
end
DEBUGGER__::CONFIG.set_config
configure_irb_for_debugger(irb)
thread = Thread.current

DEBUGGER__.initialize_session{ IRB::Debug::UI.new(thread, irb) }
DEBUGGER__.initialize_session{ IRB::Debug::UI.new(irb) }
end

# When debug session was previously started but not by IRB
if defined?(DEBUGGER__::SESSION) && !irb.context.with_debugger
configure_irb_for_debugger(irb)
thread = Thread.current

DEBUGGER__::SESSION.reset_ui(IRB::Debug::UI.new(thread, irb))
DEBUGGER__::SESSION.reset_ui(IRB::Debug::UI.new(irb))
end

# Apply patches to debug gem so it skips IRB frames
Expand Down
5 changes: 2 additions & 3 deletions lib/irb/debug/ui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
module IRB
module Debug
class UI < DEBUGGER__::UI_Base
def initialize(thread, irb)
@thread = thread
def initialize(irb)
@irb = irb
end

Expand Down Expand Up @@ -56,7 +55,7 @@ def puts str = nil

def readline _
setup_interrupt do
tc = DEBUGGER__::SESSION.get_thread_client(@thread)
tc = DEBUGGER__::SESSION.instance_variable_get(:@tc)
cmd = @irb.debug_readline(tc.current_frame.binding || TOPLEVEL_BINDING)

case cmd
Expand Down