[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-09-11 Thread Elmi Ahmadov
Hi Immanuel, It's really good to hear that!! It's my pleasure. Best regards. On Friday, September 11, 2020 at 11:28:32 AM UTC+2, Immanuel Haffner wrote: > > Turns out the Wasm code not showing up is a known CDT bug. After updating > and restarting chromium I see the Wasm code in the CDT debugge

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-09-11 Thread Immanuel Haffner
Turns out the Wasm code not showing up is a known CDT bug. After updating and restarting chromium I see the Wasm code in the CDT debugger and can set breakpoints. Brilliant!!! Thanks again very much for your great help. I really appreciate it. Am Freitag, 11. September 2020 10:20:55 UTC+2 schri

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-09-10 Thread Elmi Ahmadov
Do you need to execute `Run()` on JS side or C++ side and in which side do you need the result of `Run()`? You can add a global method in JS side to fetch WASM binary from memory and you can execute on JS side as follows: // in js const wasmBinary = getWASMFromMemory(); // -> this will be a new

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-09-10 Thread Immanuel Haffner
Thanks a lot for providing the example. You are creating a `v8::Script` instance of the code that fetches and executes the WebAssembly stored in a wasm file. In my setting, I cannot do that. I have only the in-memory binary representation of the compiled Wasm. I don't see how to create a `v8::S

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-09-09 Thread Immanuel Haffner
I think I am close! The embedded V8 is connected to CDT. However, I can't see the executed Wasm code. I use Binaryen to generate Wasm code and write its binary representation into a byte array. Then I create a new `ArrayBuffer` from that byte array and pass it to the `WebAssembly.Module` constr

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-09-08 Thread Immanuel Haffner
I somehow thought that the WebSocket connections needs to be in a separate thread, so the communication with CDT can happen concurrently. After reinspecting your code I found that this is not the case. (I don't know why I had that idea.) The threading was causing my quite some headache. The ex

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-09-07 Thread Immanuel Haffner
Hi Elmi, thanks for being quiet for two weeks. I was on vacation. I will investigate your latest remarks regarding string conversion and the message loop. I will reply here. Would you be available for a call? Via Discord, Zoom, or the like... Regards Am Mittwoch, 26. August 2020 21:58:31 UTC+

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-09-07 Thread Immanuel Haffner
Hi Elmi, sorry for being quiet for two weeks. I was on vacation. I will investigate your latest remarks regarding string conversion and the message loop. I will reply here. Would you be available for a call? Via Discord, Zoom, or the like... Regards Am Mittwoch, 26. August 2020 21:58:31 UTC+2

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-08-26 Thread Elmi Ahmadov
Hi Immanuel, Do you have any progress? Did you solve "Connection is closed" issue? On Friday, August 21, 2020 at 4:55:19 PM UTC+2, Elmi Ahmadov wrote: > > There could a few things that influence cut off messages, could you please > post how do you convert V8 `StringBuffer` message to a string fo

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-08-21 Thread Elmi Ahmadov
There could a few things that influence cut off messages, could you please post how do you convert V8 `StringBuffer` message to a string format that Boost can send to CDT. you have to implement `runMessageLoopOnPause` and `schedulePauseOnNextStatement` methods to stop the execution. If you don'

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-08-21 Thread Immanuel Haffner
Hi Elmi, I am using boost web sockets now, just like you do ;) So cut off messages are not the fault of sockpp. In the "Console" tab of CDT i see an error Connection is closed, can't dispatch pending call I suspect that V8 simply finished execution, in which case I stop the WebSocket server a

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-08-21 Thread Elmi Ahmadov
Hi Immanuel, Seems the messages that come from V8 instance are cut off, maybe because of sockpp. They are also not complete, there should be a response for each request but in your case there are only 3 responses. The logic to wait the V8 instance should be done in `runMessageLoopOnPause` meth

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-08-21 Thread Immanuel Haffner
Here is what the network messages in CDT look like: [image: cdt_network.png] I guess the execution doesn't wait for CDT. My WebAssembly function is executed right away and the connection is closed. How do I make my `v8::Isolate` instance wait for commands from CDT? Am Donnerstag, 20. August 202

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-08-20 Thread Elmi Ahmadov
Seems you've managed to make a communication between CDT and your server. I also checked `sockpp` which does not support websocket protocol out of box. Probably, you should implement all required parts yourself. I'm using Google Groups old UI which allows me to add image to the post, it's next

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-08-20 Thread Immanuel Haffner
Hi Elmi, thank you for checking. My biggest mistage was to write directly to a socket rather than use the WebSocket protocol. After doing so, i now see some messages in CDT. However, there are only 8 green and one last red message. I suppose the last message wasn't sent in full. The second last

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-08-20 Thread Elmi Ahmadov
I checked your code and you're missing `runMessageLoopOnMessage`/`quitMessageLoopOnPause` and `schedulePauseOnNextStatement` (this could be redundant), but in general, these methods are necessary. in `runMessageLoopOnPause` method, you should block the thread until there is a new message from C

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-08-20 Thread Immanuel Haffner
Ok, I figured the cause for the segmentation violation. I must dispose of the inspector and the session and channel before disposing of the isolate. I am still left with "WebSocket disconnected". The CDT Network monitor says "Connection closed before receiving a handshake response". Maybe I di

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-08-20 Thread Immanuel Haffner
Hi again, I figured that the `chome-devtools://` part doesn't work in Chromium. Using `devtools://` instead works. However, I get a segmentation violation. Here is the code I wrote to connect the V8 inspector: struct ServerChannel : v8_inspector::V8Inspector::Channel { privat

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-08-19 Thread Immanuel Haffner
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::V

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-08-19 Thread Elmi Ahmadov
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 app

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-06-08 Thread Dad Uroy
Hello Thanks for you message. For information, I havent succeeded to start the debug session after the script compilation. Le samedi 6 juin 2020 00:12:56 UTC+2, Elmi Ahmadov a écrit : > > As far as I remember. there is no a straight forward way to start a debug > session after the script is co

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-06-05 Thread Elmi Ahmadov
As far as I remember. there is no a straight forward way to start a debug session after the script is compiled. See my simple v8 inspector example: https://github.com/ahmadov/v8_inspector_example btw, if you find a way to achieve that, please share it, that'd be very useful! On Tuesday, May

[v8-users] Re: Debugging embedded V8 with ChromeDevTools

2020-05-21 Thread ibon
I definitely can start a debug session at any given time. Simple question is whether you have set a valid ScriptOrigin when compiling the string. I remember having trouble by not setting properly a valid protocol name for the parsed script. El martes, 5 de mayo de 2020, 11:29:09 (UTC+2), toto tt