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

How to open a debug session/connection with Hermes API ? #486

Closed
JoshMarler opened this issue Apr 3, 2021 · 2 comments
Closed

How to open a debug session/connection with Hermes API ? #486

JoshMarler opened this issue Apr 3, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@JoshMarler
Copy link

JoshMarler commented Apr 3, 2021

Problem

We've recently integrated the hermes library over at react-juce: https://github.com/nick-thompson/react-juce/blob/master/react_juce/core/EcmascriptEngine_Hermes.cpp

react-juce provides an abstract EcmascriptEngine type with a few different impls for Duktape and Hermes etc.

We provide a EcmascriptEngine::debuggerAttach call for users which launches a debug session and awaits attach from some debug client, i.e. vscode, chrome debugger etc.

Duktape provides a fairly simple route in for this which opens up a tcp connection ready for any client implementing the Duktape debug protocool:

https://github.com/nick-thompson/react-juce/blob/master/react_juce/core/EcmascriptEngine_Duktape.cpp#L373

Would anyone be able to point me in the right direction for implementing such functionality with the hermes api/Debugger?

I'm currently searching through sources trying to find some insight into how I might use the Hermes Debugger object to open up a debug session on some port for the chrome debugger similar to the experience provided by React Native. The solution isn't jumping out at me!

Is this essentially a case of needing to implement the debug APIs in a similar fashion to the hdb tool so that our EcmascriptEngine class may act as a debug host/proxy ?

Thanks

@JoshMarler JoshMarler added the enhancement New feature or request label Apr 3, 2021
@neildhar
Copy link
Contributor

neildhar commented Apr 8, 2021

Hi @JoshMarler, for your reference, RN's Hermes chrome debugger integration is implemented here. As you suggest, you'll need to parse the requests coming in over the network and plumb them through to the lower level DebuggerAPI we expose, like the hdb tool.

@JoshMarler
Copy link
Author

Excellent, thanks for the info @neildhar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants