369 Commits

Author SHA1 Message Date
Andrey Lisin
a8ca44f462 PY-75228 Fix issue with newly added breakpoints being ignored during debugging in Python 3.12
GitOrigin-RevId: 8a2b591dff069a2531d6af472955fbc62c4e531d
2024-09-09 15:19:11 +00:00
Andrey Lisin
8df8e0686d Set up diagnostic prints for Python debugger prior to invoking logging function for the first time
GitOrigin-RevId: 8c6933a3f0f64cb027acd4a92211465507fbb243
2024-08-19 17:57:24 +00:00
Andrey Lisin
a42f335cf4 PY-60597 Set global debugger to None and clear thread local info when stopping tracing
The global debugger reference should be set to `None` right away. Otherwise, the reference to the stopped debugger can leak to `ThreadTracer` leading to skipped breakpoints. The same applies for the thread local info. If it is not reset, the frame evaluation code will continue using a tracing function with the stale debugger reference.

GitOrigin-RevId: 62b38316e4da760213810a55aa98db289ce45720
2024-06-19 16:18:01 +00:00
Andrey Lisin
dbc08a7507 PY-72009 Set global debugger after all its fields initialization
The `set_global_debugger` invocation has been moved to a later point to ensure all debugger fields are initialized first. This addresses potential issues in multithreaded environments where the debugger is accessible, but access to its fields may fail.

GitOrigin-RevId: 55dd63585f8dae94c6527d51dca3c2562b30c4ce
2024-05-29 12:59:41 +00:00
Andrey Lisin
f63cf727f7 PY-42044 Also halt value resolve threads when resuming, smart stepping into, and running to line
GitOrigin-RevId: 06e032e8cf789e0976b988105319f731d9932419
2024-05-23 21:47:39 +00:00
Andrey Lisin
74ad931cfc PY-42044 Make code compatible with Python 2
GitOrigin-RevId: dcf169c791ca1ba539cbe3a123f94242504f87c6
2024-05-23 21:47:34 +00:00
Andrey Lisin
dc937ea423 PY-42044 Clear list of debugger value resolve threads after they are stopped
GitOrigin-RevId: 9820ba6506238045f0a86a9e4deaf63a6cce2c10
2024-05-23 21:47:13 +00:00
Andrey Lisin
34305d8805 PY-42044 Kill debugger value resolve threads when stepping is performed
GitOrigin-RevId: cdc6014855211c0cf0aa3f0f9b1ade7e901fce9a
2024-05-23 21:47:08 +00:00
Andrey Lisin
3e687caf67 PY-72239 Make sure PEP 669-based monitoring is activated only once
GitOrigin-RevId: 3c4b0cf7747fe7ebbca442b39c3c9234e7129180
2024-05-10 12:13:11 +00:00
Andrey Lisin
b64fa0c0ae PY-72239 Minor: naming
GitOrigin-RevId: 9cda732ac490a0d80030abdd1ff9e02452d8c46a
2024-05-10 12:13:11 +00:00
Egor.Eliseev
9d5bf3eac3 PY-62467 TypeError: 'Task' object is not callable debugging uvloop with asyncio support enabled
Fix `asyncio` patching check.
Since other libraries (`uvloop`) can replace an event loop later than our first entry to `pydevd_nest_asyncio.py`,
it is necessary to check the success of the patching every time when we use the asyncio library.


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

GitOrigin-RevId: e9b907ed0020e48cb7c29c18b000d46baee9f6cb
2024-03-06 14:19:51 +00:00
Andrey Lisin
d740d64301 PY-70629 Replace class-based sys.monitoring events callbacks with functions
GitOrigin-RevId: e89c896c1e29ac1c287930afdd6764215ee62eec
2024-02-23 14:16:44 +00:00
Egor.Eliseev
c856c6ac33 PY-64544 Turn on "Asyncio support for the debugger" feature by default
Merge-request: IJ-MR-121622
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: b4146183e0626c8ec78e22ae828349e34f53a9e2
2024-01-10 11:29:48 +00:00
Andrey Lisin
5c117f0ac6 PY-37366 Add diagnostic message
GitOrigin-RevId: 6a817226a874c96ac0e3d698963f2c23f97cc02d
2024-01-04 10:30:41 +00:00
Andrey Lisin
78f607f45a PY-64487 Don't patch threads when sys.monitoring is in use because callbacks are per interpreter, not per thread
GitOrigin-RevId: 78f4d967dea9b357a0b15bd8291d8c39f4e49dfd
2023-12-11 16:10:13 +00:00
Andrey Lisin
7bbdf1f090 PY-62566 Add experimental Cython module for PEP 669 based debugger on macOS
GitOrigin-RevId: 7f13e1289e5942b05acec42bf04f46b480002897
2023-11-20 16:10:37 +00:00
Andrey Lisin
95a844f2cb PY-62566 Add experimental support of low impact debugging for Python 3.12 based on PEP 669
GitOrigin-RevId: 020a245fb44623870075e071fbba6b6c75e81d09
2023-09-22 17:26:41 +00:00
Egor Eliseev
2ecdf794a3 PY-57290 Debugger asyncio improvements
Patch field '_ready' from asyncio event loop for internal coroutine.
Patch `asyncio.new_event_loop()`
Add wrapper 'PyDevCoro' for internal coroutine.
Patch `asyncio.Task.__init__`, `asyncio.ensure_future` and `asyncio.call_soon`.
Add tests for `asyncio.gather` function.
Patch `asyncio.new_event_loop()`.

IJ-CR-99158

GitOrigin-RevId: 881087716a84c8ebb5331de4e2829bf38f2090e2
2023-03-22 16:10:02 +00:00
Pavel Karateev
4856922b5c PY-56773 Replace deprecated setName()
GitOrigin-RevId: f3e1cc3c28a9b2f90ceaca80660b9ce72c4b6f2a
2022-10-20 14:33:44 +00:00
Egor Eliseev
d55920e2d5 PY-33969 Debugger crashes while patching matplotlib with multiprocessing
Add patching only from main thread. Prevent data racing.

IJ-CR-26395

GitOrigin-RevId: a0883cdea144261ae34184e4c5cb563471e634b5
2022-07-11 07:13:48 +00:00
Egor Eliseev
398223b689 PY-44090 Don't join CheckOutputThread
IJ-CR-26025

GitOrigin-RevId: d1ddd6d0017f07827da74766c265b38367e6baad
2022-07-06 07:25:04 +00:00
Andrey Lisin
c210c28ab5 PY-49453 Replace the rest of deprecated methods in debugger
(cherry picked from commit f6f7f0ffed6cd2d51410e9fe07267f813b4c4ff1)

IJ-MR-22034

GitOrigin-RevId: eff02449dcab685184cb9c7d4e86fb9766fb5196
2022-05-24 13:07:16 +00:00
Elizaveta Sidorova
260d4cbd0b PY-21984 Support Type Renderers for Python
GitOrigin-RevId: e8413ebb22667882f7fb9befc006f8ce676ca7b1
2022-02-21 15:44:08 +00:00
Egor Eliseev
f6260577ab PY-52808 threading module DeprecationWarnings
Change:
'thread.setDaemon(val)' to 'thread.daemon = val'
'thread.isDaemon()' to 'thread.daemon'
'condition.notifyAll()' to 'condition.notify_all()'
'event.isSet()' to 'event.is_set()'

GitOrigin-RevId: 76191fde184b407251303684cb85be9cfda3c7ae
2022-02-21 08:08:42 +00:00
Egor Eliseev
2a9d5417f0 PY-49453 DeprecationWarning: currentThread() is deprecated
GitOrigin-RevId: 896a4a150ba61936f0fdee93c6bd4fefa93ad2ac
2021-11-16 08:07:56 +00:00
gaborbernat
6e3c457f43 PY-45659 Python isolated mode (-I) breaks subprocess debugging (pr #1488)
Signed-off-by: Elizaveta Shashkova <elizaveta.shashkova@jetbrains.com>

IDEA-CR-69971

GitOrigin-RevId: 9db39b45fe40dd7d60af38c49d9cbb76870ac7f6
2020-12-31 11:13:01 +00:00
Andrey Lisin
8e73fa69fd PY-44245 Fix debugger leakage through thread-local storage
The bug was caused by the improper clean-up of the thread-local information. `clear_thread_local_info()` was meant to clear the thread-local information from the common Cython module but actually reset the `_thread_local_info` from a version-specific module. This lead to the debugger instance leakage to new processes. This, in turn, caused debugger crashes and freezes.

(cherry picked from commit 2fd3ac3dc5657490b451cf4f0e62e715b65e461f)

IDEA-CR-68594

GitOrigin-RevId: 75e056b6d9cc82aceb0ef2cb51152c7bf81b4b94
2020-11-16 11:49:04 +00:00
Andrey Lisin
b7eadf86e1 Check if thread should not be traced before logging traced debugger thread warning
It's important to check the `pydev_do_not_trace` attribute before printing the warning because sometimes `run()` method's code is called in the same thread, e.g. in the `Dispatcher` class. The absence of this check leads to a confusing false-positive warning.

GitOrigin-RevId: 62514d5cb99f0181631366d68fe914220fb168d7
2020-11-02 10:44:07 +00:00
Andrey Lisin
c5b8178539 PY-45053 Disable tracing for new processes created with os.fork() when automatic attaching to subprocess is disabled
(cherry picked from commit 78b4b62d5992f775e54c59a81b065925467e6c31)

IDEA-CR-68169

GitOrigin-RevId: a1e4a9d2a42c62ba6629f1f91bbd17bcb27dfef5
2020-10-29 10:52:21 +00:00
Andrey Lisin
c094aa911d Add "--help" command line option to Python debugger
GitOrigin-RevId: b9a2c12ef2d2f63eda4953e7a7237714ba520a8a
2020-10-20 16:44:52 +00:00
Andrey Lisin
f79a93b7c6 IDEA-CR-65134: PyDev: Properly support pythonw (sys.stdout is None) (PY-43498)
(cherry picked from commit bb444ad59a7a61ab1cab46eacda1eecf917848fc)

GitOrigin-RevId: 188b265d02d446e2f77ba699b2aa8f0c57064a09
2020-07-17 15:37:40 +00:00
Andrey Lisin
8b330bdc43 IDEA-CR-63494: PY-9848 Drop to debugger on test failures
(cherry picked from commit 4f89fb3e2b76309baaa849ecf25dbebf7a21b704)

GitOrigin-RevId: d2aaff322df6d530e85b7b88767e541f745ea89f
2020-06-15 22:29:03 +03:00
Andrey Lisin
2f87d7c3ae IDEA-CR-58850: PY-24748 Support step over for coroutines
(cherry picked from commit b66707327989822f23c57aa19fa81dd38a02ed67)

GitOrigin-RevId: e85b75676c138cf9ce2de0ac07a88f19a730f5c0
2020-03-02 16:09:44 +00:00
Andrey Lisin
3aa63f4f04 Fix attribute error when resetting smart step stop frame on step into and step over commands
GitOrigin-RevId: 5b8193f9ff5af8de7975e0b6a634d2984dc3f9b6
2020-02-21 17:31:28 +00:00
Andrey Lisin
73d20cd1cd PY-38704 Backport attach to process updates from PyDev
(cherry picked from commit 11777e3e2639202817fa70d8453fed50720845ce)

GitOrigin-RevId: 2ae85368c63f1a282c4358d8610a5724767871a2
2019-11-11 10:32:50 +00:00
Andrey Lisin
2d8453d970 PY-37645 Add Python debugger fallback exception hook
GitOrigin-RevId: e5f9bbd865e25eeae19842b983ba6855dfeba250
2019-09-16 16:33:16 +00:00
Andrey Lisin
a887688004 PY-36952 Hide debugger related stack trace when debugger is stopped
GitOrigin-RevId: e40dbaf9829677bec78338c016ea40091a2c713c
2019-09-16 09:32:16 +00:00
Andrey Lisin
bfe9d87d54 PY-37212 Show traceback when terminating on uncaught exception
GitOrigin-RevId: 0c2772e0449a5ff5be06d1b0398e70abeae56dfd
2019-09-03 15:34:42 +00:00
Andrey Lisin
13703f2d53 PY-35999 Ignore exceptions in library files when debugging
GitOrigin-RevId: aea3f28d3941c9add7ee0620d382371d9246f1a6
2019-08-27 15:43:02 +00:00
Andrey Lisin
def9935b76 PY-36422 Check binaries version before accessing attributes
GitOrigin-RevId: 7e3c1ce619d8c738679253b45dcfa34d3a91a226
2019-07-04 18:44:25 +03:00
Rustam Vishnyakov
123242c4b2 EditorConfig documentation test
GitOrigin-RevId: fd52ace3d7a32ecd02c2c5ab90e077967604c15e
2019-06-16 04:03:21 +03:00
Egor Zhdan
c1813cfb52 Cleanup: NotNull/Nullable
GitOrigin-RevId: b8e892f32ea84c2115973155dba7127b892cc36e
2019-06-16 04:02:08 +03:00
Anna Kozlova
91f7445298 constructor reference: don't ignore constructor parameters during method reference inference (IDEA-185578)
GitOrigin-RevId: e836468e05db28157713e9edd3c70382f8ecdebc
2019-06-13 03:15:49 +03:00
Egor Zhdan
39d2d77155 Cleanup: NotNull/Nullable
GitOrigin-RevId: b8e892f32ea84c2115973155dba7127b892cc36e
2019-06-13 03:14:35 +03:00
Julia Beliaeva
3fee046d20 [vcs-log] cleanup RootCellRenderer
GitOrigin-RevId: bba216626193ac756cd133b8ae9bc4e577abea42
2019-06-10 04:10:14 +03:00
Eldar Abusalimov
dcaeb8f8c7 OC-4061: ApplicationUtil: Make runWithCheckCanceled() return result
GitOrigin-RevId: 3aa9f23cc5097e644eddf82a4faca669759b4760
2019-06-10 04:09:35 +03:00
Andrey Lisin
41915c9c6a PyDev fixes: remove unused import
GitOrigin-RevId: cc00f2c1f39297a8e96b8e5d91e1966e76211051
2019-06-07 18:33:41 +03:00
Andrey Lisin
1cba9cb422 PyDev fixes: patch threads only once
GitOrigin-RevId: 163900e827d5233c421bd0961e06d25b3ba42806
2019-06-07 18:29:34 +03:00
Andrey Lisin
034426be82 PyDev fixes: fix Jupyter cells debugging
GitOrigin-RevId: d39eec5c50ca4100f45f1f42eb4af3aa1f384352
2019-06-07 18:29:03 +03:00
Andrey Lisin
41a97ce301 PyDev fixes: fix issues found so far after rebase
GitOrigin-RevId: 587bb14ee4a392e02a8fd5255f4ccf5a68f4e72c
2019-06-07 18:26:30 +03:00