Skip to content

Commit 1576964

Browse files
committed
cleanup: do not redefine ruby-debug-base without need
1 parent 1bca0a9 commit 1576964

File tree

2 files changed

+7
-69
lines changed

2 files changed

+7
-69
lines changed

lib/ruby-debug-ide.rb

Lines changed: 3 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -36,56 +36,11 @@ def cleanup_backtrace(backtrace)
3636
end
3737
cleared
3838
end
39-
end
40-
41-
class Context
42-
def interrupt
43-
self.stop_next = 1
44-
end
45-
46-
private
47-
48-
def event_processor
49-
Debugger.event_processor
50-
end
51-
52-
def at_breakpoint(breakpoint)
53-
event_processor.at_breakpoint(self, breakpoint)
54-
end
55-
56-
def at_catchpoint(excpt)
57-
event_processor.at_catchpoint(self, excpt)
58-
end
59-
60-
def at_tracing(file, line)
61-
if event_processor
62-
event_processor.at_tracing(self, file, line)
63-
else
64-
Debugger::print_debug "trace: location=\"%s:%s\", threadId=%d", file, line, self.thnum
65-
end
66-
end
67-
68-
def at_line(file, line)
69-
event_processor.at_line(self, file, line)
70-
end
71-
72-
def at_return(file, line)
73-
event_processor.at_return(self, file, line)
74-
end
75-
end
76-
77-
class << self
7839

79-
attr_accessor :event_processor, :cli_debug, :xml_debug
40+
attr_accessor :cli_debug, :xml_debug
8041
attr_accessor :control_thread
8142
attr_reader :interface
82-
83-
#
84-
# Interrupts the current thread
85-
#
86-
def interrupt
87-
current_context.interrupt
88-
end
43+
8944

9045
#
9146
# Interrupts the last debugged thread
@@ -156,7 +111,7 @@ def start_control(host, port)
156111
end
157112
begin
158113
@interface = RemoteInterface.new(session)
159-
@event_processor = EventProcessor.new(interface)
114+
self.handler = EventProcessor.new(interface)
160115
IdeControlCommandProcessor.new(interface).process_commands
161116
rescue StandardError, ScriptError => ex
162117
bt = ex.backtrace
@@ -177,21 +132,4 @@ def start_control(host, port)
177132
class Exception # :nodoc:
178133
attr_reader :__debug_file, :__debug_line, :__debug_binding, :__debug_context
179134
end
180-
181-
module Kernel
182-
#
183-
# Stops the current thread after a number of _steps_ made.
184-
#
185-
def debugger(steps = 1)
186-
Debugger.current_context.stop_next = steps
187-
end
188-
189-
#
190-
# Returns a binding of n-th call frame
191-
#
192-
def binding_n(n = 0)
193-
Debugger.current_context.frame_binding[n+1]
194-
end
195-
end
196-
197135
end

lib/ruby-debug-ide/ide_processor.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ def print(*args)
1313
end
1414

1515
def process_commands
16-
unless Debugger.event_processor.at_line?
16+
unless Debugger.handler.at_line?
1717
@printer.print_error "There is no thread suspended at the time and therefore no context to execute '#{input.gsub('%', '%%')}'"
1818
return
1919
end
20-
context = Debugger.event_processor.context
21-
file = Debugger.event_processor.file
22-
line = Debugger.event_processor.line
20+
context = Debugger.handler.context
21+
file = Debugger.handler.file
22+
line = Debugger.handler.line
2323
state = State.new do |s|
2424
s.context = context
2525
s.file = file

0 commit comments

Comments
 (0)