Skip to content

Commit ece3f75

Browse files
committed
Refactor some debug helpers
1 parent 3364460 commit ece3f75

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
@@ -187,8 +187,12 @@ def generate_info
187187
{ location: current_frame.location_str, line: current_frame.location.lineno }
188188
end
189189

190+
def debug_event(*args)
191+
DEBUGGER__.debug_event(self, *args, direction: "<")
192+
end
193+
190194
def event! ev, *args
191-
DEBUGGER__.debug_event(self, ev, args, direction: "<")
195+
debug_event(ev, args)
192196
@q_evt << [self, @output, ev, generate_info, *args]
193197
@output = []
194198
end

0 commit comments

Comments
 (0)