0

I am using v8 engine inspctor to debug javascript in my own c++ project , I sent the debug command Debugger.setBreakpointOnFunctionCall to v8 engine to set a breakpoint before call a function ( function Action() ) , the command is a JSON string , the content of the command is as follows :

"{"id":11,"method":"Debugger.setBreakpointOnFunctionCall","params":{"objectId":"-6103739057120817852.1.11" }}"

The objectId in the JSON string refer to the function to be called. My problem is how can I get the objectId before use it in my own c++ project ? Can i get the objectId by v8 engine interface in my code or I must send a request JSON command to v8 engine to get the objectId?

Where can I get some samples of how to use the newest v8 engine inspctor debug command ?

  • the chatgpt4's answer is sending a Runtime.evaluate debug command to get the objectId of the function. I tried to send a JSON string: "{\"id\":11,\"method\":\"Runtime.evaluate\",\"params\":{\"expression\":\"vuser_init\"}}" but I received the result: "{\"id\":11,\"error\":{\"code\":-32000,\"message\":\"Cannot find context with specified id\"}}" what's wrong with the Runtime.evaluate command? I guess the default context goes wrong. – 汪小飞 Jul 12 '23 at 09:41

0 Answers0