From c7b59642c98122855eaeb2f3200102a09728bc3d Mon Sep 17 00:00:00 2001 From: Elizaveta Shashkova Date: Fri, 7 Apr 2017 15:33:25 +0300 Subject: [PATCH] Disable frame evaluation for remote debug server (PY-23587) We do it in order to have ability to stop on the next line after the settrace() call --- python/helpers/pydev/pydevd.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python/helpers/pydev/pydevd.py b/python/helpers/pydev/pydevd.py index 2c7eaaaa1cee..62d907bf1876 100644 --- a/python/helpers/pydev/pydevd.py +++ b/python/helpers/pydev/pydevd.py @@ -76,6 +76,7 @@ connected = False bufferStdOutToServer = False bufferStdErrToServer = False remote = False +inside_fork = False file_system_encoding = getfilesystemencoding() @@ -1171,7 +1172,7 @@ def _locked_settrace( global bufferStdOutToServer global bufferStdErrToServer - if not connected : + if not connected: pydevd_vm_type.setup_type() if SetupHolder.setup is None: @@ -1219,6 +1220,11 @@ def _locked_settrace( while not debugger.ready_to_run: time.sleep(0.1) # busy wait until we receive run command + global inside_fork + if frame_eval_func is not None and not inside_fork: + # Disable frame evaluation for Remote Debug Server + debugger.frame_eval_func = None + # note that we do that through pydevd_tracing.SetTrace so that the tracing # is not warned to the user! pydevd_tracing.SetTrace(debugger.trace_dispatch, debugger.frame_eval_func) @@ -1358,6 +1364,8 @@ def settrace_forked(): if port is not None: global connected connected = False + global inside_fork + inside_fork = True custom_frames_container_init()