Debugging embedded V8 with ChromeDevTools

87 views
Skip to first unread message

toto ttt

unread,
May 5, 2020, 5:29:09 AM5/5/20
to v8-users
Hi everybody

I am currently integrating v8-inspector with standalone embedded v8 application suing this code : https://github.com/hsharsha/v8inspector
After a while, I've succeeded to debug in ChromeDevTools the following simple scenario :
Case1: Start the websocket communication between V8 and CDT and all the necessary stuff for V8 inspector with the option PauseOnNextJavascriptStatement
           Create a V8 script
           Compile the script
           Run the script

But another simple scenario is still ko, it's when I start the communication between V8 and CDT after the script has been compiled
Case2: Create a V8 script
           Compile the script
           Start the websocket communication between V8 and ... (idem)
           Run the script
Then in CDT, the script source is not displayed nor the source commands (F8, ...)
I guess it's related to the fact that in Case2, CDT never receives the following message from V8
       {"method":"Debugger.scriptParsed","params":{"scriptId":"6" ...
then it will not ask to V8 for the script source
       {"id":6,"method":"Debugger.getScriptSource", ...

Does anyone knows if its possible to start a debug session with CDT after the script to debug have been compiled

Thank you in advance for your help.
Aligre

ibon

unread,
May 21, 2020, 2:23:35 PM5/21/20
to v8-users
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.

Elmi Ahmadov

unread,
Jun 5, 2020, 6:12:56 PM6/5/20
to v8-users
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!

Dad Uroy

unread,
Jun 8, 2020, 5:46:50 AM6/8/20
to v8-users
Hello
Thanks for you message.
For information, I havent succeeded to start the debug session after the script compilation.
Reply all
Reply to author
Forward
0 new messages