Commit graph

20 commits

Author SHA1 Message Date
Pavel Minaev
0a9b01b008 Fix #865: Debugging through poetry drops subprocess
Handle "exited" { "pydevdReason": "processReplaced" } appropriately.

Add test for os.exec() in-place process replacement.
2022-06-09 10:44:10 -07:00
Pavel Minaev
d1e5db7d8e Use new-style super() everywhere. 2022-04-13 11:38:41 -07:00
Pavel Minaev
dd5196fbfc Blacken code. 2022-04-13 11:38:41 -07:00
Pavel Minaev
0f428178b0 Remove debugpy.compat, custom !j formatter for JSON, and related helpers. 2022-04-13 11:38:41 -07:00
Pavel Minaev
1965b47034 Get rid of fmt() and use idiomatic format() and f"" instead. 2022-04-13 11:38:41 -07:00
Pavel Minaev
e87017e0b3 Remove redundant "from __future__ import ..." 2022-04-13 11:38:41 -07:00
Pavel Minaev
6ad1382a8c Fix https://github.com/microsoft/ptvsd/issues/1824:
Allow ptvsd to run as server and let code connect to it

Expose --connect and debugpy.connect() as a public API, and add tests for it.
2020-03-05 13:56:22 -08:00
Pavel Minaev
8b4c40e922 Rename ptvsd -> debugpy. 2020-01-17 11:57:13 -08:00
Pavel Minaev
d5fe978d5e Add ResponseOccurrence.result to alias Response.result 2019-11-18 13:50:14 -08:00
Pavel Minaev
fad3c4f878 Add "from __future__ import division" to all ptvsd modules. 2019-10-30 17:12:17 -07:00
Pavel Minaev
8f358d6e0f Refactor tests.debug to accommodate ptvsd.server spawning the adapter, and remove the need for "custom_client" and "custom_server" start methods.
Fix launcher not propagating debuggee exit code.

Fix attach-by-PID without explicit --log-dir overriding PTVSD_LOG_DIR (and disabling logging).

Improve test logging, with a separate directory for every test.

Various test fixes.
2019-09-26 13:20:26 -07:00
Pavel Minaev
eb1bb4dd5b Test fixes. 2019-09-11 20:12:12 -07:00
Pavel Minaev
340942aafc Fix #1695: Handle IDE, launcher, debug server, and no-debug disconnect
Fix #1721 "runInTerminal" is broken on non-Windows platforms.

Fix #1722: Output is not captured in "noDebug" with "runInTerminal"

Groundwork for #1713: adapter: multiple concurrent sessions

Move "launch" request parsing and debuggee process spawning, PID reporting and tracking, stdio "output" capture, and exit code reporting into launcher. Launcher now communicates to the adapter via a full-fledged message channel.

Refactor adapter. Add an abstraction for a debug session, and treat IDE, launcher, and debug server as separate components managed by that session.

Improve adapter logging to capture information about current debug session, and current message handler if any.

Fix reporting exceptions from message handlers.

Various test fixes.
2019-09-10 15:12:23 -07:00
Pavel Minaev
e94980f86c Do not load ptvsd.server (and hence, pydevd) unless the subpackage is loaded explicitly or via a public API entrypoint that requires it.
Move docstrings to top-level package, and update them to reflect the current behavior.

Remove unused code in ptvsd.common.log.

Move sys.path/prefix/site_packages logging into ptvsd.common.log, and log it from adapter and server to the same level of detail as the tests.

Fix injected code snipped for attach-by-PID.

Fix some Unicode issues in adapter and tests.

Refactor Timeline, debug.Session, and start methods.
2019-08-18 11:43:23 -07:00
Pavel Minaev
5dcca5fce0 Fix wrapping in timeline logs, and increase the repr length limit accordingly. 2019-07-18 10:13:02 -07:00
Pavel Minaev
edd5753d7e Further improve timeline logging:
Reformat various timeline log entries to improve readability.

Add pretty-printing of composite expectations, to match pretty-printed JSON.

Avoid redundant repetitions of messages when explaining how occurrences matched expectations.
2019-07-18 10:13:02 -07:00
Pavel Minaev
22f25c8d04 Fix timeline logging on Python 2. 2019-07-18 10:13:02 -07:00
Pavel Minaev
8d189c8e91 Improve timeline logging for DAP messages:
Show only the metadata necessary to identify the message to reduce verbosiy.

Use JSON representation for easy matching against message logs.
2019-07-18 10:13:02 -07:00
Pavel Minaev
c03206972d Fix remaining tests to reflect the debug adapter refactoring changes.
Fix Flask and Django multiprocess tests.

Fix test logs not being captured by pytest.

Fix "import debug_me" check improperly applied in tests where it is unnecessary.

Fix some clarifying patterns not respecting the underlying pattern.

Add pattern helpers for strings: starting_with, ending_with, containing.

Move DAP test helpers to a separate module, and add a helper for frames.

Add support for line markers when setting breakpoints and matching frames.

Assorted test fixes around handling of Unicode and paths.
2019-07-11 16:19:06 -07:00
Pavel Minaev
f71f0a5b0a Tests refactoring. (#1543) 2019-06-28 10:13:00 -07:00
Renamed from tests/helpers/timeline.py (Browse further)