Skip to content

Commit 8ffbaf2

Browse files
committed
Refactor some debug helpers
1 parent e68aaa4 commit 8ffbaf2

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

lib/debug/session.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def session_server_main
203203
def process_event evt
204204
# variable `@internal_info` is only used for test
205205
tc, output, ev, @internal_info, *ev_args = evt
206-
DEBUGGER__.debug_event(tc, ev, ev_args, direction: ">")
206+
debug_event(tc, ev, ev_args)
207207
output.each{|str| @ui.puts str} if ev != :suspend
208208

209209
case ev
@@ -1717,6 +1717,10 @@ def before_fork need_lock = true
17171717
def after_fork_parent
17181718
@ui.after_fork_parent
17191719
end
1720+
1721+
def debug_event(*args)
1722+
DEBUGGER__.debug_event(*args, direction: ">")
1723+
end
17201724
end
17211725

17221726
class ProcessGroup

lib/debug/thread_client.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,12 @@ def generate_info
191191
{ location: current_frame.location_str, line: current_frame.location.lineno }
192192
end
193193

194+
def debug_event(*args)
195+
DEBUGGER__.debug_event(self, *args, direction: "<")
196+
end
197+
194198
def event! ev, *args
195-
DEBUGGER__.debug_event(self, ev, args, direction: "<")
199+
debug_event(ev, args)
196200
@q_evt << [self, @output, ev, generate_info, *args]
197201
@output = []
198202
end

0 commit comments

Comments
 (0)