From f24a6f911021f60c0b02b4fb85470d16afe275d0 Mon Sep 17 00:00:00 2001 From: Shunichi Ikegami Date: Fri, 2 Dec 2022 16:21:57 +0900 Subject: [PATCH] Warn against debugging Process.daemon locally. --- lib/debug/session.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/debug/session.rb b/lib/debug/session.rb index 994756dee..ada5d4576 100644 --- a/lib/debug/session.rb +++ b/lib/debug/session.rb @@ -151,6 +151,10 @@ def active? !@q_evt.closed? end + def remote? + @ui.remote? + end + def stop_stepping? file, line, subsession_id = nil if @bps.has_key? [file, line] true @@ -2427,6 +2431,10 @@ def daemon _, child_hook = __fork_setup_for_debugger(:child) + unless SESSION.remote? + DEBUGGER__.warn "Can't debug the code after Process.daemon locally. Use the remote debugging feature." + end + super.tap do child_hook.call end