Skip to content
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

Port pdb debugger to this repository #16

Closed
wants to merge 4 commits into from

Conversation

rchiodo
Copy link
Collaborator

@rchiodo rchiodo commented Oct 21, 2022

Moved the code I had in microsoft/vscode-wasm#27 to this repository instead.

@dbaeumer I didn't wire up the web version of the debugger, and the desktop version is not using a WASI, but figured that would happen later once you get the new file descriptor setup.

"languages": [
"python"
],
"type": "python-pdb-node",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a debug config so I could just test with a launch.json instead of a command.

readonly context: vscode.ExtensionContext,
private readonly _ral: RAL
) {
this._spawner = _ral.spawner.create();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debugger is using a 'Spawner' and 'Spawnee' abstraction. It needs only a few things from child_process.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the WASI version is working, I hope this should be easy to implement there.

* @param args: arguments to pass to the python
* @returns an object that can be listened to for stdout/stderr/stdin
*/
spawn(args: string[], cwd: string | undefined): Promise<Spawnee>;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think? you can pass args to a worker? If not a message could be created to pass the args to pdb inside the worker.

@dbaeumer
Copy link
Member

I think? you can pass args to a worker? If not a message could be created to pass the args to pdb inside the worker.

Yes, in node but not in the browser. In the browser you need to decode them as a param string. See https://github.com/microsoft/vscode-wasm/blob/74b49f8c2df9ecb807a934ba0de86f6fb1db5b92/sync-api-common/src/browser/ril.ts#L74 and https://github.com/microsoft/vscode-wasm/blob/74b49f8c2df9ecb807a934ba0de86f6fb1db5b92/sync-api-common/src/node/ril.ts#L74

@dbaeumer
Copy link
Member

The code looks fine to me. I would only like to ask for one thing: if methods are private we should prefix them with the private keyword in TS and not only rely on the underscore. We don't have a clear rule in VS Code but most of the devs (including me) don't prefix private members with _ but only rely on the visiblity modifiers provided by TS.

I propose that I add you as a committer to the repository so that you can merge the PR when approved.

@rchiodo
Copy link
Collaborator Author

rchiodo commented Oct 26, 2022

The code looks fine to me. I would only like to ask for one thing: if methods are private we should prefix them with the private keyword in TS and not only rely on the underscore. We don't have a clear rule in VS Code but most of the devs (including me) don't prefix private members with _ but only rely on the visiblity modifiers provided by TS.

I propose that I add you as a committer to the repository so that you can merge the PR when approved.

Sure sounds good.

@dbaeumer
Copy link
Member

Code got merge from another PR. Closing

@dbaeumer dbaeumer closed this Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants