Dear Elmi,

thank you for your reply. I had a long look at your example. To be honest, 
I find it a bit bloatet.

Let me phrase in my own words what I have learned from your code:

1) I need a socket to receive messages from CDT and send responses back to 
CDT.
2) I must implement `v8_inspector::V8Inspector::Channel` to have 
`sendResponse()` and `sendNotification()` send the respective message over 
the socket to CDT.
3) I need an instance of `v8_inspector::V8InspectorClient`. I am not sure 
whether I must overwrite anything from this class in a subclass. I think 
the base class is actually fine...
4) I must use `v8_inspector::V8Inspector::create()` to create an instance 
of `v8_inspector::V8Inspector`. I believe this is where all the inspector 
logic is implemented...
5) Using the `V8Inspector` instance I create a 
`v8_inspector::V8InspectorSession` by calling `connect()`. Here I must pass 
a reference to an instance of my `v8_inspector::V8Inspector::Channel` 
subclass.
This was the basic setup. Now it's time to run the server loop.
6) In a detached thread, read from the socket and pass the message on by 
invoking `dispatchProtocolMessage()` on my instance 
of `v8_inspector::V8InspectorSession`.

When running my code, the TCP acceptor is set up and waiting for a client. 
I visit `localhost:<PORT>` with Chromium (the chrome-devtool:// links just 
won't work). Then my application executes the WebAssembly and the browser 
says the page isn't working (ERR_EMPTY_RESPONSE).

What am I missing?
Elmi Ahmadov schrieb am Mittwoch, 19. August 2020 um 10:21:38 UTC+2:

> Hi.
>
> I have an example project how to use V8 inspector API: 
> https://github.com/ahmadov/v8_inspector_example. Hope this would help.
>
> Best regards
>
> On Wednesday, August 19, 2020 at 10:11:00 AM UTC+2, Immanuel Haffner wrote:
>>
>> Hi all,
>>
>> I followed this V8 documentation [1] to embed V8 into my application. The 
>> application compiles inputs to WebAssembly modules and executes them in 
>> embedded V8.  Now I would like to debug these WebAssembly modules.  
>> Searching online brought me to ChromeDevTools and the v8-inspector API.  I 
>> mostly followed this guide [2] to set up a `V8InspectorSession` and 
>> implemented the `V8Inspector::Channel` interface by creating a TCP server, 
>> waiting for a connection, and then in `sendResponse()` and 
>> `sendNotification()` I simply send the message over the TCP socket.
>>
>> To debug, I launch chromium and connect to localhost on the port where 
>> the TCP server was created. Sadly, this doesn't work. The `sendResponse()` 
>> and `sendNotification()` methods are never invoked.
>>
>> Can someone please point me to a tutorial or give me some guidance?
>>
>> Thanks,
>> Immanuel
>>
>> [1] https://v8.dev/docs/embed
>> [2] 
>> https://hyperandroid.com/2020/02/12/v8-inspector-from-an-embedder-standpoint/
>>
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-users/999cc45c-a80f-4e1e-954e-4be33e887ebcn%40googlegroups.com.

Reply via email to