question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Debug Adapter in Python

See original GitHub issue

~This issue is used to track discussions related to using PTVSD as the debug adapter:~

  • ~File issue on VSC for reverse request (custom request from DA to VSC). One example of existing item is runInTerminalReqeust~
  • ~File issue on VSC for logging of DA messages (every adapter needs to write custom code to enable this)~
  • ~When debugging multiple procs (parent & multiple children), then VSC will display a single debug session.~
    • ~Will clicking Stop terminate all debug sessions?~
    • ~Will the parent session be the only one that gets the terminate session~

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
int19hcommented, Aug 2, 2019

My suggestion is to allow "logToFile" to be either a boolean (with the same semantics as before) or a string, so that users can place the logs wherever they want, rather than the default location.

Also, perhaps it could use a better name? As it is, it’s a bit confusing, because it’s unclear what is getting logged to the file, especially since some other VSCode debuggers have facilities to redirect the standard logging facilities in the language itself (i.e. for user app logs, not debugger logs), and we might want to do something like that in the future as well for the Python logging standard module. So maybe something like "debuggerLog"?

OTOH if we want to match what the other debuggers do, the Node.js and Go ones call this setting "trace" - although that is even more vague. C++ debugger seems to not have it in launch.json at all, and instead uses an extension setting - I suspect it’s less discoverable, but on the other hand, it will come up when searching global settings, so it’s hard to say.

(Renaming or moving it shouldn’t be a backwards compatibility issue, since it’s strictly a diagnostic tool - nobody should have that floating around in their debug configs, it’s only meant to be enabled to report a bug. )

0reactions
karthiknadigcommented, Apr 3, 2020
  • Create a single Package containing binaries for following: This can be done by downloading wheels for each of the platforms and merging the ptvsd directory across all the wheels. This prevents us for shipping multiple copies of the debugger to support wheels. See https://github.com/karthiknadig/vscode-python/commit/9d8f46374923128d3f96921818c3f93a9ef6871f for reference

    • Manylinux1 32/64
    • Darwin 10_13 64
    • Windows 32/64
  • DebugAdapterDescriptor creates these two when in wheels experiment

    • For Attach: DebugAdapterServer(config.port, config.host). Note python interpreter is not needed for attach.
    • For Launch: DebugAdapterExecutable(extensionRoot\PythonFiles\lib\python\ptvsd\adapter). Remember if logToFile is set then append --log-dir <dir>. Note python interpreter is needed for launch
  • Logging should also be done via DebugAdapterTracker

    • If logToFile then enable logging using debugAdapterTracker. Note that we need logs in both attach and launch case. In attach case with the new adapter, there is nothing running on the local machine. To get local logs we need to use tracker. I had suggested this a long time ago as a preparatory. But now we will need it. The tracker exists for this purpose so we should make use of it.
  • Telemetry for wheels.

    • Wheels telemetry should be generated in-proc in the debugger. Currently the telemetry assumes that wheels are being used just because we point python to the directory that has wheels. Since python decides when to load the binary version, and it can also decide to not load it. So the only way to get correct telemetry is inproc. There are also some cases where we disable binary loading even if ti is available. Telemetry will be accurate inproc.
Read more comments on GitHub >

github_iconTop Results From Across the Web

microsoft/debugpy - a debugger for Python - GitHub
An implementation of the Debug Adapter Protocol for Python - GitHub - microsoft/debugpy: An implementation of the Debug Adapter Protocol for Python.
Read more >
Python Script Debugger based on Debug Adapter Protocol
The Debug Adapter Protocol makes it possible to implement a generic debugger for a development tool that can communicate with different ...
Read more >
Debugging configurations for Python apps in Visual Studio Code
This article mainly addresses Python-specific debugging configurations, ... Specifies the host address and port for the debug adapter server to wait for ...
Read more >
Official page for Debug Adapter Protocol
Debug Adapter Protocol. The Debug Adapter Protocol (DAP) defines the abstract protocol used between a development tool (e.g. IDE or editor) and a...
Read more >
debugpy - PyPI
debugpy is an implementation of the Debug Adapter Protocol for Python. The source code and the issue tracker is hosted on GitHub.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found