Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Jan 14, 2024
1 parent 47300e0 commit 0adf52d
Show file tree
Hide file tree
Showing 88 changed files with 24,086 additions and 23,086 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/pydevd-tests-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
name: [
"ubuntu-pypy3",
"macos-py37-cython",
"ubuntu-py38-cython-checkbin",
"ubuntu-py38-cython",
"windows-py39-cython",
"windows-py310-cython",
"windows-py310-cython-checkbin",
"windows-py311-cython",
"ubuntu-py311-cython",
"ubuntu-py312-cython",
Expand All @@ -34,15 +34,15 @@ jobs:
python: "3.7"
os: macos-latest
PYDEVD_USE_CYTHON: YES
- name: "ubuntu-py38-cython-checkbin"
- name: "ubuntu-py38-cython"
python: "3.8"
os: ubuntu-latest
PYDEVD_USE_CYTHON: YES
- name: "windows-py39-cython"
python: "3.9"
os: windows-latest
PYDEVD_USE_CYTHON: YES
- name: "windows-py310-cython"
- name: "windows-py310-cython-checkbin"
python: "3.10"
os: windows-latest
PYDEVD_USE_CYTHON: YES
Expand Down Expand Up @@ -88,11 +88,11 @@ jobs:
pip install psutil --no-warn-script-location
pip install ipython --no-warn-script-location
pip install untangle --no-warn-script-location
pip install "django<=4.2" --no-warn-script-location
- name: Install Python 3.x deps
if: contains(matrix.name, 'py3') && !contains(matrix.name, 'pypy') && !contains(matrix.name, 'py311') && !contains(matrix.name, 'py312')
if: contains(matrix.name, 'py3') && !contains(matrix.name, 'pypy') && !contains(matrix.name, 'py312') && !contains(matrix.name, 'py311')
run: |
pip install PySide2 --no-warn-script-location
pip install django
pip install cherrypy --no-warn-script-location
pip install gevent greenlet
- name: Install Pandas
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ snippet.py
build/*
.pytest_cache
/.mypy_cache/
.DS_Store
176 changes: 0 additions & 176 deletions LICENSE-APACHE

This file was deleted.

5 changes: 3 additions & 2 deletions _pydev_bundle/pydev_monkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys
from _pydev_bundle._pydev_saved_modules import threading
from _pydevd_bundle.pydevd_constants import get_global_debugger, IS_WINDOWS, IS_JYTHON, get_current_thread_id, \
sorted_dict_repr, set_global_debugger, DebugInfoHolder
sorted_dict_repr, set_global_debugger, DebugInfoHolder, PYDEVD_USE_SYS_MONITORING
from _pydev_bundle import pydev_log
from contextlib import contextmanager
from _pydevd_bundle import pydevd_constants, pydevd_defaults
Expand Down Expand Up @@ -234,7 +234,8 @@ def _on_forked_process(setup_tracing=True):

def _on_set_trace_for_new_thread(global_debugger):
if global_debugger is not None:
global_debugger.enable_tracing()
if not PYDEVD_USE_SYS_MONITORING:
global_debugger.enable_tracing()


def _get_str_type_compatible(s, args):
Expand Down
4 changes: 2 additions & 2 deletions _pydev_runfiles/pydev_runfiles_xml_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def notifyTest(self, *args):
class ServerComm(threading.Thread):

def __init__(self, notifications_queue, port, daemon=False):
threading.Thread.__init__(self)
self.setDaemon(daemon) # If False, wait for all the notifications to be passed before exiting!
# If daemon is False, wait for all the notifications to be passed before exiting!
threading.Thread.__init__(self, daemon=daemon)
self.finished = False
self.notifications_queue = notifications_queue

Expand Down
17 changes: 14 additions & 3 deletions _pydevd_bundle/pydevd_additional_thread_info_regular.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def __str__(self):


_set_additional_thread_info_lock = ForkSafeLock()
_next_additional_info = [PyDBAdditionalThreadInfo()]


def set_additional_thread_info(thread):
Expand All @@ -145,9 +146,19 @@ def set_additional_thread_info(thread):
with _set_additional_thread_info_lock:
# If it's not there, set it within a lock to avoid any racing
# conditions.
additional_info = getattr(thread, 'additional_info', None)
try:
additional_info = thread.additional_info
except:
additional_info = None

if additional_info is None:
additional_info = PyDBAdditionalThreadInfo()
thread.additional_info = additional_info
# Note: don't call PyDBAdditionalThreadInfo constructor at this
# point as it can piggy-back into the debugger which could
# get here again, rather get the global ref which was pre-created
# and add a new entry only after we set thread.additional_info.
additional_info = _next_additional_info[0]
thread.additional_info = additional_info
del _next_additional_info[:]
_next_additional_info.append(PyDBAdditionalThreadInfo())

return additional_info
15 changes: 10 additions & 5 deletions _pydevd_bundle/pydevd_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
from _pydevd_bundle.pydevd_comm_constants import (CMD_THREAD_SUSPEND, file_system_encoding,
CMD_STEP_INTO_MY_CODE, CMD_STOP_ON_START, CMD_SMART_STEP_INTO)
from _pydevd_bundle.pydevd_constants import (get_current_thread_id, set_protocol, get_protocol,
HTTP_JSON_PROTOCOL, JSON_PROTOCOL, DebugInfoHolder, IS_WINDOWS)
HTTP_JSON_PROTOCOL, JSON_PROTOCOL, DebugInfoHolder, IS_WINDOWS,
PYDEVD_USE_SYS_MONITORING)
from _pydevd_bundle.pydevd_net_command_factory_json import NetCommandFactoryJson
from _pydevd_bundle.pydevd_net_command_factory_xml import NetCommandFactory
import pydevd_file_utils
Expand All @@ -32,6 +33,7 @@
from _pydevd_bundle.pydevd_daemon_thread import run_as_pydevd_daemon_thread
from _pydevd_bundle.pydevd_thread_lifecycle import pydevd_find_thread_by_id, resume_threads
import tokenize
from _pydevd_sys_monitoring import pydevd_sys_monitoring

try:
import dis
Expand Down Expand Up @@ -562,7 +564,7 @@ def add_breakpoint(
id_to_pybreakpoint[breakpoint_id] = added_breakpoint
py_db.consolidate_breakpoints(canonical_normalized_filename, id_to_pybreakpoint, file_to_line_to_breakpoints)
if py_db.plugin is not None:
py_db.has_plugin_line_breaks = py_db.plugin.has_line_breaks()
py_db.has_plugin_line_breaks = py_db.plugin.has_line_breaks(py_db)
py_db.plugin.after_breakpoints_consolidated(py_db, canonical_normalized_filename, id_to_pybreakpoint, file_to_line_to_breakpoints)

py_db.on_breakpoints_changed()
Expand Down Expand Up @@ -680,7 +682,7 @@ def remove_breakpoint(self, py_db, received_filename, breakpoint_type, breakpoin
del id_to_pybreakpoint[breakpoint_id]
py_db.consolidate_breakpoints(canonical_normalized_filename, id_to_pybreakpoint, file_to_line_to_breakpoints)
if py_db.plugin is not None:
py_db.has_plugin_line_breaks = py_db.plugin.has_line_breaks()
py_db.has_plugin_line_breaks = py_db.plugin.has_line_breaks(py_db)
py_db.plugin.after_breakpoints_consolidated(py_db, canonical_normalized_filename, id_to_pybreakpoint, file_to_line_to_breakpoints)

except KeyError:
Expand Down Expand Up @@ -797,7 +799,7 @@ def add_plugins_exception_breakpoint(self, py_db, breakpoint_type, exception):
supported_type = plugin.add_breakpoint('add_exception_breakpoint', py_db, breakpoint_type, exception)

if supported_type:
py_db.has_plugin_exception_breaks = py_db.plugin.has_exception_breaks()
py_db.has_plugin_exception_breaks = py_db.plugin.has_exception_breaks(py_db)
py_db.on_breakpoints_changed()
else:
raise NameError(breakpoint_type)
Expand Down Expand Up @@ -830,7 +832,7 @@ def remove_plugins_exception_breakpoint(self, py_db, exception_type, exception):
supported_type = plugin.remove_exception_breakpoint(py_db, exception_type, exception)

if supported_type:
py_db.has_plugin_exception_breaks = py_db.plugin.has_exception_breaks()
py_db.has_plugin_exception_breaks = py_db.plugin.has_exception_breaks(py_db)
else:
pydev_log.info('No exception of type: %s was previously registered.', exception_type)

Expand Down Expand Up @@ -924,6 +926,9 @@ def stop_on_entry(self):
info = set_additional_thread_info(main_thread)
info.pydev_original_step_cmd = CMD_STOP_ON_START
info.pydev_step_cmd = CMD_STEP_INTO_MY_CODE
if PYDEVD_USE_SYS_MONITORING:
pydevd_sys_monitoring.update_monitor_events(suspend_requested=True)
pydevd_sys_monitoring.restart_events()

def set_ignore_system_exit_codes(self, py_db, ignore_system_exit_codes):
py_db.set_ignore_system_exit_codes(ignore_system_exit_codes)
Expand Down
Loading

0 comments on commit 0adf52d

Please sign in to comment.