No 'initialised' event when using 'startDebugging' #1270
Replies: 1 comment 5 replies
-
I don't think that's necessarily the only interpretation of the spec - it's certainly not how I took it. My understanding is that "in the same way that the caller’s session was started" just means that the new debug configuration has to be interpreted in the same manner it would have been interpreted if it were used for the original session. Thus, the expected behavior for "attach" would be to interpret the host/port and connect directly, not to spawn a new debugpy instance (since for a top-level session you would only do that for "launch" and not for "attach"). This is also how VSCode interprets it based on my testing, so it seems to have been the intent. "debugpyWaitingForServer" is a custom event that is used to indicate that the adapter reached the state where it's waiting for a debug server hosted in the debuggee process to connect to it on the specified host/port. So far as I know, the only current use is in tests, so that the test runner can spawn the debuggee and tell it to connect to the adapter running in "listen" mode at the right time. Since it's only used internally, it's not really documented or considered stable, but if these semantics are useful, we could change that. |
Beta Was this translation helpful? Give feedback.
-
Environment data
Actual behavior
I'm trying to migrate from the custom 'debugpyAttach' event to the new 'startDebugging' request in DAP. Despite all the discussions on the DAP repo, we have ended up with a DAP requirement says:
(emphasis mine).
Previously, with the custom message, there was a 'connect' block that you had to pull out and use as the host/port to connect the 'attach' request to. Now that's forbidden. The above statement is that the client must start another instance of debugpy and just send it the 'configuration' supplied on the 'startDebugging' request. That's what I've implemented.
i.e., given the following simple program:
On execution of
p1.start()
, I receive 2 (for some reason)startDebugging
requests. They have arequest
ofattach
and aconfiguration
which itself contains thesubProcessId
andconnect
blocks. Vimspector then does per the specification and:The actual behaviour is that I receive a 'debugpyWaitingForServer' event (whatever that is), then the 'attach' reply, followed by a 'terminated' event. But no 'initialized' event. My assumption therefore is that it's not actually attaching to the subprocess.
Here's a very brief summary of the actual messages:
Parent session:
Child 1:
Child 2:
Full Message traces of the parent (top level) session and the 2 "child" sessions are here:
https://gist.github.com/puremourning/24160d0683e2c65dc81d36e8c37db1d9
Expected behavior
Clients should be able to start a new debugpy and send the request per the specification. Then a full initialisation sequence should occur.
It's entirely possible that I have a bug here, but I'd like to at least confirm that what I'm doing/saying is inline with your expectations.
Steps to reproduce:
Beta Was this translation helpful? Give feedback.
All reactions