Hi Ryan The loop in Debugger::NotifyMessageHandler() will not be activated until there is an actual debugger event happening. E.g. when a break point is hit Debugger::NotifyMessageHandler() will run to process the debug messages while at the break point until a continue message is received and V8 execution continues. In this loop it is possible to have callbacks to the embedding application at specific intervals as having the debugger event block the V8 thread might disrupt the embedding application. In Chrome this mechanism is used to keep parts of the message pump running while the renderer thread is otherwise blocked sitting a V8 break. This callback can be activated using SetHostDispatchHandler() in the V8 debugger API.
However it looks as if you are looking for the opposite that is a callback when a debug message is received and the embedding application needs to enter V8 to process these messages. You could try to have your select() call time out every 100ms or so and call an empty JavaScript function to simulate such a callback. If we where to put in such a callback it would be called from the debugger agent thread and the embedding application would then have to marshal that into a call into V8 from it's V8 thread. You will also have to enable the flag --debugger-auto-break for V8 to generate an automatic break for processing debug messages. Regards, Søren On Wed, Oct 7, 2009 at 11:17, Ryan Dahl <[email protected]> wrote: > > Hi Søren, > > If you receive a message in the DebuggerAgent and your main thread is > not immediately executing javascript but idling in select(), how can > you give control back to V8 to handle the message? It seems there > should be some way to poll the agent to handle received messages. > > Am I correct in my reading that the while(true) loop body in > Debugger::NotifyMessageHandler() would be such a poll function if the > Wait()s were removed? > > ry > > > > --~--~---------~--~----~------------~-------~--~----~ v8-users mailing list [email protected] http://groups.google.com/group/v8-users -~----------~----~----~----~------~----~------~--~---
