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

Debugger support? #10

Closed
wulftone opened this issue Feb 25, 2017 · 22 comments
Closed

Debugger support? #10

wulftone opened this issue Feb 25, 2017 · 22 comments

Comments

@wulftone
Copy link

Would love to see VSCode's debugger work with HHVM. I'm willing to help but have no idea where to start.

I've tried getting xdebug debugging working in HHVM and failed, but I did have success with HHVM's built-in debugger--although it was a pain to use. Integrating that with VSCode would be a dream...

@PranayAgarwal
Copy link
Contributor

Thanks for opening the issue! I started looking into this a little while ago, and it turned out to be much more difficult than anticipated. I'll have something to share soon. 🤞

@nwehr
Copy link

nwehr commented Apr 18, 2017

+1 on adding debugger support. Great extension, btw.

@fredemmott
Copy link
Contributor

FB has mostly switched to using XDebug now (e.g. via Nuclide); I strongly recommend that any support be built on that instead of the hphpd protocol.

@wulftone
Copy link
Author

wulftone commented Jul 5, 2017

Interesting, I'd love to see a working example of XDebug on HHVM. I've never been successful getting it to go. The hphp debugger always worked great and was fast to boot.

@fredemmott
Copy link
Contributor

I'm not familiar with it, but FWIW Nuclide's implementation is here: https://github.com/facebook/nuclide/tree/122fc05acb4441d9f2a95b822c583a2804165977/pkg/nuclide-debugger-php-rpc

@fredemmott
Copy link
Contributor

We're fairly likely to add vscode debug protocol support in the near future - related to #15

@fredemmott
Copy link
Contributor

That's started: facebook/hhvm@89197d1...e54db18

@ebluestein
Copy link

Hey all, I wanted to share an update that will hopefully be useful to you: we are actually ditching XDebug support in HHVM and Nuclide and instead having HHVM speak the VS Code Debugger protocol directly. This should make it dramatically easier to integrate debugger support into this extension!

The new code is already available in nightly builds, and can be found here:
https://github.com/facebook/hhvm/tree/master/hphp/runtime/ext/vsdebug

I haven't provided a wrapper yet to make this plug into VS Code but that's on my to-do list and I'll have one available soon.

@ebluestein
Copy link

Nuclide's client-side implementation that speaks to this new debugger can be found here:
https://github.com/facebook/nuclide/tree/master/pkg/nuclide-debugger-hhvm-rpc/lib

The relevant files are hhvmDebugger.js and hhvmWrapper.js

@PranayAgarwal
Copy link
Contributor

This is great to hear! I'd be happy to update the extension with debugging support, if you can help me get it working on the HHVM side. VSCode also has a helpful sample debugger client in node.

@ebluestein
Copy link

Awesome, I haven't integrated this with VS Code yet but am planning on doing that soon (likely next week) so once I have a reference implementation I'll share it!

@PranayAgarwal
Copy link
Contributor

BTW does this support both local script execution and attaching to/breaking remote server requests?

@ebluestein
Copy link

It does from Nuclide! Currently, VS Code does not have a concept of remote projects so I am not quite sure yet how this should work for remote requests. The HHVM debugger is listening on a TCP port, which can be easily forwarded to wherever you are running VS Code via SSH tunneling, after that it would work just the same as if it were a local request.

The remaining complexity is the source code though - you'd need matching copies locally and on the remote server since the VS Code client is going to set breakpoints in local documents, and the server needs to match them to the code that's actually executing.

There are some efforts ongoing to add remote project support to VS Code, after that this would work more seamlessly

@PranayAgarwal
Copy link
Contributor

@ebluestein I was able to get the debugger working with VS Code amazingly well, but found some inconsistencies with the protocol implementation at the HHVM side. Not sure if they are known to you or not, so I'll file issues for them on the HHVM repo.

@fredemmott
Copy link
Contributor

@PranayAgarwal : I'm expecting to release 3.25 on the 14th - if this is in a tagged release of the extension and you're confident in it, I'm happy to mention this extension in the release notes.

@ebluestein
Copy link

@PranayAgarwal Thank you for those reports, it was extremely helpful! I think most of the issues are fixed in the release @fredemmott is referring to, please let me know if you encounter any more problems!

@PranayAgarwal
Copy link
Contributor

Awesome! Assuming everything is in the latest nightly build, I'll make some more changes to the extension and get a release out in the next few days.

@fredemmott
Copy link
Contributor

It's in the latest nightly linux builds; facebook/hhvm@a2142c9 isn't in any mac builds yet.

@PranayAgarwal
Copy link
Contributor

I use linux and docker builds for development, so should be good 👍

@MrCalen
Copy link

MrCalen commented Mar 21, 2018

Hi, do you have any news about the release of debugger support?

@PranayAgarwal
Copy link
Contributor

Hi @MrCalen , I'm making some final changes and validating, and will have a new version of the extension with debugger support out soon.

@PranayAgarwal
Copy link
Contributor

Pushed out a new version of the extension with a somewhat functional debugger, so closing this issue. Please file any bugs or other problems you find.

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

No branches or pull requests

6 participants