Commit graph

64 commits

Author SHA1 Message Date
Pavel Minaev
14ca4f07d1 Fix #351: Python warnings in debugger code
Don't use inspect.getargspec on Python 2.

Close log file objects on exit.

Close os.devnull file objects on exit.

Close the listener socket used to get endpoints info from adapter.

Fix invalid escape sequences.

Run tests with Python warnings treated as errors.

Fix Django deprecation warning in test web app.

Work around pytest issues caused spaces in test names.
2020-09-03 01:32:58 -07:00
Pavel Minaev
2c524faacd Fix #305: Add "pythonArgs" config property for interpreter arguments
Expose "pythonArgs" to clients.

Make "python" usable in tests in lieu of "pythonPath", and make the runners use it.

Add tests for all combinations of "python"/"pythonPath" and "pythonArgs".
2020-08-03 11:45:55 -07:00
Pavel Minaev
73665b9af9 Parse and apply "python" / "pythonPath" in the adapter rather than in the launcher.
Fix errors with missing "args".

Add test for "pythonPath".
2020-05-08 17:10:34 -07:00
Pavel Minaev
1a44e70206 Fix #156: Add a flag for the old way of handling args from a launch config
Add new property "argsExpansion", which defaults to "shell", but can be explicitly set to "none" to request no expansion.

Propagate "args" to launcher via CLI or JSON, depending on the value of "argsExpansion".

Move the logic to compute process name back to the adapter, alongside other processing of "launch" targets.
2020-05-07 12:31:40 -07:00
Pavel Minaev
50bf46cf9d Add test for "args" shell expansion. 2020-04-22 13:55:01 -07:00
Fabio Zadrozny
011810aa42 Change __len__ to len(). 2020-04-21 08:20:54 -03:00
Fabio Zadrozny
d2014babd6 Show globals, group variables and show all dir() variables.
Fixes https://github.com/microsoft/ptvsd/issues/118
Fixes https://github.com/microsoft/ptvsd/issues/763
Fixes https://github.com/microsoft/ptvsd/issues/1621
2020-04-21 08:20:54 -03:00
Pavel Minaev
47dd3da5e7 Fix #99: multiprocessing triggers preLaunchTask and postDebugTask more than once
Remove "preLaunchTask" and "postDebugTask" from derived debug configurations generated for subprocesses.
2020-04-03 15:46:09 -07:00
Pavel Minaev
32c00bc85c Fix #92: Debugging as sudo fails to terminate the debugger when you stop
Apply sudo to debugpy.launcher, rather than the debuggee itself.
2020-04-01 21:16:20 -07:00
Pavel Minaev
2d35573eda Fix #90: "subProcess" is not respected
Propagate "subProcess" to the debug server via command line in launch scenarios.

Fix debugpy.configure() being a no-op rather than a shim for api.configure().
2020-04-01 20:10:34 -07:00
Pavel Minaev
dccb5e6198 Use "connect":{...} and "listen":{...} to indicate direction of connection in debug configuration. 2020-03-05 13:56:22 -08:00
Pavel Minaev
2d013e58ec Swap attach_listen / attach_connect to reflect the client perspective. 2020-03-05 13:56:22 -08: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
4f43e00a07 Remove suppport for arrays in "program" and "module" debug configuration properties as alternative to "args".
Change the meaning of array for "code" debug configuration property to represent multiple lines of code.

Switch tests to use "args".
2020-02-21 15:55:17 -08:00
Pavel Minaev
de9ea2cb9c Improve exception logging to make swallowing/reraising explicit in all cases. 2020-02-21 15:55:04 -08:00
Pavel Minaev
8c114ed589 Purge all mentions of "IDE", and replace with "client" or "clients" as appropriate.
Blacken code.
2020-02-11 17:03:45 -08:00
Pavel Minaev
8447a15396 Refactor debugpy API and CLI for clarity and consistency. 2020-02-11 14:40:25 -08:00
Fabio Zadrozny
5d5f8f42ec Re-attach to pid when using --client. Fixes https://github.com/microsoft/ptvsd/issues/1817 2020-02-06 08:31:28 -03:00
Pavel Minaev
367ff72788 Send both "ptvsd" and "debugpy" telemetry events for smooth transition. 2020-01-29 14:32:28 -08:00
Pavel Minaev
55eac82c96 Fix #1811: tests using attach_by_pid fail on Python 2.7
Don't call enable_attach() and wait_for_attach() while under import lock.
2020-01-26 17:14:30 -08:00
Pavel Minaev
784f7bc271
Merge pull request #1 from int19h/1776
Fix https://github.com/microsoft/ptvsd/issues/1776
2020-01-21 22:24:39 -08:00
Pavel Minaev
00b6a202f3 Fix test_autokill 2020-01-21 17:27:28 -08:00
Pavel Minaev
522c3743f0 Another workaround for https://bugs.python.org/issue37380 2020-01-21 16:33:44 -08:00
Pavel Minaev
9bb539a2fc Work around https://bugs.python.org/issue37380 in tests. 2020-01-21 15:39:17 -08:00
Pavel Minaev
8b4c40e922 Rename ptvsd -> debugpy. 2020-01-17 11:57:13 -08:00
Pavel Minaev
0076925d17 Improve test logging on session exit. 2019-12-13 18:37:56 -08:00
Pavel Minaev
eb50bc29df Disable attach tests on macOS + Python 3.6 due to #1967
Gracefully handle server abruptly disconnecting from adapter for the initial connection.

Fix test_exclude_rules to wait until debuggee terminates.
2019-12-13 18:37:56 -08:00
Pavel Minaev
a654c9834f Fix #1983: Attach to process: Support pid sent as a string from the extension
Allow "processId" in "attach" request to be a string, if it can be parsed as int.
2019-12-13 18:37:56 -08:00
Pavel Minaev
3b71a1257a Fix ptvsd telemetry event check in tests. 2019-12-13 12:29:34 -08:00
Pavel Minaev
e9a5b68054 Simplify options handling. 2019-12-11 20:42:01 -08:00
Pavel Minaev
a3acba68d5 Tweak test log formatting to match adapter logs, and reset session ID between tests. 2019-12-08 14:13:58 -08:00
Pavel Minaev
b23031b773 Disable "redirectOutput" in tests by default. 2019-12-08 14:13:58 -08:00
Pavel Minaev
c545ccb5f8 Fix and re-enable test_reattach. 2019-12-04 09:32:59 -08:00
Pavel Minaev
4fb41ca083 Disable attach_to_pid tests on MacOS + Python 2.7 (#1916) 2019-11-19 12:05:57 -08:00
Pavel Minaev
75a7417e87 Disable attach_by_pid(wait=True) tests on Win32 and Mac due to #1926 2019-11-19 12:05:57 -08:00
Pavel Minaev
bc40fef197 Fix attach_by_pid test runner not properly waiting before running debuggee code. 2019-11-19 12:05:57 -08:00
Pavel Minaev
36485c02c6 Fix #1884: Use sys.platform over platform.system() 2019-11-19 12:05:57 -08:00
Pavel Minaev
ca8e6a137b Reduce default test matrix to avoid redundant tests. 2019-11-19 12:05:57 -08:00
Pavel Minaev
fb6d35ebea Improve failed test diagnostics. 2019-11-18 13:50:14 -08:00
Pavel Minaev
9b34bc0dac Fix #1918: ptvsd port conflicts in test runs 2019-11-15 11:55:27 -08:00
Pavel Minaev
3fc156ca32 Disable attach-to-PID tests on Travis due to #1915. 2019-11-15 11:55:27 -08:00
Pavel Minaev
646981e4af Fix #1810: tests using attach_by_pid fail on Linux and macOS
Add time.sleep() to attach_by_pid spinning loop to give the injected code a better chance to execute.

Read and log injector output to prevent it from blocking on prints.

Improve code injection logging.

Fix race between socket.accept() backchannel listener thread, and debug.Session.close().
2019-11-15 11:55:27 -08:00
Pavel Minaev
173f9b3a48 Fix race condition in backchannel socket cleanup. 2019-11-12 18:13:25 -08:00
Pavel Minaev
095e5bcd5c Fix #1713: Adapter: multiple concurrent sessions 2019-10-30 17:12:17 -07:00
Pavel Minaev
b2111b93ca Switch test output capture to use os.pipe(). Fixes #1819. 2019-10-16 11:44:17 -07:00
Pavel Minaev
b3f0265785 Place pydevd log file in debug.Session log directory, for better handling of multi-session (e.g. multiproc) tests.
Always log to disk for test runs, and dump all ptvsd and pydevd logs on test failures and timeouts.
2019-10-16 11:44:17 -07:00
Fabio Zadrozny
c0108c08b5 Use pid for files created in pydevd logging. Fixes #1831 2019-10-15 08:30:36 -03:00
Karthik Nadig
c6cee270ca
Reverse the connection direction used by enable attach internals. (#1833)
* Minor cleanup
* Reverse the direction used by enable attach internals.
* Handle occasional Invalid argument
2019-10-08 22:24:27 -07:00
Karthik Nadig
ffc6306d8b
Updating telemetry and some comments (#1825)
* Change version field name in telemetry
* Add info on where to set justMyCode
* Address comments.
2019-10-03 20:30:05 -07:00
Pavel Minaev
89be0d1fce Reformat tests. 2019-10-03 18:31:37 -07:00