Hi this post may wander a bit but basically I am looking for any help with debugging in V8.
The main issue I am having is this: Lets say I called back into C++ code from JavaScript and I want to inspect the current scope using the debugger. I send a scope request using sendCommand(). It returns me a bunch of information that includes handles to other data. I try to request the handles using lookup but this always returns empty. How do handles persist in the debugger? Do I need to be in a break to have the debugger keep the state of the handles? I assumed this was the case and started looking at the functions shown below. I was wondering if someone has any more information or documentation on the V8 debugger and how to use it from application code. Say I call back into C++ code from JavaScript. Is it possible to stop execution of the V8 VM and perform some debugging from the C++ code? Also if anyone could provide more details on these functions that would be great: // Schedule a debugger break to happen when JavaScript code is run. static void DebugBreak(); // Remove scheduled debugger break if it has not happened yet. static void CancelDebugBreak(); // Break execution of JavaScript (this method can be invoked from a // non-VM thread) for further client command execution on a VM // thread. Client data is then passed in EventDetails to // EventCallback at the moment when the VM actually stops. static void DebugBreakForCommand(ClientData* data = NULL); Lastly, I have tried to use listen and connect to the remote v8 debugger. This was a last ditch effort after I couldn't get debugging to work from inside my application code. This seems the wrong way to go. I do get a response from the debugger when I connect using telnet, but how should I send it commands? When I tried to send the remote debugger commands they commands I sent were just printed to the stdout of the program... I am wondering how or why invalid remote debugging commands are dumped to stdout??? I read somewhere the remote debugger uses a "sort of" HTTP protocol around the JSON API. Is this documented anywhere? Is there a remote debugger client other than the d8 shell that one could use as a library??? Thanks in advance and sorry for the long post with lots of questions. -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
