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

Integrate Chrome debugger #230

Closed
AObuchow opened this issue Aug 27, 2019 · 9 comments
Closed

Integrate Chrome debugger #230

AObuchow opened this issue Aug 27, 2019 · 9 comments

Comments

@AObuchow
Copy link
Contributor

I'm going to start working on integrating the chrome debugger as the vscode extension for it has a debuger adapter which is very similar to the node debugger's adapter.

@mickaelistria
Copy link
Contributor

@AObuchow, I'm answering here the questions/comments you made on internal Slack

So far I haven't had too much success with the chrome debugger unfortunately
Maybe I'm just missing something but looking at https://github.com/microsoft/vscode-chrome-debug/blob/master/src/chromeDebugAdapter.ts
I realized there isn't any outer-most function call (function which gets called when the file is loaded)
there's only function declarations
so running node chromeDebugAdapter.js won't work
I was however, able to get the extension to work within vscode

One possibility is that when you get it working with vscode, you run some ps aux | grep node command to see what's the command invoked by VSCode. It may indeed be a different entry point to use.

@mickaelistria
Copy link
Contributor

It seems like we should instead use https://github.com/microsoft/vscode-chrome-debug/blob/master/src/chromeDebugAdapter.ts (so include the vscode-chrome-debug module)

@AObuchow
Copy link
Contributor Author

One possibility is that when you get it working with vscode, you run some ps aux | grep node command to see what's the command invoked by VSCode. It may indeed be a different entry point to use.

I didn't have much luck grepping for node but using the extension with VSCode and running ps aux | grep chrome gave me:
/usr/share/code/code -e delete process.env.ELECTRON_RUN_AS_NODE;require(process.argv[1]) /home/aobuchow/.vscode/extensions/msjsdiag.debugger-for-chrome-4.11.7/out/src/chromeDebug.js

It seems that the entry point might be chromeDebug.js rather than the adapter class. When running it with node, the process stays running/doesn't exit immediately. I'm going to experiement further with it.

@AObuchow
Copy link
Contributor Author

Update: I just got Chrome to launch from Eclipse using chromeDebug.js :)
Hopefully things will go a bit more smoothly now.

@mickaelistria
Copy link
Contributor

Great @AObuchow .
To embed it, you can mimic what was done in b1f39b6#diff-f5f4550a2038c2e52d1c95b8af5eb02e (pom.xml)

@mickaelistria
Copy link
Contributor

Main patch in this story is merged. However I see that the Chrome Debug shortcut on right click starts a node.js debugger.
I think this is addressed in #251

@AObuchow
Copy link
Contributor Author

Main patch in this story is merged. However I see that the Chrome Debug shortcut on right click starts a node.js debugger.
I think this is addressed in #251

Yes you're right. I just did a local rebase of my refactoring branch and the issue seems to be fixed there. Going to submit a PR now.

mickaelistria added a commit that referenced this issue Sep 19, 2019
Signed-off-by: Mickael Istria <mistria@redhat.com>
@mickaelistria
Copy link
Contributor

Refactoring was merged and includes all the fix. The Chrome Debugger seems usable enough now. Thanks @AObuchow !

@AObuchow
Copy link
Contributor Author

My pleasure :)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants