Hi Matt

> 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 don't think that V8 supports dealing with debug state from a regular
C++ call. Some operations only make sense within a debug break state;
e.g. this state owns/manages a map of handles. You cannot expect this
map to be created on every call to C++.
So to your last question I think the answer is "Yes, you do".

There are following ways of getting into a break: setting a
breakpoint, adding "debugger" statement to your script, scheduling an
ASAP break with DebugBreak call. The main thing here is to make sure
that you get called on V8 breaking. You should experiment with various
event callbacks and message handlers from v8-debug.h.

> code?   Also if anyone could provide more details on these functions
> that would be great:

Please, make your questions more specific.

> 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

It wasn't supposed to be a human-usable protocol.

> 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.

This is true. I guess the only HTTP field it actually employs is
Content-Length.

> Is this documented anywhere?  Is there a remote debugger client other
> than the d8 shell that one could use as a library???

You definitely can give a try to a Java-based remote client. See
http://code.google.com/p/chromedevtools
You can use an SDK library that provides an object-oriented API or you
can try Eclipse debugger that comes with SDK.

Peter

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to