-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attach to local process - launch.json experience #8384
Comments
|
To validate:
import time
while True:
print("Hello")
time.sleep(1)
|
@kimadeline, at step 5 I'm getting the following error:
I was going to do the logging thing but the second bullet is unclear. Do you mean re-do step 3 but with those two environment variables set? Also, how is ptvsd related to the script from step 1? Is step 3 supposed to run ptvsd on the script rather than the script itself? |
That's what I understood when I was given these instructions, @karthiknadig 🆘
Step 1, 3 and 4 are not related to ptvsd, they are about starting a simple python process that ptvsd can attach to (in steps 5 and 6). You can replace steps 1, 3 and 4 with your own python process if you want. |
For this to work, you have to be in both
There is a gulp task (
To get the logs you have to, set the env and then start the script. and have |
Still no success. FWIW, I'm doing this over "ssh-remote" (rather than locally). However, I would not expect that to matter. |
FYI, I'm trying locally now. |
I'm getting the same "ECONNREFUSED" error locally. In case it matters, I'm on linux. My log:
|
@karthiknadig Out of curiosity, how does ptvsd inject itself into a running process? I haven't misunderstood the feature right? This is different from the old way of manually invoking ptvsd in the script, right? |
@ericsnowcurrently these are the steps it takes:
@int19h /cc |
Hmm, looks like I forgot to force the experiments when I moved over to local. Trying again... |
Still no success. :( From the console log:
|
It's using gdb to inject a stub that loads pydevd and ptvsd into the process. This means that there are some magic incantations that need to be done on Linux to allow gdb to do this: (we'll need to reflect the same in our docs) |
I'm guessing that VS Code is kind enough to generate some logs files for me...
|
... and it looks like we need to do a better job at reporting that error in a way that's visible to the user. If you run this with |
I tried running that command, but it didn't help.
|
Also, I already have |
I don't see any log file with "ptvsd" in the name. |
Looking closely at the debug config, it has |
It turns out everything is fine. :) I failed to notice that the commands @karthiknadig provided used backslashes. After changing them to forward slashes everything worked. |
No description provided.
The text was updated successfully, but these errors were encountered: