Граф коммитов

17 Коммитов

Автор SHA1 Сообщение Дата
Luciana Abud ba9e417a14
Delete blank line 2023-07-21 11:50:37 -07:00
Luciana Abud d73cf2226d Add extensions recommendations and remove settings 2023-07-21 11:47:48 -07:00
Pavel Minaev 5601342de8 Fix #1217: Support "restart" in "terminated" event for "attach"{"listen"}
Request client to restart the adapter if "restart":true was specified in the debug configuration.
2023-02-27 11:03:34 -08:00
Karthik Nadig 3e429288c8 Update launch json 2021-10-13 11:28:43 -07:00
Pavel Minaev 58c743b496 Clean up launch.json, and add more launch configurations for quick testing. 2020-04-22 13:55:01 -07:00
Pavel Minaev 69db68a5f9 Fix https://github.com/microsoft/ptvsd/issues/2108:
Debug multiprocess leads to AttributeError Can't get attribute on <module '__main__

Don't import multiprocessing before running user code.

Use bytes rather than unicode for __main__.__name__ on Python 2.7.
2020-03-18 14:22:10 -07:00
Pavel Minaev a0ca896b26 Update and clean up test configs in launch.json 2020-03-13 17:26:08 -07:00
Pavel Minaev a8ffe4a5a9 Fix #2004: Adapter process is not fully detached from parent server (#2007)
Close stdin, stdout, and stderr in the adapter.

Double-fork() and setsid() on Unix to daemonize properly.

Use CREATE_NEW_PROCESS_GROUP and CREATE_NO_WINDOW on Win32 to daemonize properly.

Propagate socket errors from adapter to server for enable_attach().
2019-12-23 12:01:44 -08:00
Pavel Minaev ffbf0e16d1 Clean up launch.json 2019-12-13 18:37:56 -08:00
Pavel Minaev 346b97bf69 Fix #1938: Debuggee output is UTF-8 regardless of locale
Fix #1954: "redirectOutput" property is not respected

If "redirectOutput" is specified, always capture output as UTF-8, and encode it according to locale and Python settings.

Change the default for "redirectOutput" to be false when "console" is not set to "internalConsole", to minimize differences in behavior when running under debugger for most common scenarios.

Refactor ptvsd.launcher package to minimize circular dependencies between modules.
2019-11-27 20:35:58 -08:00
Pavel Minaev bd50356993 Fix #1930: "launch" doesn't work with venv on Windows and Python 3.7+
For "launch", match processes on parent PID as a fallback for PID, to accommodate launcher stubs like py.exe.
2019-11-21 15:21:22 -08:00
Pavel Minaev 095e5bcd5c Fix #1713: Adapter: multiple concurrent sessions 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
Karthik Nadig 636400a24a
enable_attach should spawn adapter (#1784)
* Spawn adapter in enable attach.

* Addressing comments and simplifying

* Minor tweaks
2019-09-19 10:51:21 -07:00
Pavel Minaev 981b1d1559 Fix #1648: Messaging does not allow reverse requests
Separate message parsing and message handling into separate threads.

Remove nested message handling in request handlers via `yield`, since it is incompatible with the new split model, and replace it with NO_RESPONSE and Request.respond() to defer responses until later.

Change Message.cant_handle() and Message.isnt_valid() to respond to the request and return the exception, instead of raising it, to accommodate NO_RESPONSE scenarios where a failure needs to be reported later.

Fix #1678: Do not rely on "processId" being returned by "runInTerminal" request

Extract debuggee PID from the "process" event sent by the debug server.

Fix #1679: "exited" event sometimes reports "exitCode": null

Report it as -1 if it cannot be retrieved from the debuggee process.

Fix #1680: Fatal errors in message loop do not fail fast

os._exit() immediately if a fatal error occurs in message parsing or message handling background threads.
2019-08-11 19:46:54 -07:00
Pavel Minaev 0ea50467aa Fix #1488: Handling launch (spawn ptvsd) (#1647)
Fix #1605: Debuggee process lifetime management
Mitigate #1637: log.exception() doesn't capture the full stack

Handle "launch" request, parse and validate the debug configuration, and spawn the debuggee process with debug server.

Track debuggee process and its subprocesses, and kill them as needed.

Refactor Singleton and ThreadSafeSingleton to allow for easier synchronization between IDE and server message handlers without excessive locking.

Fix various corner cases and race conditions in disconnect scenarios.

Make log.exception() log the calling stack, not just the exception stack.

Add JSON property validation to MessageDict.

Add --log-stderr switch to the server to enable full logging to stderr.

Add --cls switch to the adapter to reset terminal before logging anything (for convenience when debugging it).

Add some printf-debugging helpers.
2019-07-31 13:05:06 -07:00
Pavel Minaev 0f76b660ed Fix and refactor debugServer mode for ptvsd.adapter. (#1567)
Add launch.json for convenient testing of ptvsd.adapter.

Various minor fixes.
2019-07-08 11:38:25 -07:00