Closed mikeseese closed 6 years ago
Maybe I didn't do all of my homework yet; reading more about the debug protocol/etc.
Edit: After further research, I'm still unsure how to solve this issue. However, it appears this issue is not preventing me from testing the debug adapter; I am able to continue using the debug adapter as if the issue wasn't occurring.
I will investigate next week (after the December release is done).
Well; looks like I had a brain-lapse when going through the debug adapter guide.
I guess when I read the following:
since the implementation of debug extension lives in the debug adapter, there is no need to have extension code at all
I thought that I didn't need an extension.ts
-like file. Since I omitted this file, I wasn't sure what to put as my main
value in package.json
; so I put my sdbDebug.ts
file there. This causes it to get loaded as a module when activating the extension, which in turn runs the DebugSession.run()
function under the extension process.
This is obviously a "ya, that's not going to work" moment; the error was happening because the extension process was a subprocess and therefore process.stdin
was Writable (https://nodejs.org/api/child_process.html#child_process_subprocess_stdin would be the documentation).
TL;DR: The issue was due to me putting the debug file as the main
program for the extension instead of an extension program.
Thanks anyway!
I've been following the tutorial at https://code.visualstudio.com/docs/extensions/example-debuggers and modifying the mock debugger at https://github.com/Microsoft/vscode-mock-debug to add a new debug adapter. However, when I try to run my debugger I get an error:
I put a breakpoint in the protocol module and it seemed that inStream was of type
stream.Writable
, almost as if it was fromsubprocess.stdin
instead ofprocess.stdin
. I backtracked in the stack to theDebugSession.run(...)
where it passes in the inStream variable, I see it isprocess.stdin
in the code; evaluatingprocess.stdin
in that context also returns a Writable type.However, when I run the mock-debug example from source without changing anything, I am able to step through a
README.md
file with no issues.I'm using Node v8.9.1, NPM v5.5.1 and vscode-debugadapter v1.25.0-pre.3 (see npm list call below)
I'm fairly certain I'm doing something wrong, but I'm having difficulty finding it (and my Google-fu is not turning up anything interesting). I can post this on Stackoverflow instead if this isn't the right place (its probably not the right place, but this may be an issue with the repo vs my code).
Thanks!