PY-82241 Fix PythonDebuggerAggregatorEnvTest

Disable sys.monitoring from PyDB.stoptrace.
Disconnect DebuggerProcess if ServerSocket is closed.
Kill DebugProcessHandler if it is KillableProcessHandler.


Merge-request: IJ-MR-167442
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: f1a42ad9014d9e172bc994085f53e2123f9870c2
This commit is contained in:
Egor Eliseev
2025-06-30 19:45:36 +00:00
committed by intellij-monorepo-bot
parent 8e76779c37
commit 43f95e5a8c
68 changed files with 4112 additions and 5100 deletions
@@ -1,153 +0,0 @@
# Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
import sys
import os
def find_in_pythonpath(module_name):
# Check all the occurrences where we could match the given module/package in the PYTHONPATH.
#
# This is a simplistic approach, but probably covers most of the cases we're interested in
# (i.e.: this may fail in more elaborate cases of import customization or .zip imports, but
# this should be rare in general).
found_at = []
parts = module_name.split(".") # split because we need to convert mod.name to mod/name
for path in sys.path:
target = os.path.join(path, *parts)
target_py = target + ".py"
if os.path.isdir(target):
found_at.append(target)
if os.path.exists(target_py):
found_at.append(target_py)
return found_at
class DebuggerInitializationError(Exception):
pass
class VerifyShadowedImport(object):
def __init__(self, import_name):
self.import_name = import_name
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
if exc_type is not None:
if exc_type == DebuggerInitializationError:
return False # It's already an error we generated.
# We couldn't even import it...
found_at = find_in_pythonpath(self.import_name)
if len(found_at) <= 1:
# It wasn't found anywhere or there was just 1 occurrence.
# Let's just return to show the original error.
return False
# We found more than 1 occurrence of the same module in the PYTHONPATH
# (the user module and the standard library module).
# Let's notify the user as it seems that the module was shadowed.
msg = self._generate_shadowed_import_message(found_at)
raise DebuggerInitializationError(msg)
return None
def _generate_shadowed_import_message(self, found_at):
msg = """It was not possible to initialize the debugger due to a module name conflict.
i.e.: the module "%(import_name)s" could not be imported because it is shadowed by:
%(found_at)s
Please rename this file/folder so that the original module from the standard library can be imported.""" % {
"import_name": self.import_name,
"found_at": found_at[0],
}
return msg
def check(self, module, expected_attributes):
msg = ""
for expected_attribute in expected_attributes:
try:
getattr(module, expected_attribute)
except:
msg = self._generate_shadowed_import_message([module.__file__])
break
if msg:
raise DebuggerInitializationError(msg)
with VerifyShadowedImport("threading") as verify_shadowed:
import threading
verify_shadowed.check(threading, ["Thread", "settrace", "setprofile", "Lock", "RLock", "current_thread"])
ThreadingEvent = threading.Event
ThreadingLock = threading.Lock
threading_current_thread = threading.current_thread
with VerifyShadowedImport("time") as verify_shadowed:
import time
verify_shadowed.check(time, ["sleep", "time", "mktime"])
with VerifyShadowedImport("socket") as verify_shadowed:
import socket
verify_shadowed.check(socket, ["socket", "gethostname", "getaddrinfo"])
with VerifyShadowedImport("select") as verify_shadowed:
import select
verify_shadowed.check(select, ["select"])
with VerifyShadowedImport("code") as verify_shadowed:
import code as _code
verify_shadowed.check(_code, ["compile_command", "InteractiveInterpreter"])
if sys.version_info >= (3,):
with VerifyShadowedImport("_thread") as verify_shadowed:
import _thread as thread
verify_shadowed.check(thread, ["start_new_thread", "start_new", "allocate_lock"])
else:
import thread
if sys.version_info >= (3,):
with VerifyShadowedImport("queue") as verify_shadowed:
import queue as _queue
verify_shadowed.check(_queue, ["Queue", "LifoQueue", "Empty", "Full", "deque"])
else:
import Queue as _queue
if sys.version_info >= (3,):
with VerifyShadowedImport("xmlrpclib") as verify_shadowed:
import xmlrpc.client as xmlrpclib
verify_shadowed.check(xmlrpclib, ["ServerProxy", "Marshaller", "Server"])
else:
import xmlrpclib
if sys.version_info >= (3,):
with VerifyShadowedImport("xmlrpc.server") as verify_shadowed:
import xmlrpc.server as _pydev_SimpleXMLRPCServer
verify_shadowed.check(_pydev_SimpleXMLRPCServer, ["SimpleXMLRPCServer"])
else:
import SimpleXMLRPCServer as _pydev_SimpleXMLRPCServer
if sys.version_info >= (3,):
with VerifyShadowedImport("http.server") as verify_shadowed:
import http.server as BaseHTTPServer
verify_shadowed.check(BaseHTTPServer, ["BaseHTTPRequestHandler"])
else:
import BaseHTTPServer
# If set, this is a version of the threading.enumerate that doesn't have the patching to remove the pydevd threads.
# Note: as it can't be set during execution, don't import the name (import the module and access it through its name).
pydevd_saved_threading_enumerate = None
@@ -7,6 +7,7 @@ from _pydev_bundle._pydev_calltip_util import get_description
from _pydev_bundle.pydev_imports import _queue
from _pydev_bundle.pydev_stdin import DebugConsoleStdIn
from _pydevd_bundle import pydevd_vars
from _pydevd_bundle.pydevd_utils import interrupt_main_thread
# =======================================================================================================================
@@ -229,40 +230,8 @@ class BaseCodeExecutor(object):
self.buffer = None # Also clear the buffer when it's interrupted.
try:
if self.interruptable:
called = False
try:
# Fix for #PyDev-500: Console interrupt can't interrupt on sleep
if os.name == 'posix':
# On Linux we can't interrupt 0 as in Windows because it's
# actually owned by a process -- on the good side, signals
# work much better on Linux!
os.kill(os.getpid(), signal.SIGINT)
called = True
interrupt_main_thread()
elif os.name == 'nt':
# In windows sending a Ctrl+C to a process given its pid is difficult.
# There are utilities to make it work such as
# http://www.latenighthacking.com/projects/2003/sendSignal/
# but fortunately for us, it seems Python does allow a CTRL_C_EVENT
# for the current process in Windows if pid 0 is passed... if we needed
# to send a signal to another process the approach would be
# much more difficult.
# Still, note that CTRL_C_EVENT is only Python 2.7 onwards...
os.kill(0, signal.CTRL_C_EVENT)
called = True
except:
# Many things to go wrong (from CTRL_C_EVENT not being there
# to failing import signal)... if that's the case, ask for
# forgiveness and go on to the approach which will interrupt
# the main thread (but it'll only work when it's executing some Python
# code -- not on sleep() for instance).
pass
if not called:
if hasattr(thread, 'interrupt_main'): # Jython doesn't have it
thread.interrupt_main()
else:
self.mainThread._thread.interrupt() # Jython
self.finish_exec(False, False)
return True
except:
@@ -1,5 +1,5 @@
import sys
from _pydevd_bundle.pydevd_constants import STATE_RUN, PYTHON_SUSPEND, IS_JYTHON, IS_IRONPYTHON, ForkSafeLock
from _pydevd_bundle.pydevd_constants import STATE_RUN, PYTHON_SUSPEND, IS_JYTHON, IS_IRONPYTHON
from _pydev_bundle import pydev_log
# IFDEF CYTHON
# pydev_log.debug("Using Cython speedups")
@@ -7,7 +7,7 @@ from _pydev_bundle import pydev_log
from _pydevd_bundle.pydevd_frame import PyDBFrame
# ENDIF
version = 56
version = 57
if not hasattr(sys, '_current_frames'):
@@ -104,11 +104,11 @@ class PyDBAdditionalThreadInfo(object):
self.pydev_smart_step_context = PydevSmartStepContext()
def get_topmost_frame(self, thread):
"""
'''
Gets the topmost frame for the given thread. Note that it may be None
and callers should remove the reference to the frame as soon as possible
to avoid disturbing user code.
"""
'''
# sys._current_frames(): dictionary with thread id -> topmost frame
current_frames = _current_frames()
return current_frames.get(thread.ident)
@@ -146,7 +146,9 @@ class PydevSmartStepContext:
reset = __init__
_set_additional_thread_info_lock = ForkSafeLock()
from _pydev_imps._pydev_saved_modules import threading
_set_additional_thread_info_lock = threading.Lock()
def set_additional_thread_info(thread):
try:
@@ -70,17 +70,18 @@ from _pydev_imps._pydev_saved_modules import thread
from _pydev_imps._pydev_saved_modules import threading
from _pydev_imps._pydev_saved_modules import time
from _pydev_imps._pydev_saved_modules import socket
from socket import socket, AF_INET, SOCK_STREAM, SHUT_RD, SHUT_WR, SOL_SOCKET, SO_REUSEADDR, SHUT_RDWR, timeout
from socket import socket, AF_INET, SOCK_STREAM, SHUT_RD, SHUT_WR, SOL_SOCKET, SO_REUSEADDR, SHUT_RDWR, timeout, IPPROTO_TCP
from _pydevd_bundle.pydevd_constants import DebugInfoHolder, get_thread_id, IS_JYTHON, \
IS_PY2, IS_PY3K, \
IS_PY36_OR_GREATER, STATE_RUN, dict_keys, ASYNC_EVAL_TIMEOUT_SEC, IS_IRONPYTHON, \
GlobalDebuggerHolder, \
get_global_debugger, GetGlobalDebugger, set_global_debugger, NEXT_VALUE_SEPARATOR
get_global_debugger, GetGlobalDebugger, set_global_debugger, NEXT_VALUE_SEPARATOR, IS_WINDOWS
from _pydev_bundle.pydev_override import overrides
import json
import weakref
from _pydevd_bundle.pydevd_daemon_thread import PyDBDaemonThread
try:
from urllib import quote_plus, unquote, unquote_plus
except:
@@ -184,51 +185,40 @@ def pydevd_log(level, *args):
pass
#------------------------------------------------------------------- ACTUAL COMM
#=======================================================================================================================
# ReaderThread
#=======================================================================================================================
class ReaderThread(PyDBDaemonThread):
""" reader thread reads and dispatches commands in an infinite loop """
def __init__(self, sock, py_db, terminate_on_socket_close=True):
assert sock is not None
def __init__(self, sock, py_db):
PyDBDaemonThread.__init__(self, py_db)
self.__terminate_on_socket_close = terminate_on_socket_close
self.sock = sock
self.name = "pydevd.Reader"
from _pydevd_bundle.pydevd_process_net_command import process_net_command
self.process_net_command = process_net_command
def do_kill_pydev_thread(self):
#We must close the socket so that it doesn't stay halted there.
PyDBDaemonThread.do_kill_pydev_thread(self)
#We must close the socket so that it doesn't stay halted there.
try:
self.sock.shutdown(SHUT_RD) #shutdown the socket for read
self.sock.shutdown(SHUT_RD)
except:
#just ignore that
pass
pass
try:
self.sock.close()
except:
pass
@overrides(PyDBDaemonThread._on_run)
def _on_run(self):
read_buffer = ""
try:
while True:
while not self._kill_received:
try:
r = self.sock.recv(1024)
if len(r) == 0:
pydev_log.debug("ReaderThread: empty contents received (len(r) == 0).")
self._terminate_on_socket_close()
return # Finished communication.
if self._kill_received:
continue
except OSError:
if not self._kill_received:
self._terminate_on_socket_close()
return #Finished communication.
return
except:
if not self._kill_received:
traceback.print_exc()
@@ -243,7 +233,7 @@ class ReaderThread(PyDBDaemonThread):
read_buffer += r
if DebugInfoHolder.DEBUG_RECORD_SOCKET_READS:
sys.stderr.write('debugger: received >>%s<<\n' % (read_buffer,))
sys.stderr.write(u'debugger: received >>%s<<\n' % (read_buffer,))
sys.stderr.flush()
if len(read_buffer) == 0:
@@ -265,10 +255,11 @@ class ReaderThread(PyDBDaemonThread):
except:
traceback.print_exc()
self._terminate_on_socket_close()
finally:
pydev_log.debug("ReaderThread: exit")
def _terminate_on_socket_close(self):
if self.__terminate_on_socket_close:
self.py_db.dispose_and_kill_all_pydevd_threads()
self.py_db.dispose_and_kill_all_pydevd_threads()
def process_command(self, cmd_id, seq, text):
self.process_net_command(self.py_db, cmd_id, seq, text)
@@ -280,12 +271,11 @@ class ReaderThread(PyDBDaemonThread):
#=======================================================================================================================
class WriterThread(PyDBDaemonThread):
""" writer thread writes out the commands in an infinite loop """
def __init__(self, sock, py_db, terminate_on_socket_close=True):
def __init__(self, sock, py_db):
PyDBDaemonThread.__init__(self, py_db)
self.sock = sock
self.__terminate_on_socket_close = terminate_on_socket_close
self.name = "pydevd.Writer"
self._cmd_queue = _queue.Queue()
self.cmdQueue = _queue.Queue()
if pydevd_vm_type.get_vm_type() == 'python':
self.timeout = 0
else:
@@ -294,22 +284,25 @@ class WriterThread(PyDBDaemonThread):
def add_command(self, cmd):
""" cmd is NetCommand """
if not self._kill_received: #we don't take new data after everybody die
self._cmd_queue.put(cmd, False)
self.cmdQueue.put(cmd)
@overrides(PyDBDaemonThread._on_run)
def _on_run(self):
""" just loop and write responses """
try:
while True:
try:
try:
cmd = self._cmd_queue.get(True, 0.1)
cmd = self.cmdQueue.get(True, 0.1)
except _queue.Empty:
if self._kill_received:
pydev_log.debug("WriterThread: kill_received (sock.shutdown(SHUT_WR))")
try:
self.sock.shutdown(SHUT_WR)
except:
pass
try:
self.sock.close()
except:
pass
@@ -325,22 +318,21 @@ class WriterThread(PyDBDaemonThread):
cmd.send(self.sock)
if cmd.id == CMD_EXIT:
pydev_log.debug("WriterThread: CMD_EXIT received")
break
if time is None:
break # interpreter shutdown
break #interpreter shutdown
time.sleep(self.timeout)
except Exception:
if self.__terminate_on_socket_close:
self.py_db.dispose_and_kill_all_pydevd_threads()
if DebugInfoHolder.DEBUG_TRACE_LEVEL >= 0:
traceback.print_exc()
self.py_db.dispose_and_kill_all_pydevd_threads()
if DebugInfoHolder.DEBUG_TRACE_LEVEL >= 0:
traceback.print_exc()
finally:
pydev_log.debug("WriterThread: exit")
def empty(self):
return self._cmd_queue.empty()
return self.cmdQueue.empty()
@overrides(PyDBDaemonThread.do_kill_pydev_thread)
def do_kill_pydev_thread(self):
if not self._kill_received:
# Add command before setting the kill flag (otherwise the command may not be added).
@@ -349,44 +341,61 @@ class WriterThread(PyDBDaemonThread):
PyDBDaemonThread.do_kill_pydev_thread(self)
#--------------------------------------------------- CREATING THE SOCKET THREADS
#=======================================================================================================================
# start_server
#=======================================================================================================================
def create_server_socket(host, port):
s = socket(AF_INET, SOCK_STREAM)
s.settimeout(None)
try:
from socket import SO_REUSEPORT
s.setsockopt(SOL_SOCKET, SO_REUSEPORT, 1)
except ImportError:
s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
server = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)
if IS_WINDOWS:
try:
from socket import SO_EXCLUSIVEADDRUSE
server.setsockopt(SOL_SOCKET, SO_EXCLUSIVEADDRUSE, 1)
except ImportError:
server.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
else:
try:
from socket import SO_REUSEPORT
server.setsockopt(SOL_SOCKET, SO_REUSEPORT, 1)
except ImportError:
server.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
server.bind((host, port))
server.settimeout(None)
except Exception:
server.close()
raise
return server
s.bind(('', port))
pydevd_log(1, "Bound to port ", str(port))
return s
def start_server(port):
""" binds to a port, waits for the debugger to connect """
s = create_server_socket(host="", port=port)
s = create_server_socket('', port)
try:
s.listen(1)
newSock, _addr = s.accept()
pydevd_log(1, "Connection accepted")
# Let the user know it's halted waiting for the connection.
host, port = s.getsockname()
msg = "pydevd: waiting for connection at: %host:%port%".format(host=host, port=port)
pydev_log.info(msg)
new_socket, _addr = s.accept()
pydev_log.info("Connection accepted")
# closing server socket is not necessary but we don't need it
try:
s.shutdown(SHUT_RDWR)
except:
pass
finally:
try:
s.close()
return newSock
except:
pass
return new_socket
except:
sys.stderr.write("Could not bind to port: %s\n" % (port,))
@@ -394,6 +403,7 @@ def start_server(port):
traceback.print_exc()
raise
#=======================================================================================================================
# start_client
#=======================================================================================================================
@@ -412,19 +422,27 @@ def start_client(host, port):
# then sends a keepalive ping once every 3 seconds (TCP_KEEPINTVL),
# and closes the connection after 5 failed ping (TCP_KEEPCNT), or 15 seconds
try:
from socket import IPPROTO_TCP, SO_KEEPALIVE, TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT
s.setsockopt(SOL_SOCKET, SO_KEEPALIVE, 1)
s.setsockopt(IPPROTO_TCP, TCP_KEEPIDLE, 1)
s.setsockopt(IPPROTO_TCP, TCP_KEEPINTVL, 3)
s.setsockopt(IPPROTO_TCP, TCP_KEEPCNT, 5)
except ImportError:
s.setsockopt(SOL_SOCKET, socket.SO_KEEPALIVE, 1)
except (AttributeError, OSError):
pass # May not be available everywhere.
try:
s.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 1)
except (AttributeError, OSError):
pass # May not be available everywhere.
try:
s.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 3)
except (AttributeError, OSError):
pass # May not be available everywhere.
try:
s.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 5)
except (AttributeError, OSError):
pass # May not be available everywhere.
try:
s.settimeout(10) # 10 seconds timeout
s.connect((host, port))
s.settimeout(None) # no timeout after connected
pydevd_log(1, "Connected.")
pydev_log.info("Connected to: {socket}.".format(socket=s))
return s
except:
sys.stderr.write("Could not connect to %s: %s\n" % (host, port))
@@ -504,7 +522,7 @@ class NetCommand:
sock.sendall(('Content-Length: %s\r\n\r\n' % len(as_bytes)).encode('ascii'))
try:
sock.sendall(as_bytes)
except Exception as e:
except BrokenPipeError:
print("Connection closed unexpectedly!")
@classmethod
@@ -991,7 +1009,7 @@ INTERNAL_SUSPEND_THREAD = 2
#=======================================================================================================================
# InternalThreadCommand
#=======================================================================================================================
class InternalThreadCommand(object):
class InternalThreadCommand:
""" internal commands are generated/executed by the debugger.
The reason for their existence is that some commands have to be executed
@@ -1003,9 +1021,8 @@ class InternalThreadCommand(object):
self.thread_id = thread_id
def can_be_executed_by(self, thread_id):
"""
By default, it must be in the same thread to be executed
"""
'''By default, it must be in the same thread to be executed
'''
return self.thread_id == thread_id or self.thread_id.endswith('|' + thread_id)
def do_it(self, dbg):
@@ -1014,7 +1031,6 @@ class InternalThreadCommand(object):
class ReloadCodeCommand(InternalThreadCommand):
def __init__(self, module_name, thread_id):
InternalThreadCommand.__init__(self, thread_id)
self.thread_id = thread_id
self.module_name = module_name
self.executed = False
@@ -1124,7 +1140,6 @@ class InternalRunThread(InternalThreadCommand):
#=======================================================================================================================
class InternalStepThread(InternalThreadCommand):
def __init__(self, thread_id, cmd_id):
InternalThreadCommand.__init__(self, thread_id)
self.thread_id = thread_id
self.cmd_id = cmd_id
@@ -1140,7 +1155,6 @@ class InternalStepThread(InternalThreadCommand):
#=======================================================================================================================
class InternalSetNextStatementThread(InternalThreadCommand):
def __init__(self, thread_id, cmd_id, line, func_name, seq=0):
InternalThreadCommand.__init__(self, thread_id)
self.thread_id = thread_id
self.cmd_id = cmd_id
self.line = line
@@ -1165,7 +1179,6 @@ class InternalSetNextStatementThread(InternalThreadCommand):
class InternalSmartStepInto(InternalThreadCommand):
def __init__(self, thread_id, frame_id, cmd_id, func_name, line, call_order, start_line, end_line, seq=0):
InternalThreadCommand.__init__(self, thread_id)
self.thread_id = thread_id
self.cmd_id = cmd_id
self.line = line
@@ -1200,7 +1213,6 @@ class InternalSmartStepInto(InternalThreadCommand):
class InternalGetVariable(InternalThreadCommand):
""" gets the value of a variable """
def __init__(self, seq, thread_id, frame_id, scope, attrs):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = seq
self.thread_id = thread_id
self.frame_id = frame_id
@@ -1242,7 +1254,6 @@ class InternalGetVariable(InternalThreadCommand):
#=======================================================================================================================
class InternalGetArray(InternalThreadCommand):
def __init__(self, seq, roffset, coffset, rows, cols, format, thread_id, frame_id, scope, attrs):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = seq
self.thread_id = thread_id
self.frame_id = frame_id
@@ -1272,7 +1283,6 @@ class InternalGetArray(InternalThreadCommand):
#=======================================================================================================================
class InternalDataViewerAction(InternalThreadCommand):
def __init__(self, sequence, thread_id, frame_id, var, action, args):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = sequence
self.thread_id = thread_id
self.frame_id = frame_id
@@ -1448,7 +1458,6 @@ class InternalTableImageChunkCommand(InternalTableImageCommandBase):
class InternalChangeVariable(InternalThreadCommand):
""" changes the value of a variable """
def __init__(self, seq, thread_id, frame_id, scope, attr, expression):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = seq
self.thread_id = thread_id
self.frame_id = frame_id
@@ -1476,7 +1485,6 @@ class InternalChangeVariable(InternalThreadCommand):
class InternalGetFrame(InternalThreadCommand):
""" gets the value of a variable """
def __init__(self, seq, thread_id, frame_id, group_type):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = seq
self.thread_id = thread_id
self.frame_id = frame_id
@@ -1506,7 +1514,6 @@ class InternalGetFrame(InternalThreadCommand):
class InternalGetSmartStepIntoVariants(InternalThreadCommand):
def __init__(self, seq, thread_id, frame_id, start_line, end_line):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = seq
self.thread_id = thread_id
self.frame_id = frame_id
@@ -1547,7 +1554,6 @@ class InternalGetSmartStepIntoVariants(InternalThreadCommand):
class InternalGetNextStatementTargets(InternalThreadCommand):
""" gets the valid line numbers for use with set next statement """
def __init__(self, seq, thread_id, frame_id):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = seq
self.thread_id = thread_id
self.frame_id = frame_id
@@ -1589,7 +1595,6 @@ class InternalEvaluateExpression(InternalThreadCommand):
""" gets the value of a variable """
def __init__(self, seq, thread_id, frame_id, expression, doExec, doTrim, temp_name):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = seq
self.thread_id = thread_id
self.frame_id = frame_id
@@ -1621,7 +1626,6 @@ class InternalGetCompletions(InternalThreadCommand):
""" Gets the completions in a given scope """
def __init__(self, seq, thread_id, frame_id, act_tok):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = seq
self.thread_id = thread_id
self.frame_id = frame_id
@@ -1665,7 +1669,6 @@ class InternalGetDescription(InternalThreadCommand):
"""
def __init__(self, seq, thread_id, frame_id, expression):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = seq
self.thread_id = thread_id
self.frame_id = frame_id
@@ -1693,7 +1696,6 @@ class InternalGetDescription(InternalThreadCommand):
class InternalGetBreakpointException(InternalThreadCommand):
""" Send details of exception raised while evaluating conditional breakpoint """
def __init__(self, thread_id, exc_type, stacktrace):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = 0
self.thread_id = thread_id
self.stacktrace = stacktrace
@@ -1734,7 +1736,6 @@ class InternalSendCurrExceptionTrace(InternalThreadCommand):
'''
:param arg: exception type, description, traceback object
'''
InternalThreadCommand.__init__(self, thread_id)
self.sequence = 0
self.thread_id = thread_id
self.curr_frame_id = curr_frame_id
@@ -1758,7 +1759,6 @@ class InternalSendCurrExceptionTraceProceeded(InternalThreadCommand):
""" Send details of the exception that was caught and where we've broken in.
"""
def __init__(self, thread_id):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = 0
self.thread_id = thread_id
@@ -1780,7 +1780,6 @@ class InternalEvaluateConsoleExpression(InternalThreadCommand):
""" Execute the given command in the debug console """
def __init__(self, seq, thread_id, frame_id, line, buffer_output=True):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = seq
self.thread_id = thread_id
self.frame_id = frame_id
@@ -1823,7 +1822,6 @@ class InternalRunCustomOperation(InternalThreadCommand):
""" Run a custom command on an expression
"""
def __init__(self, seq, thread_id, frame_id, scope, attrs, style, encoded_code_or_file, fnname):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = seq
self.thread_id = thread_id
self.frame_id = frame_id
@@ -1853,7 +1851,6 @@ class InternalConsoleGetCompletions(InternalThreadCommand):
""" Fetch the completions in the debug console
"""
def __init__(self, seq, thread_id, frame_id, act_tok):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = seq
self.thread_id = thread_id
self.frame_id = frame_id
@@ -1880,7 +1877,6 @@ class InternalConsoleExec(InternalThreadCommand):
""" gets the value of a variable """
def __init__(self, seq, thread_id, frame_id, expression):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = seq
self.thread_id = thread_id
self.frame_id = frame_id
@@ -1925,7 +1921,6 @@ class InternalLoadFullValue(InternalThreadCommand):
Loads values asynchronously
"""
def __init__(self, seq, thread_id, frame_id, vars):
InternalThreadCommand.__init__(self, thread_id)
self.sequence = seq
self.thread_id = thread_id
self.frame_id = frame_id
@@ -1963,7 +1958,7 @@ class AbstractGetValueAsyncThread(PyDBDaemonThread):
Abstract class for a thread, which evaluates values for async variables
"""
def __init__(self, frame_accessor, seq, var_objects, user_type_renderers=None):
PyDBDaemonThread.__init__(self, frame_accessor)
PyDBDaemonThread.__init__(self)
self.frame_accessor = frame_accessor
self.seq = seq
self.var_objs = var_objects
@@ -4,8 +4,6 @@ This module holds the constants used for specifying the states of the debugger.
from __future__ import nested_scopes
import platform
import sys # Note: the sys import must be here anyways (others depend on it)
import weakref
from _pydev_bundle._pydev_saved_modules import thread, threading
STATE_RUN = 1
STATE_SUSPEND = 2
@@ -28,13 +26,6 @@ class DebugInfoHolder:
DEBUG_TRACE_BREAKPOINTS = -1
# Any filename that starts with these strings is not traced nor shown to the user.
# In Python 3.7 "<frozen ..." appears multiple times during import and should be ignored for the user.
# In PyPy "<builtin> ..." can appear and should be ignored for the user.
# <attrs is used internally by attrs
# <__array_function__ is used by numpy
IGNORE_BASENAMES_STARTING_WITH = ("<frozen ", "<builtin", "<attrs", "<__array_function__")
IS_CPYTHON = platform.python_implementation() == 'CPython'
# Hold a reference to the original _getframe (because psyco will change that as soon as it's imported)
@@ -76,10 +67,13 @@ from _pydevd_bundle import pydevd_vm_type
IS_WINDOWS = sys.platform == 'win32'
IS_JYTHON = pydevd_vm_type.get_vm_type() == pydevd_vm_type.PydevdVmType.JYTHON
IS_JYTH_LESS25 = False
if IS_JYTHON:
import java.lang.System # @UnresolvedImport
IS_WINDOWS = java.lang.System.getProperty("os.name").lower().startswith("windows")
if sys.version_info[0] == 2 and sys.version_info[1] < 5:
IS_JYTH_LESS25 = True
elif IS_IRONPYTHON:
import System
IS_WINDOWS = "windows" in System.Environment.OSVersion.VersionString.lower()
@@ -256,7 +250,7 @@ def protect_libraries_from_patching():
del sys.modules[name]
# import for side effects
import _pydev_bundle._pydev_saved_modules
import _pydev_imps._pydev_saved_modules
for name in patched_modules:
sys.modules[name] = patched_modules[name]
@@ -265,57 +259,7 @@ def protect_libraries_from_patching():
if USE_LIB_COPY:
protect_libraries_from_patching()
_fork_safe_locks = []
class ForkSafeLock(object):
"""
A lock which is fork-safe (when a fork is done, `pydevd_constants.after_fork()`
should be called to reset the locks in the new process to avoid deadlocks
from a lock which was locked during the fork).
Note:
Unlike `threading.Lock` this class is not completely atomic, so, doing:
lock = ForkSafeLock()
with lock:
...
is different than using `threading.Lock` directly because the tracing may
find an additional function call on `__enter__` and on `__exit__`, so, it's
not recommended to use this in all places, only where the forking may be important
(so, for instance, the locks on PyDB should not be changed to this lock because
of that -- and those should all be collected in the new process because PyDB itself
should be completely cleared anyways).
It's possible to overcome this limitation by using `ForkSafeLock.acquire` and
`ForkSafeLock.release` instead of the context manager (as acquire/release are
bound to the original implementation, whereas __enter__/__exit__ is not due to Python
limitations).
"""
def __init__(self, rlock=False):
self._rlock = rlock
self._init()
_fork_safe_locks.append(weakref.ref(self))
def __enter__(self):
return self._lock.__enter__()
def __exit__(self, exc_type, exc_val, exc_tb):
return self._lock.__exit__(exc_type, exc_val, exc_tb)
def _init(self):
if self._rlock:
self._lock = threading.RLock()
else:
self._lock = thread.allocate_lock()
self.acquire = self._lock.acquire
self.release = self._lock.release
_fork_safe_locks.append(weakref.ref(self))
from _pydev_imps._pydev_saved_modules import thread
_thread_id_lock = thread.allocate_lock()
thread_get_ident = thread.get_ident
@@ -556,17 +500,6 @@ class Null:
# Default instance
NULL = Null()
class KeyifyList(object):
def __init__(self, inner, key):
self.inner = inner
self.key = key
def __len__(self):
return len(self.inner)
def __getitem__(self, k):
return self.key(self.inner[k])
def call_only_once(func):
'''
File diff suppressed because it is too large Load Diff
@@ -5,7 +5,7 @@ from __future__ import print_function
# DO NOT edit manually!
# DO NOT edit manually!
import sys
from _pydevd_bundle.pydevd_constants import STATE_RUN, PYTHON_SUSPEND, IS_JYTHON, IS_IRONPYTHON, ForkSafeLock
from _pydevd_bundle.pydevd_constants import STATE_RUN, PYTHON_SUSPEND, IS_JYTHON, IS_IRONPYTHON
from _pydev_bundle import pydev_log
# IFDEF CYTHON -- DONT EDIT THIS FILE (it is automatically generated)
pydev_log.debug("Using Cython speedups")
@@ -13,7 +13,7 @@ pydev_log.debug("Using Cython speedups")
# from _pydevd_bundle.pydevd_frame import PyDBFrame
# ENDIF
version = 56
version = 57
if not hasattr(sys, '_current_frames'):
@@ -110,11 +110,11 @@ cdef class PyDBAdditionalThreadInfo:
self.pydev_smart_step_context = PydevSmartStepContext()
def get_topmost_frame(self, thread):
"""
'''
Gets the topmost frame for the given thread. Note that it may be None
and callers should remove the reference to the frame as soon as possible
to avoid disturbing user code.
"""
'''
# sys._current_frames(): dictionary with thread id -> topmost frame
current_frames = _current_frames()
return current_frames.get(thread.ident)
@@ -152,7 +152,9 @@ cdef class PydevSmartStepContext:
reset = __init__
_set_additional_thread_info_lock = ForkSafeLock()
from _pydev_imps._pydev_saved_modules import threading
_set_additional_thread_info_lock = threading.Lock()
def set_additional_thread_info(thread):
try:
@@ -897,11 +899,11 @@ cdef class PyDBFrame:
# if the frame is traced after breakpoint stop,
# but the file should be ignored while stepping because of filters
if step_cmd != -1:
if main_debugger.is_files_filter_enabled and main_debugger.is_ignored_by_filters(filename):
if main_debugger.is_filter_enabled and main_debugger.is_ignored_by_filters(filename):
# ignore files matching stepping filters
# No need to reset frame.f_trace to keep the same trace function.
return self.trace_dispatch
if main_debugger._is_libraries_filter_enabled and not main_debugger.in_project_scope(filename):
if main_debugger.is_filter_libraries and not main_debugger.in_project_scope(filename):
# ignore library files while stepping
# No need to reset frame.f_trace to keep the same trace function.
return self.trace_dispatch
@@ -1565,11 +1567,11 @@ cdef class ThreadTracer:
return None
if is_stepping:
if py_db.is_files_filter_enabled and py_db.is_ignored_by_filters(filename):
if py_db.is_filter_enabled and py_db.is_ignored_by_filters(filename):
# ignore files matching stepping filters
if event != 'call': frame.f_trace = NO_FTRACE
return None
if py_db._is_libraries_filter_enabled and not py_db.in_project_scope(filename):
if py_db.is_filter_libraries and not py_db.in_project_scope(filename):
# ignore library files while stepping
if event != 'call': frame.f_trace = NO_FTRACE
return None
@@ -6,13 +6,14 @@ import weakref
import pydevd_tracing
from _pydev_bundle import pydev_log
from _pydev_bundle._pydev_saved_modules import threading
from _pydev_imps._pydev_saved_modules import threading
from _pydevd_bundle.pydevd_constants import USE_LOW_IMPACT_MONITORING
if USE_LOW_IMPACT_MONITORING:
from _pydevd_bundle.pydevd_pep_669_tracing_wrapper import disable_pep669_monitoring
class PyDBDaemonThread(threading.Thread):
def __init__(self, py_db=None, target_and_args=None):
"""
:param target_and_args:
@@ -73,11 +74,11 @@ def mark_as_pydevd_daemon_thread(thread):
thread.daemon = True
def run_as_pydevd_daemon_thread(func, *args, **kwargs):
def run_as_pydevd_daemon_thread(py_db, func, *args, **kwargs):
"""
Runs a function as a pydevd daemon thread (without any tracing in place).
"""
t = PyDBDaemonThread(target_and_args=(func, args, kwargs))
t = PyDBDaemonThread(py_db, target_and_args=(func, args, kwargs))
t.name = '%s (pydevd daemon thread)' % (func.__name__,)
t.start()
return t
@@ -8,45 +8,6 @@ from _pydevd_bundle.pydevd_constants import IS_PY3K
LIB_FILE = 1
PYDEV_FILE = 2
DONT_TRACE_DIRS = {
'_pydev_bundle': PYDEV_FILE,
'_pydev_comm': PYDEV_FILE,
'_pydev_imps': PYDEV_FILE,
'_pydev_runfiles': PYDEV_FILE,
'_pydevd_bundle': PYDEV_FILE,
'_pydevd_frame_eval': PYDEV_FILE,
'_pydev_console': PYDEV_FILE,
'pydev_ipython': LIB_FILE,
'test_pydevd_reload': PYDEV_FILE,
'pydev_tests': PYDEV_FILE,
'pydev_tests_mainloop': PYDEV_FILE,
'pydev_tests_python': PYDEV_FILE,
'pydev_test_tables': PYDEV_FILE,
'pydevd_attach_to_process': PYDEV_FILE,
'pydevd_concurrency_analyser': PYDEV_FILE,
'pydevd_plugins': PYDEV_FILE,
}
LIB_FILES_IN_DONT_TRACE_DIRS = {
'__init__.py',
'inputhook.py',
'inputhookglut.py',
'inputhookgtk.py',
'inputhookgtk3.py',
'inputhookpyglet.py',
'inputhookqt4.py',
'inputhookqt5.py',
'inputhookqt6.py',
'inputhooktk.py',
'inputhookwx.py',
'matplotlibtools.py',
'qt.py',
'qt_for_kernel.py',
'qt_loaders.py',
'version.py',
}
DONT_TRACE = {
# commonly used things from the stdlib that we don't want to trace
'Queue.py':LIB_FILE,
@@ -726,11 +726,11 @@ class PyDBFrame:
# if the frame is traced after breakpoint stop,
# but the file should be ignored while stepping because of filters
if step_cmd != -1:
if main_debugger.is_files_filter_enabled and main_debugger.is_ignored_by_filters(filename):
if main_debugger.is_filter_enabled and main_debugger.is_ignored_by_filters(filename):
# ignore files matching stepping filters
# No need to reset frame.f_trace to keep the same trace function.
return self.trace_dispatch
if main_debugger._is_libraries_filter_enabled and not main_debugger.in_project_scope(filename):
if main_debugger.is_filter_libraries and not main_debugger.in_project_scope(filename):
# ignore library files while stepping
# No need to reset frame.f_trace to keep the same trace function.
return self.trace_dispatch
@@ -578,10 +578,10 @@ def py_start_callback(code, instruction_offset):
and frame is not info.pydev_step_stop):
if frame.f_back is info.pydev_step_stop:
_enable_return_tracing(code)
if (py_db.is_files_filter_enabled
if (py_db.is_filter_enabled
and py_db.is_ignored_by_filters(filename)):
return monitoring.DISABLE
if (py_db._is_libraries_filter_enabled
if (py_db.is_filter_libraries
and not py_db.in_project_scope(filename)):
return monitoring.DISABLE
# We are stepping, and there is no reason to skip the frame
@@ -715,11 +715,11 @@ def py_line_callback(code, line_number):
return
else:
if step_cmd != -1:
if (py_db.is_files_filter_enabled
if (py_db.is_filter_enabled
and py_db.is_ignored_by_filters(filename)):
# ignore files matching stepping filters
return monitoring.DISABLE
if (py_db._is_libraries_filter_enabled
if (py_db.is_filter_libraries
and not py_db.in_project_scope(filename)):
# ignore library files while stepping
return monitoring.DISABLE
@@ -2611,6 +2611,7 @@ static const char __pyx_k_KeyboardInterrupt[] = "KeyboardInterrupt";
static const char __pyx_k_ThreadInfo___init[] = "ThreadInfo.__init__";
static const char __pyx_k_active_limbo_lock[] = "_active_limbo_lock";
static const char __pyx_k_bootstrap_inner_2[] = "_bootstrap_inner";
static const char __pyx_k_is_filter_enabled[] = "is_filter_enabled";
static const char __pyx_k_py_raise_callback[] = "py_raise_callback";
static const char __pyx_k_py_start_callback[] = "py_start_callback";
static const char __pyx_k_pydevd_file_utils[] = "pydevd_file_utils";
@@ -2632,6 +2633,7 @@ static const char __pyx_k_find_last_call_name[] = "find_last_call_name";
static const char __pyx_k_get_additional_info[] = "_get_additional_info";
static const char __pyx_k_get_bootstrap_frame[] = "_get_bootstrap_frame";
static const char __pyx_k_get_top_level_frame[] = "_get_top_level_frame";
static const char __pyx_k_is_filter_libraries[] = "is_filter_libraries";
static const char __pyx_k_GlobalDebuggerHolder[] = "GlobalDebuggerHolder";
static const char __pyx_k_make_frame_cache_key[] = "_make_frame_cache_key";
static const char __pyx_k_manage_return_values[] = "manage_return_values";
@@ -2647,7 +2649,6 @@ static const char __pyx_k_is_pydev_daemon_thread[] = "is_pydev_daemon_thread";
static const char __pyx_k_suspended_at_unhandled[] = "suspended_at_unhandled";
static const char __pyx_k_track_dummy_thread_ref[] = "_track_dummy_thread_ref";
static const char __pyx_k_CMD_STEP_INTO_COROUTINE[] = "CMD_STEP_INTO_COROUTINE";
static const char __pyx_k_is_files_filter_enabled[] = "is_files_filter_enabled";
static const char __pyx_k_enable_pep669_monitoring[] = "enable_pep669_monitoring";
static const char __pyx_k_global_cache_frame_skips[] = "global_cache_frame_skips";
static const char __pyx_k_pydev_smart_step_context[] = "pydev_smart_step_context";
@@ -2661,7 +2662,6 @@ static const char __pyx_k_set_additional_thread_info[] = "set_additional_thread_
static const char __pyx_k_handle_breakpoint_condition[] = "handle_breakpoint_condition";
static const char __pyx_k_has_plugin_exception_breaks[] = "has_plugin_exception_breaks";
static const char __pyx_k_is_bootstrap_frame_internal[] = "is_bootstrap_frame_internal";
static const char __pyx_k_is_libraries_filter_enabled[] = "_is_libraries_filter_enabled";
static const char __pyx_k_stop_on_unhandled_exception[] = "stop_on_unhandled_exception";
static const char __pyx_k_DeleteDummyThreadOnDel___del[] = "_DeleteDummyThreadOnDel.__del__";
static const char __pyx_k_handle_breakpoint_expression[] = "handle_breakpoint_expression";
@@ -2948,9 +2948,9 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati
#define __pyx_n_u_is_bootstrap_frame_internal __pyx_string_tab[149]
#define __pyx_n_u_is_coroutine __pyx_string_tab[150]
#define __pyx_n_u_is_done __pyx_string_tab[151]
#define __pyx_n_u_is_files_filter_enabled __pyx_string_tab[152]
#define __pyx_n_u_is_ignored_by_filters __pyx_string_tab[153]
#define __pyx_n_u_is_libraries_filter_enabled __pyx_string_tab[154]
#define __pyx_n_u_is_filter_enabled __pyx_string_tab[152]
#define __pyx_n_u_is_filter_libraries __pyx_string_tab[153]
#define __pyx_n_u_is_ignored_by_filters __pyx_string_tab[154]
#define __pyx_n_u_is_logpoint __pyx_string_tab[155]
#define __pyx_n_u_is_pep669_monitoring_enabled __pyx_string_tab[156]
#define __pyx_n_u_is_pydev_daemon_thread __pyx_string_tab[157]
@@ -13983,7 +13983,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_34py_
* and frame is not info.pydev_step_stop):
* if frame.f_back is info.pydev_step_stop: # <<<<<<<<<<<<<<
* _enable_return_tracing(code)
* if (py_db.is_files_filter_enabled
* if (py_db.is_filter_enabled
*/
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_frame, __pyx_mstate_global->__pyx_n_u_f_back); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 585, __pyx_L21_error)
__Pyx_GOTREF(__pyx_t_11);
@@ -13998,7 +13998,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_34py_
* and frame is not info.pydev_step_stop):
* if frame.f_back is info.pydev_step_stop:
* _enable_return_tracing(code) # <<<<<<<<<<<<<<
* if (py_db.is_files_filter_enabled
* if (py_db.is_filter_enabled
* and py_db.is_ignored_by_filters(filename)):
*/
__pyx_t_11 = NULL;
@@ -14031,7 +14031,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_34py_
* and frame is not info.pydev_step_stop):
* if frame.f_back is info.pydev_step_stop: # <<<<<<<<<<<<<<
* _enable_return_tracing(code)
* if (py_db.is_files_filter_enabled
* if (py_db.is_filter_enabled
*/
}
@@ -14047,11 +14047,11 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_34py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":587
* if frame.f_back is info.pydev_step_stop:
* _enable_return_tracing(code)
* if (py_db.is_files_filter_enabled # <<<<<<<<<<<<<<
* if (py_db.is_filter_enabled # <<<<<<<<<<<<<<
* and py_db.is_ignored_by_filters(filename)):
* return monitoring.DISABLE
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_db, __pyx_mstate_global->__pyx_n_u_is_files_filter_enabled); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L21_error)
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_db, __pyx_mstate_global->__pyx_n_u_is_filter_enabled); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L21_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 587, __pyx_L21_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -14063,10 +14063,10 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_34py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":588
* _enable_return_tracing(code)
* if (py_db.is_files_filter_enabled
* if (py_db.is_filter_enabled
* and py_db.is_ignored_by_filters(filename)): # <<<<<<<<<<<<<<
* return monitoring.DISABLE
* if (py_db._is_libraries_filter_enabled
* if (py_db.is_filter_libraries
*/
__pyx_t_9 = __pyx_v_py_db;
__Pyx_INCREF(__pyx_t_9);
@@ -14086,17 +14086,17 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_34py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":587
* if frame.f_back is info.pydev_step_stop:
* _enable_return_tracing(code)
* if (py_db.is_files_filter_enabled # <<<<<<<<<<<<<<
* if (py_db.is_filter_enabled # <<<<<<<<<<<<<<
* and py_db.is_ignored_by_filters(filename)):
* return monitoring.DISABLE
*/
if (__pyx_t_13) {
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":589
* if (py_db.is_files_filter_enabled
* if (py_db.is_filter_enabled
* and py_db.is_ignored_by_filters(filename)):
* return monitoring.DISABLE # <<<<<<<<<<<<<<
* if (py_db._is_libraries_filter_enabled
* if (py_db.is_filter_libraries
* and not py_db.in_project_scope(filename)):
*/
__Pyx_XDECREF(__pyx_r);
@@ -14112,7 +14112,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_34py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":587
* if frame.f_back is info.pydev_step_stop:
* _enable_return_tracing(code)
* if (py_db.is_files_filter_enabled # <<<<<<<<<<<<<<
* if (py_db.is_filter_enabled # <<<<<<<<<<<<<<
* and py_db.is_ignored_by_filters(filename)):
* return monitoring.DISABLE
*/
@@ -14121,11 +14121,11 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_34py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":590
* and py_db.is_ignored_by_filters(filename)):
* return monitoring.DISABLE
* if (py_db._is_libraries_filter_enabled # <<<<<<<<<<<<<<
* if (py_db.is_filter_libraries # <<<<<<<<<<<<<<
* and not py_db.in_project_scope(filename)):
* return monitoring.DISABLE
*/
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_db, __pyx_mstate_global->__pyx_n_u_is_libraries_filter_enabled); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 590, __pyx_L21_error)
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_db, __pyx_mstate_global->__pyx_n_u_is_filter_libraries); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 590, __pyx_L21_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 590, __pyx_L21_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
@@ -14137,7 +14137,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_34py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":591
* return monitoring.DISABLE
* if (py_db._is_libraries_filter_enabled
* if (py_db.is_filter_libraries
* and not py_db.in_project_scope(filename)): # <<<<<<<<<<<<<<
* return monitoring.DISABLE
* # We are stepping, and there is no reason to skip the frame
@@ -14161,14 +14161,14 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_34py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":590
* and py_db.is_ignored_by_filters(filename)):
* return monitoring.DISABLE
* if (py_db._is_libraries_filter_enabled # <<<<<<<<<<<<<<
* if (py_db.is_filter_libraries # <<<<<<<<<<<<<<
* and not py_db.in_project_scope(filename)):
* return monitoring.DISABLE
*/
if (__pyx_t_13) {
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":592
* if (py_db._is_libraries_filter_enabled
* if (py_db.is_filter_libraries
* and not py_db.in_project_scope(filename)):
* return monitoring.DISABLE # <<<<<<<<<<<<<<
* # We are stepping, and there is no reason to skip the frame
@@ -14187,7 +14187,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_34py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":590
* and py_db.is_ignored_by_filters(filename)):
* return monitoring.DISABLE
* if (py_db._is_libraries_filter_enabled # <<<<<<<<<<<<<<
* if (py_db.is_filter_libraries # <<<<<<<<<<<<<<
* and not py_db.in_project_scope(filename)):
* return monitoring.DISABLE
*/
@@ -16598,7 +16598,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_36py_
* return
* else:
* if step_cmd != -1: # <<<<<<<<<<<<<<
* if (py_db.is_files_filter_enabled
* if (py_db.is_filter_enabled
* and py_db.is_ignored_by_filters(filename)):
*/
/*else*/ {
@@ -16608,11 +16608,11 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_36py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":724
* else:
* if step_cmd != -1:
* if (py_db.is_files_filter_enabled # <<<<<<<<<<<<<<
* if (py_db.is_filter_enabled # <<<<<<<<<<<<<<
* and py_db.is_ignored_by_filters(filename)):
* # ignore files matching stepping filters
*/
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_db, __pyx_mstate_global->__pyx_n_u_is_files_filter_enabled); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 724, __pyx_L20_error)
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_db, __pyx_mstate_global->__pyx_n_u_is_filter_enabled); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 724, __pyx_L20_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 724, __pyx_L20_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
@@ -16624,7 +16624,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_36py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":725
* if step_cmd != -1:
* if (py_db.is_files_filter_enabled
* if (py_db.is_filter_enabled
* and py_db.is_ignored_by_filters(filename)): # <<<<<<<<<<<<<<
* # ignore files matching stepping filters
* return monitoring.DISABLE
@@ -16647,7 +16647,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_36py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":724
* else:
* if step_cmd != -1:
* if (py_db.is_files_filter_enabled # <<<<<<<<<<<<<<
* if (py_db.is_filter_enabled # <<<<<<<<<<<<<<
* and py_db.is_ignored_by_filters(filename)):
* # ignore files matching stepping filters
*/
@@ -16657,7 +16657,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_36py_
* and py_db.is_ignored_by_filters(filename)):
* # ignore files matching stepping filters
* return monitoring.DISABLE # <<<<<<<<<<<<<<
* if (py_db._is_libraries_filter_enabled
* if (py_db.is_filter_libraries
* and not py_db.in_project_scope(filename)):
*/
__Pyx_XDECREF(__pyx_r);
@@ -16673,7 +16673,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_36py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":724
* else:
* if step_cmd != -1:
* if (py_db.is_files_filter_enabled # <<<<<<<<<<<<<<
* if (py_db.is_filter_enabled # <<<<<<<<<<<<<<
* and py_db.is_ignored_by_filters(filename)):
* # ignore files matching stepping filters
*/
@@ -16682,11 +16682,11 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_36py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":728
* # ignore files matching stepping filters
* return monitoring.DISABLE
* if (py_db._is_libraries_filter_enabled # <<<<<<<<<<<<<<
* if (py_db.is_filter_libraries # <<<<<<<<<<<<<<
* and not py_db.in_project_scope(filename)):
* # ignore library files while stepping
*/
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_db, __pyx_mstate_global->__pyx_n_u_is_libraries_filter_enabled); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 728, __pyx_L20_error)
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_db, __pyx_mstate_global->__pyx_n_u_is_filter_libraries); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 728, __pyx_L20_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 728, __pyx_L20_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -16698,7 +16698,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_36py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":729
* return monitoring.DISABLE
* if (py_db._is_libraries_filter_enabled
* if (py_db.is_filter_libraries
* and not py_db.in_project_scope(filename)): # <<<<<<<<<<<<<<
* # ignore library files while stepping
* return monitoring.DISABLE
@@ -16722,7 +16722,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_36py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":728
* # ignore files matching stepping filters
* return monitoring.DISABLE
* if (py_db._is_libraries_filter_enabled # <<<<<<<<<<<<<<
* if (py_db.is_filter_libraries # <<<<<<<<<<<<<<
* and not py_db.in_project_scope(filename)):
* # ignore library files while stepping
*/
@@ -16748,7 +16748,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_36py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":728
* # ignore files matching stepping filters
* return monitoring.DISABLE
* if (py_db._is_libraries_filter_enabled # <<<<<<<<<<<<<<
* if (py_db.is_filter_libraries # <<<<<<<<<<<<<<
* and not py_db.in_project_scope(filename)):
* # ignore library files while stepping
*/
@@ -16758,7 +16758,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_36py_
* return
* else:
* if step_cmd != -1: # <<<<<<<<<<<<<<
* if (py_db.is_files_filter_enabled
* if (py_db.is_filter_enabled
* and py_db.is_ignored_by_filters(filename)):
*/
}
@@ -19030,7 +19030,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
* py_db = None
*
* if py_db is None: # <<<<<<<<<<<<<<
* return monitoring.DISABLE
* return
*
*/
__pyx_t_8 = (__pyx_v_py_db == Py_None);
@@ -19039,31 +19039,25 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":856
*
* if py_db is None:
* return monitoring.DISABLE # <<<<<<<<<<<<<<
* return # <<<<<<<<<<<<<<
*
* try:
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_monitoring); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 856, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_DISABLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":855
* py_db = None
*
* if py_db is None: # <<<<<<<<<<<<<<
* return monitoring.DISABLE
* return
*
*/
}
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":858
* return monitoring.DISABLE
* return
*
* try: # <<<<<<<<<<<<<<
* try:
@@ -19101,13 +19095,13 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
* except:
* thread_info = _get_thread_info(True, 1)
*/
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_thread_local_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L18_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_thread_info); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 860, __pyx_L18_error)
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_thread_local_info); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 860, __pyx_L18_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_thread_info = __pyx_t_7;
__pyx_t_7 = 0;
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_thread_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L18_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_thread_info = __pyx_t_2;
__pyx_t_2 = 0;
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":859
*
@@ -19135,9 +19129,9 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
*/
/*except:*/ {
__Pyx_AddTraceback("_pydevd_bundle.pydevd_pep_669_tracing_cython.py_raise_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 861, __pyx_L20_except_error)
__Pyx_XGOTREF(__pyx_t_7);
if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_1) < 0) __PYX_ERR(0, 861, __pyx_L20_except_error)
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_1);
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":862
@@ -19187,8 +19181,8 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
*
*/
}
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L19_exception_handled;
}
@@ -19295,26 +19289,26 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
* _stop_on_unhandled_exception(exc_info, py_db, thread)
* return
*/
__pyx_t_2 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_get_top_level_frame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 872, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_7 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_get_top_level_frame); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 872, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_15 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
assert(__pyx_t_2);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_2);
if (unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
assert(__pyx_t_7);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
__Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
__pyx_t_15 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
__pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_15, (1-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
__pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_15, (1-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 872, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_1);
}
@@ -19329,26 +19323,26 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
* return
*
*/
__pyx_t_7 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stop_on_unhandled_exception_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 873, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_2 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_stop_on_unhandled_exception_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 873, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_15 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
assert(__pyx_t_7);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_7);
if (unlikely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
assert(__pyx_t_2);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
__Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
__pyx_t_15 = 0;
}
#endif
{
PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_exc_info, __pyx_v_py_db, __pyx_v_thread};
__pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_15, (4-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_exc_info, __pyx_v_py_db, __pyx_v_thread};
__pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_15, (4-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_1);
}
@@ -19381,15 +19375,15 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
* or py_db.has_plugin_exception_breaks
* or py_db.stop_on_failed_tests)
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_db, __pyx_mstate_global->__pyx_n_u_break_on_caught_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 876, __pyx_L12_error)
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_db, __pyx_mstate_global->__pyx_n_u_break_on_caught_exceptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 876, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 876, __pyx_L12_error)
if (!__pyx_t_8) {
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else {
__Pyx_INCREF(__pyx_t_2);
__pyx_t_1 = __pyx_t_2;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_INCREF(__pyx_t_7);
__pyx_t_1 = __pyx_t_7;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L29_bool_binop_done;
}
@@ -19400,15 +19394,15 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
* or py_db.stop_on_failed_tests)
* if has_exception_breakpoints:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_db, __pyx_mstate_global->__pyx_n_u_has_plugin_exception_breaks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 877, __pyx_L12_error)
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_db, __pyx_mstate_global->__pyx_n_u_has_plugin_exception_breaks); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 877, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 877, __pyx_L12_error)
if (!__pyx_t_8) {
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else {
__Pyx_INCREF(__pyx_t_2);
__pyx_t_1 = __pyx_t_2;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_INCREF(__pyx_t_7);
__pyx_t_1 = __pyx_t_7;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L29_bool_binop_done;
}
@@ -19419,11 +19413,11 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
* if has_exception_breakpoints:
* args = (
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_db, __pyx_mstate_global->__pyx_n_u_stop_on_failed_tests); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_1 = __pyx_t_2;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_db, __pyx_mstate_global->__pyx_n_u_stop_on_failed_tests); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 878, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_7);
__pyx_t_1 = __pyx_t_7;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_L29_bool_binop_done:;
__pyx_v_has_exception_breakpoints = __pyx_t_1;
__pyx_t_1 = 0;
@@ -19445,31 +19439,31 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
* info, thread,
* global_cache_skips,
*/
__pyx_t_2 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_get_abs_path_real_path_and_base_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 882, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_7 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_get_abs_path_real_path_and_base_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_15 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
assert(__pyx_t_2);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_2);
if (unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
assert(__pyx_t_7);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
__Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
__pyx_t_15 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_frame};
__pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_frame};
__pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 882, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":884
@@ -19489,8 +19483,8 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
* )
* should_stop, frame = should_stop_on_exception(
*/
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_global_cache_frame_skips); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_global_cache_frame_skips); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 885, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_7);
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":881
* if has_exception_breakpoints:
@@ -19504,8 +19498,8 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
__Pyx_INCREF(__pyx_v_py_db);
__Pyx_GIVEREF(__pyx_v_py_db);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_py_db) != (0)) __PYX_ERR(0, 881, __pyx_L12_error);
__Pyx_GIVEREF(__pyx_t_7);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 881, __pyx_L12_error);
__Pyx_GIVEREF(__pyx_t_2);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 881, __pyx_L12_error);
__Pyx_INCREF(__pyx_v_info);
__Pyx_GIVEREF(__pyx_v_info);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_info) != (0)) __PYX_ERR(0, 881, __pyx_L12_error);
@@ -19514,11 +19508,11 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_v_thread) != (0)) __PYX_ERR(0, 881, __pyx_L12_error);
__Pyx_GIVEREF(__pyx_t_1);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_1) != (0)) __PYX_ERR(0, 881, __pyx_L12_error);
__Pyx_GIVEREF(__pyx_t_2);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_2) != (0)) __PYX_ERR(0, 881, __pyx_L12_error);
__pyx_t_7 = 0;
__pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_7);
if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_7) != (0)) __PYX_ERR(0, 881, __pyx_L12_error);
__pyx_t_2 = 0;
__pyx_t_1 = 0;
__pyx_t_7 = 0;
__pyx_v_args = ((PyObject*)__pyx_t_13);
__pyx_t_13 = 0;
@@ -19529,7 +19523,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
* args, frame, 'exception', exc_info)
* if should_stop:
*/
__pyx_t_2 = NULL;
__pyx_t_7 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_should_stop_on_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_1);
@@ -19543,19 +19537,19 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
__pyx_t_15 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
assert(__pyx_t_2);
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
assert(__pyx_t_7);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
__pyx_t_15 = 0;
}
#endif
{
PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_args, __pyx_v_frame, __pyx_mstate_global->__pyx_n_u_exception, __pyx_v_exc_info};
PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_args, __pyx_v_frame, __pyx_mstate_global->__pyx_n_u_exception, __pyx_v_exc_info};
__pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_15, (5-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 887, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_13);
@@ -19572,39 +19566,39 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
__Pyx_INCREF(__pyx_t_7);
} else {
__pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L12_error)
__Pyx_XGOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L12_error)
__Pyx_XGOTREF(__pyx_t_2);
__pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 887, __pyx_L12_error)
__Pyx_XGOTREF(__pyx_t_7);
}
#else
__pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 887, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 887, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
index = 0; __pyx_t_1 = __pyx_t_16(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L33_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_2 = __pyx_t_16(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L33_unpacking_failed;
__pyx_t_2 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_2);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_7), 2) < 0) __PYX_ERR(0, 887, __pyx_L12_error)
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
index = 0; __pyx_t_1 = __pyx_t_16(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L33_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_7 = __pyx_t_16(__pyx_t_2); if (unlikely(!__pyx_t_7)) goto __pyx_L33_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_2), 2) < 0) __PYX_ERR(0, 887, __pyx_L12_error)
__pyx_t_16 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L34_unpacking_done;
__pyx_L33_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_16 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(0, 887, __pyx_L12_error)
@@ -19620,8 +19614,8 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
*/
__pyx_v_should_stop = __pyx_t_1;
__pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_frame, __pyx_t_2);
__pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v_frame, __pyx_t_7);
__pyx_t_7 = 0;
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":889
* should_stop, frame = should_stop_on_exception(
@@ -19640,25 +19634,25 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
* except KeyboardInterrupt:
* _clear_run_state(info)
*/
__pyx_t_2 = NULL;
__pyx_t_7 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_handle_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_15 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
assert(__pyx_t_2);
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
assert(__pyx_t_7);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
__pyx_t_15 = 0;
}
#endif
{
PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_args, __pyx_v_frame, __pyx_mstate_global->__pyx_n_u_exception, __pyx_v_exc_info};
PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_args, __pyx_v_frame, __pyx_mstate_global->__pyx_n_u_exception, __pyx_v_exc_info};
__pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_15, (5-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 890, __pyx_L12_error)
__Pyx_GOTREF(__pyx_t_13);
@@ -19684,7 +19678,7 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
}
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":858
* return monitoring.DISABLE
* return
*
* try: # <<<<<<<<<<<<<<
* try:
@@ -19712,10 +19706,10 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
__pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyboardInterrupt);
if (__pyx_t_6) {
__Pyx_AddTraceback("_pydevd_bundle.pydevd_pep_669_tracing_cython.py_raise_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 891, __pyx_L14_except_error)
if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(0, 891, __pyx_L14_except_error)
__Pyx_XGOTREF(__pyx_t_13);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_7);
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":892
* handle_exception(args, frame, 'exception', exc_info)
@@ -19742,13 +19736,13 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_info};
__pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 892, __pyx_L14_except_error)
__Pyx_GOTREF(__pyx_t_7);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L14_except_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":893
* except KeyboardInterrupt:
@@ -19759,9 +19753,9 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
*/
__Pyx_GIVEREF(__pyx_t_13);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_ErrRestoreWithState(__pyx_t_13, __pyx_t_1, __pyx_t_2);
__pyx_t_13 = 0; __pyx_t_1 = 0; __pyx_t_2 = 0;
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_ErrRestoreWithState(__pyx_t_13, __pyx_t_1, __pyx_t_7);
__pyx_t_13 = 0; __pyx_t_1 = 0; __pyx_t_7 = 0;
__PYX_ERR(0, 893, __pyx_L14_except_error)
}
@@ -19774,8 +19768,8 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
*/
/*except:*/ {
__Pyx_AddTraceback("_pydevd_bundle.pydevd_pep_669_tracing_cython.py_raise_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_13) < 0) __PYX_ERR(0, 894, __pyx_L14_except_error)
__Pyx_XGOTREF(__pyx_t_2);
if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_13) < 0) __PYX_ERR(0, 894, __pyx_L14_except_error)
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_13);
@@ -19806,13 +19800,13 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_17, NULL};
__pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+__pyx_t_15, (1-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+__pyx_t_15, (1-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 895, __pyx_L14_except_error)
__Pyx_GOTREF(__pyx_t_7);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 895, __pyx_L14_except_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":896
* except:
@@ -19831,16 +19825,16 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
*
* if py_db.quitting:
*/
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_13);
__pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_13 = 0;
__Pyx_ErrRestoreWithState(__pyx_t_7, __pyx_t_1, __pyx_t_13);
__pyx_t_7 = 0; __pyx_t_1 = 0; __pyx_t_13 = 0;
__PYX_ERR(0, 897, __pyx_L14_except_error)
}
/* "_pydevd_bundle/pydevd_pep_669_tracing_cython.pyx":858
* return monitoring.DISABLE
* return
*
* try: # <<<<<<<<<<<<<<
* try:
@@ -19883,13 +19877,13 @@ static PyObject *__pyx_pf_14_pydevd_bundle_29pydevd_pep_669_tracing_cython_38py_
*/
__pyx_t_1 = NULL;
__Pyx_INCREF(__pyx_builtin_KeyboardInterrupt);
__pyx_t_2 = __pyx_builtin_KeyboardInterrupt;
__pyx_t_7 = __pyx_builtin_KeyboardInterrupt;
__pyx_t_15 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
__pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_15, (1-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_15, (1-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 900, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
}
@@ -24661,9 +24655,9 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = {
{__pyx_k_is_bootstrap_frame_internal, sizeof(__pyx_k_is_bootstrap_frame_internal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_bootstrap_frame_internal */
{__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */
{__pyx_k_is_done, sizeof(__pyx_k_is_done), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_done */
{__pyx_k_is_files_filter_enabled, sizeof(__pyx_k_is_files_filter_enabled), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_files_filter_enabled */
{__pyx_k_is_filter_enabled, sizeof(__pyx_k_is_filter_enabled), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_filter_enabled */
{__pyx_k_is_filter_libraries, sizeof(__pyx_k_is_filter_libraries), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_filter_libraries */
{__pyx_k_is_ignored_by_filters, sizeof(__pyx_k_is_ignored_by_filters), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_ignored_by_filters */
{__pyx_k_is_libraries_filter_enabled, sizeof(__pyx_k_is_libraries_filter_enabled), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_libraries_filter_enabled */
{__pyx_k_is_logpoint, sizeof(__pyx_k_is_logpoint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_logpoint */
{__pyx_k_is_pep669_monitoring_enabled, sizeof(__pyx_k_is_pep669_monitoring_enabled), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_pep669_monitoring_enabled */
{__pyx_k_is_pydev_daemon_thread, sizeof(__pyx_k_is_pydev_daemon_thread), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_pydev_daemon_thread */
@@ -584,10 +584,10 @@ def py_start_callback(code, instruction_offset):
and frame is not info.pydev_step_stop):
if frame.f_back is info.pydev_step_stop:
_enable_return_tracing(code)
if (py_db.is_files_filter_enabled
if (py_db.is_filter_enabled
and py_db.is_ignored_by_filters(filename)):
return monitoring.DISABLE
if (py_db._is_libraries_filter_enabled
if (py_db.is_filter_libraries
and not py_db.in_project_scope(filename)):
return monitoring.DISABLE
# We are stepping, and there is no reason to skip the frame
@@ -721,11 +721,11 @@ def py_line_callback(code, line_number):
return
else:
if step_cmd != -1:
if (py_db.is_files_filter_enabled
if (py_db.is_filter_enabled
and py_db.is_ignored_by_filters(filename)):
# ignore files matching stepping filters
return monitoring.DISABLE
if (py_db._is_libraries_filter_enabled
if (py_db.is_filter_libraries
and not py_db.in_project_scope(filename)):
# ignore library files while stepping
return monitoring.DISABLE
@@ -853,7 +853,7 @@ def py_raise_callback(code, instruction_offset, exception):
py_db = None
if py_db is None:
return monitoring.DISABLE
return
try:
try:
@@ -145,7 +145,6 @@ def process_net_command(py_db, cmd_id, seq, text):
pydevd_file_utils.set_ide_os(ide_os)
cmd = py_db.cmd_factory.make_version_message(seq)
py_db.set_enable_thread_notifications(True)
elif cmd_id == CMD_LIST_THREADS:
# response is a list of threads
@@ -1,4 +1,5 @@
# Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
import threading
from _pydevd_bundle import pydevd_utils
from _pydevd_bundle.pydevd_additional_thread_info import set_additional_thread_info
@@ -7,7 +8,6 @@ from _pydevd_bundle.pydevd_constants import PYTHON_SUSPEND, STATE_SUSPEND, USE_L
from _pydev_bundle import pydev_log
import sys
def mark_thread_suspended(thread, stop_reason):
info = set_additional_thread_info(thread)
info.suspend_type = PYTHON_SUSPEND
@@ -23,11 +23,6 @@ def mark_thread_suspended(thread, stop_reason):
return info
from _pydevd_bundle.pydevd_constants import ForkSafeLock
suspend_threads_lock = ForkSafeLock()
def suspend_all_threads(py_db, except_thread):
"""
Suspend all except the one passed as a parameter.
@@ -1,237 +0,0 @@
from _pydev_bundle._pydev_saved_modules import ThreadingEvent, ThreadingLock, threading_current_thread
from _pydevd_bundle.pydevd_daemon_thread import PyDBDaemonThread
from _pydevd_bundle.pydevd_constants import thread_get_ident, IS_CPYTHON, NULL
import ctypes
import time
from _pydev_bundle import pydev_log
import weakref
from _pydevd_bundle.pydevd_utils import is_current_thread_main_thread
from _pydevd_bundle import pydevd_utils
_DEBUG = False # Default should be False as this can be very verbose.
class _TimeoutThread(PyDBDaemonThread):
"""
The idea in this class is that it should be usually stopped waiting
for the next event to be called (paused in a threading.Event.wait).
When a new handle is added it sets the event so that it processes the handles and
then keeps on waiting as needed again.
This is done so that it's a bit more optimized than creating many Timer threads.
"""
def __init__(self, py_db):
PyDBDaemonThread.__init__(self, py_db)
self._event = ThreadingEvent()
self._handles = []
# We could probably do things valid without this lock so that it's possible to add
# handles while processing, but the implementation would also be harder to follow,
# so, for now, we're either processing or adding handles, not both at the same time.
self._lock = ThreadingLock()
def _on_run(self):
wait_time = None
while not self._kill_received:
if _DEBUG:
if wait_time is None:
pydev_log.error("pydevd_timeout: Wait until a new handle is added.")
else:
pydev_log.error("pydevd_timeout: Next wait time: %s.", wait_time)
self._event.wait(wait_time)
if self._kill_received:
self._handles = []
return
wait_time = self.process_handles()
def process_handles(self):
"""
:return int:
Returns the time we should be waiting for to process the next event properly.
"""
with self._lock:
if _DEBUG:
pydev_log.error("pydevd_timeout: Processing handles")
self._event.clear()
handles = self._handles
new_handles = self._handles = []
# Do all the processing based on this time (we want to consider snapshots
# of processing time -- anything not processed now may be processed at the
# next snapshot).
curtime = time.time()
min_handle_timeout = None
for handle in handles:
if curtime < handle.abs_timeout and not handle.disposed:
# It still didn't time out.
if _DEBUG:
pydev_log.error("pydevd_timeout: Handle NOT processed: %s", handle)
new_handles.append(handle)
if min_handle_timeout is None:
min_handle_timeout = handle.abs_timeout
elif handle.abs_timeout < min_handle_timeout:
min_handle_timeout = handle.abs_timeout
else:
if _DEBUG:
pydev_log.error("pydevd_timeout: Handle processed: %s", handle)
# Timed out (or disposed), so, let's execute it (should be no-op if disposed).
handle.exec_on_timeout()
if min_handle_timeout is None:
return None
else:
timeout = min_handle_timeout - curtime
if timeout <= 0:
pydev_log.error("pydevd_timeout: Expected timeout to be > 0. Found: %s", timeout)
return timeout
def do_kill_pydev_thread(self):
PyDBDaemonThread.do_kill_pydev_thread(self)
with self._lock:
self._event.set()
def add_on_timeout_handle(self, handle):
with self._lock:
self._handles.append(handle)
self._event.set()
class _OnTimeoutHandle(object):
def __init__(self, tracker, abs_timeout, on_timeout, kwargs):
self._str = "_OnTimeoutHandle(%s)" % (on_timeout,)
self._tracker = weakref.ref(tracker)
self.abs_timeout = abs_timeout
self.on_timeout = on_timeout
if kwargs is None:
kwargs = {}
self.kwargs = kwargs
self.disposed = False
def exec_on_timeout(self):
# Note: lock should already be obtained when executing this function.
kwargs = self.kwargs
on_timeout = self.on_timeout
if not self.disposed:
self.disposed = True
self.kwargs = None
self.on_timeout = None
try:
if _DEBUG:
pydev_log.error("pydevd_timeout: Calling on timeout: %s with kwargs: %s" % on_timeout, kwargs)
on_timeout(**kwargs)
except Exception:
pydev_log.error("pydevd_timeout: Exception on callback timeout.")
def __enter__(self):
pass
def __exit__(self, exc_type, exc_val, exc_tb):
tracker = self._tracker()
if tracker is None:
lock = NULL
else:
lock = tracker._lock
with lock:
self.disposed = True
self.kwargs = None
self.on_timeout = None
def __str__(self):
return self._str
__repr__ = __str__
class TimeoutTracker(object):
"""
This is a helper class to track the timeout of something.
"""
def __init__(self, py_db):
self._thread = None
self._lock = ThreadingLock()
self._py_db = weakref.ref(py_db)
def call_on_timeout(self, timeout, on_timeout, kwargs=None):
"""
This can be called regularly to always execute the given function after a given timeout:
call_on_timeout(py_db, 10, on_timeout)
Or as a context manager to stop the method from being called if it finishes before the timeout
elapses:
with call_on_timeout(py_db, 10, on_timeout):
...
Note: the callback will be called from a PyDBDaemonThread.
"""
with self._lock:
if self._thread is None:
if _DEBUG:
pydev_log.error("pydevd_timeout: Created _TimeoutThread.")
self._thread = _TimeoutThread(self._py_db())
self._thread.start()
curtime = time.time()
handle = _OnTimeoutHandle(self, curtime + timeout, on_timeout, kwargs)
if _DEBUG:
pydev_log.error("pydevd_timeout: Added handle: %s.", handle)
self._thread.add_on_timeout_handle(handle)
return handle
def create_interrupt_this_thread_callback():
"""
The idea here is returning a callback that when called will generate a KeyboardInterrupt
in the thread that called this function.
If this is the main thread, this means that it'll emulate a Ctrl+C (which may stop I/O
and sleep operations).
For other threads, this will call PyThreadState_SetAsyncExc to raise
a KeyboardInterrupt before the next instruction (so, it won't really interrupt I/O or
sleep operations).
:return callable:
Returns a callback that will interrupt the current thread (this may be called
from an auxiliary thread).
"""
tid = thread_get_ident()
if is_current_thread_main_thread():
main_thread = threading_current_thread()
def raise_on_this_thread():
pydev_log.debug("Callback to interrupt main thread.")
pydevd_utils.interrupt_main_thread(main_thread)
else:
# Note: this works in the sense that it can stop some cpu-intensive slow operation,
# but we can't really interrupt the thread out of some sleep or I/O operation
# (this will only be raised when Python is about to execute the next instruction).
def raise_on_this_thread():
if IS_CPYTHON:
pydev_log.debug("Interrupt thread: %s" % tid)
ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(tid), ctypes.py_object(KeyboardInterrupt))
else:
pydev_log.debug("It is only possible to interrupt non-main threads in CPython.")
return raise_on_this_thread
@@ -440,11 +440,11 @@ class ThreadTracer:
return None
if is_stepping:
if py_db.is_files_filter_enabled and py_db.is_ignored_by_filters(filename):
if py_db.is_filter_enabled and py_db.is_ignored_by_filters(filename):
# ignore files matching stepping filters
if event != 'call': frame.f_trace = NO_FTRACE
return None
if py_db._is_libraries_filter_enabled and not py_db.in_project_scope(filename):
if py_db.is_filter_libraries and not py_db.in_project_scope(filename):
# ignore library files while stepping
if event != 'call': frame.f_trace = NO_FTRACE
return None
@@ -4,7 +4,6 @@ import ctypes
import os
import signal
import traceback
from importlib import import_module
try:
import torch
@@ -732,30 +731,6 @@ def kill_thread(thread):
% thread_id)
pydev_log.debug("Thread with ID '%s' is stopped" % thread_id)
def import_attr_from_module(import_with_attr_access):
if "." not in import_with_attr_access:
# We need at least one '.' (we don't support just the module import, we need the attribute access too).
raise ImportError("Unable to import module with attr access: %s" % (import_with_attr_access,))
module_name, attr_name = import_with_attr_access.rsplit(".", 1)
while True:
try:
mod = import_module(module_name)
except ImportError:
if "." not in module_name:
raise ImportError("Unable to import module with attr access: %s" % (import_with_attr_access,))
module_name, new_attr_part = module_name.rsplit(".", 1)
attr_name = new_attr_part + "." + attr_name
else:
# Ok, we got the base module, now, get the attribute we need.
try:
for attr in attr_name.split("."):
mod = getattr(mod, attr)
return mod
except:
raise ImportError("Unable to import module with attr access: %s" % (import_with_attr_access,))
def interrupt_main_thread(main_thread=None):
"""
@@ -395,7 +395,7 @@ def case_setup_multiproc():
def update_command_line_args(writer, args):
ret = debugger_unittest.AbstractWriterThread.update_command_line_args(writer, args)
ret.insert(ret.index('--qt-support'), '--multiprocess')
ret.insert(ret.index('--qt-support'), '--multiproc')
return ret
WriterThread.update_command_line_args = update_command_line_args
@@ -554,7 +554,8 @@ class AbstractWriterThread(threading.Thread):
'Sending suspend',
'Sending resume',
'Suspend not sent',
'Resume not sent'
'Resume not sent',
'Connected to:'
)):
return True
@@ -1081,6 +1082,7 @@ class AbstractWriterThread(threading.Thread):
if accept_message(last):
if expect_xml:
# Extract xml and return untangled.
xml = ""
try:
xml = last[last.index('<xml>'):]
if isinstance(xml, bytes):
@@ -1131,55 +1133,30 @@ class AbstractDispatcherThread(AbstractWriterThread):
self.writers = []
self._sequence = -1
self._breakpoints = []
self.thread_communications = []
def run_thread_communication(self):
server_socket = self.server_socket
breakpoints = self._breakpoints
writers = self.writers
test_file = self.get_main_filename()
def run(self):
server_socket = _create_socket()
server_socket.listen(1)
self.port = server_socket.getsockname()[1]
self.finished_initialization = True
class _SecondaryProcessWriterThread(AbstractWriterThread):
TEST_FILE = test_file
_sequence = -1
while True:
self.sock, addr = server_socket.accept()
new_writer = AbstractWriterThread()
new_writer.TEST_FILE = self.TEST_FILE
new_writer.start()
wait_for_condition(lambda: hasattr(new_writer, 'port'))
self.write('99\t-1\t%d' % new_writer.port)
wait_for_condition(lambda: new_writer.finished_initialization)
class _SecondaryProcessThreadCommunication(threading.Thread):
def run(self):
server_socket.listen(1)
self.server_socket = server_socket
new_sock, addr = server_socket.accept()
for args, kwargs in self._breakpoints:
new_writer.write_add_breakpoint(*args, **kwargs)
reader_thread = ReaderThread(new_sock)
reader_thread.start()
self.writers.append(new_writer)
writer2 = _SecondaryProcessWriterThread()
def write_add_breakpoint(self, *args, **kwargs):
self._breakpoints.append((args, kwargs))
writer2.reader_thread = reader_thread
writer2.sock = new_sock
writer2.write_version()
for args, kwargs in breakpoints:
writer2.write_add_breakpoint(*args, **kwargs)
writers.append(writer2)
secondary_process_thread_communication = _SecondaryProcessThreadCommunication()
secondary_process_thread_communication.start()
self.thread_communications.append(secondary_process_thread_communication)
return secondary_process_thread_communication
def join_communication(self, comm):
comm.join(10)
if comm.is_alive():
raise AssertionError(
'The SecondaryProcessThreadCommunication did not finish')
self.thread_communications.remove(comm)
def stop_thread_communication(self, comm=None):
if comm is not None:
self.join_communication(comm)
else:
for comm in self.thread_communications:
self.join_communication(comm)
def _get_debugger_test_file(filename):
try:
@@ -2077,57 +2077,60 @@ def test_debug_zip_files(case_setup, tmpdir):
writer.finished_ok = True
@pytest.mark.skipif(not IS_CPYTHON or IS_PY2, reason='CPython only test.')
@pytest.mark.xfail(IS_PY312_OR_GREATER, reason='PCQA-837')
def test_multiprocessing(case_setup_multiprocessing):
import threading
from pydev_tests_python.debugger_unittest import AbstractWriterThread
with case_setup_multiprocessing.test_file('_debugger_case_multiprocessing.py') as writer:
break1_line = writer.get_line_index_with_content('break 1 here')
break2_line = writer.get_line_index_with_content('break 2 here')
writer.write_add_breakpoint(break1_line)
writer.write_add_breakpoint(break2_line)
server_socket = writer.server_socket
class SecondaryProcessWriterThread(AbstractWriterThread):
TEST_FILE = writer.get_main_filename()
_sequence = -1
class SecondaryProcessThreadCommunication(threading.Thread):
def run(self):
from pydev_tests_python.debugger_unittest import ReaderThread
server_socket.listen(1)
self.server_socket = server_socket
new_sock, addr = server_socket.accept()
reader_thread = ReaderThread(new_sock)
reader_thread.start()
writer2 = SecondaryProcessWriterThread()
writer2.reader_thread = reader_thread
writer2.sock = new_sock
writer2.write_version()
writer2.write_add_breakpoint(break1_line)
writer2.write_add_breakpoint(break2_line)
writer2.write_make_initial_run()
hit = writer2.wait_for_breakpoint_hit()
writer2.write_run_thread(hit.thread_id)
secondary_process_thread_communication = SecondaryProcessThreadCommunication()
secondary_process_thread_communication.start()
writer.write_make_initial_run()
hit2 = writer.wait_for_breakpoint_hit()
secondary_process_thread_communication.join(10)
if secondary_process_thread_communication.is_alive():
raise AssertionError('The SecondaryProcessThreadCommunication did not finish')
writer.write_run_thread(hit2.thread_id)
writer.finished_ok = True
# @pytest.mark.skipif(not IS_CPYTHON or IS_PY2, reason='CPython only test.')
# @pytest.mark.xfail(IS_PY312_OR_GREATER, reason='PCQA-837')
# def test_multiprocessing(case_setup_multiprocessing):
# import threading
# from pydev_tests_python.debugger_unittest import AbstractWriterThread
# with case_setup_multiprocessing.test_file('_debugger_case_multiprocessing.py') as writer:
# break1_line = writer.get_line_index_with_content('break 1 here')
# break2_line = writer.get_line_index_with_content('break 2 here')
#
# writer.write_add_breakpoint(break1_line)
# writer.write_add_breakpoint(break2_line)
#
# server_socket = writer.server_socket
#
# class SecondaryProcessWriterThread(AbstractWriterThread):
# TEST_FILE = writer.get_main_filename()
# _sequence = -1
#
# class SecondaryProcessThreadCommunication(threading.Thread):
# def run(self):
# from pydev_tests_python.debugger_unittest import ReaderThread
# expected_connections = 2 if sys.platform == "darwin" else 1
#
# for _ in range(expected_connections):
# server_socket.listen(1)
# self.server_socket = server_socket
# new_sock, addr = server_socket.accept()
#
# reader_thread = ReaderThread(new_sock)
# reader_thread.name = " *** Multiprocess Reader Thread"
# reader_thread.start()
#
# writer2 = SecondaryProcessWriterThread()
#
# writer2.reader_thread = reader_thread
# writer2.sock = new_sock
#
# writer2.write_version()
# writer2.write_add_breakpoint(break1_line)
# writer2.write_add_breakpoint(break2_line)
# writer2.write_make_initial_run()
#
# hit = writer2.wait_for_breakpoint_hit()
# writer2.write_run_thread(hit.thread_id)
#
# secondary_process_thread_communication = SecondaryProcessThreadCommunication()
# secondary_process_thread_communication.start()
# writer.write_make_initial_run()
# hit2 = writer.wait_for_breakpoint_hit()
# secondary_process_thread_communication.join(10)
# if secondary_process_thread_communication.is_alive():
# raise AssertionError('The SecondaryProcessThreadCommunication did not finish')
# writer.write_run_thread(hit2.thread_id)
# writer.finished_ok = True
@pytest.mark.skipif(not IS_CPYTHON or IS_PY2, reason='CPython only test.')
@@ -2143,13 +2146,13 @@ def test_fork_no_attach(case_setup):
@pytest.mark.xfail(IS_PY312_OR_GREATER, reason='PCQA-838')
def test_fork_with_attach_no_breakpoints(case_setup_multiproc):
with case_setup_multiproc.test_file('_debugger_case_fork.py') as writer:
writer.run_thread_communication()
writer.write_make_initial_run()
wait_for_condition(lambda: len(writer.writers) == 1)
writer1 = writer.writers[0]
writer1.write_make_initial_run()
writer.stop_thread_communication()
wait_for_condition(lambda: len(writer.writers) == 2)
writer2 = writer.writers[1]
writer2.write_make_initial_run()
for w in writer.writers:
w.finished_ok = True
File diff suppressed because it is too large Load Diff
@@ -633,9 +633,3 @@ def get_package_dir(mod_name):
if os.path.isdir(mod_path):
return mod_path
return None
def absolute_path(filename):
"""
Provides a version of the filename that's absolute (and NOT normalized).
"""
return get_abs_path_real_path_and_base_from_file(filename)[0]
@@ -26,6 +26,7 @@ import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketException;
import java.util.*;
public class MultiProcessDebugger implements ProcessDebugger {
@@ -537,7 +538,14 @@ public class MultiProcessDebugger implements ProcessDebugger {
sendDebuggerPort(socket, serverSocket, myMultiProcessDebugger.myDebugProcess);
socket.close();
}
debugger.waitForConnect();
try {
debugger.waitForConnect();
} catch (SocketException e) {
LOG.info("Socket exception while waiting for debugger connection", e);
disconnect();
return;
}
debugger.handshake();
myMultiProcessDebugger.addDebugger(debugger);
myMultiProcessDebugger.myDebugProcess.init();
@@ -597,9 +605,9 @@ public class MultiProcessDebugger implements ProcessDebugger {
}
public void disconnect() {
myShouldAccept = false;
if (myServerSocket != null) {
synchronized (this) {
synchronized (this) {
myShouldAccept = false;
if (myServerSocket != null) {
if (!myServerSocket.isClosed()) {
try {
myServerSocket.close();
@@ -66,12 +66,14 @@ public class ServerModeDebuggerTransport extends BaseDebuggerTransport {
}
}
finally {
if (!myServerSocket.isClosed()) {
try {
myServerSocket.close();
}
catch (IOException e) {
LOG.warn("Error closing socket", e);
synchronized (mySocketObject) {
if (!myServerSocket.isClosed()) {
try {
myServerSocket.close();
}
catch (IOException e) {
LOG.warn("Error closing socket", e);
}
}
}
}
@@ -117,8 +117,7 @@ public abstract class PyCustomConfigDebuggerTask extends PyBaseDebuggerTask {
}
protected void killDebugProcess() {
if (myDebugProcess.getProcessHandler() instanceof KillableColoredProcessHandler h) {
if (myDebugProcess.getProcessHandler() instanceof KillableProcessHandler h) {
h.killProcess();
}
else {