Debugger finishes in _pydev_execfile
Fix indention
@@ -87,6 +87,12 @@ class PyDBFrame:
return self.trace_exception
+ def trace_return(self, frame, event, arg):
+ if event == 'return':
+ main_debugger, filename, info, thread = self._args
+ send_signature_return_trace(main_debugger, frame, filename, arg)
+ return self.trace_return
+
# IFDEF CYTHON
# def should_stop_on_exception(self, frame, str event, arg):
# cdef PyDBAdditionalThreadInfo info;
@@ -363,6 +369,12 @@ class PyDBFrame:
# I believe this can only happen in jython on some frontiers on jython and java code, which we don't want to trace.
return None
+ need_trace_return = False
+ if is_call and main_debugger.signature_factory:
+ need_trace_return = send_signature_call_trace(main_debugger, frame, filename)
+ if is_return and main_debugger.signature_factory:
+ send_signature_return_trace(main_debugger, frame, filename, arg)
+
stop_frame = info.pydev_step_stop
step_cmd = info.pydev_step_cmd
@@ -424,6 +436,9 @@ class PyDBFrame:
if can_skip:
if has_exception_breakpoints:
return self.trace_exception
+ else:
+ if need_trace_return:
+ return self.trace_return
else:
return None
@@ -464,6 +479,9 @@ class PyDBFrame:
if can_skip and not has_breakpoint_in_frame:
if has_exception_breakpoints:
return self.trace_exception
+ else:
+ if need_trace_return:
+ return self.trace_return
else:
return None
@@ -587,7 +605,7 @@ class PyDBFrame:
self.do_wait_suspend(thread, frame, event, arg)
return self.trace_dispatch
else:
- if not breakpoint:
+ if not breakpoint and not is_return:
# No stop from anyone and no breakpoint found in line (cache that).
frame_skips_cache[line_cache_key] = 0
@@ -684,10 +702,7 @@ class PyDBFrame:
else:
stop = False
- if stop and step_cmd != -1 and IS_PY3K:
- # in Py3k we start script via our custom `execfile` function, and we shouldn't stop there
- # while stepping when execution is finished
- if is_return:
+ if step_cmd != -1 and is_return and IS_PY3K and hasattr(frame, "f_back"):
f_code = getattr(frame.f_back, 'f_code', None)
if f_code is not None:
back_filename = os.path.basename(f_code.co_filename)
