Hi Peter,

It will good to get rid of having to execute some JavaScript in order to
process debugger commands.

It might not be necessary to actually execute any JavaScript in order to
process the debugger requests. We can also enter the debugger when there is
a compile error (e.g syntax error) in which case there might not be any
JavaScript stack. So maybe just using EnterDebugger should work for you. In
the case where there is no entered context some of the debugger requests
might just have to return an error.

We should not add anything directly to the global object. Even if we call it
something special and try to hide it it is bound to cause trouble. If you
need additional JavaScript function please use either the builtins context
(contains per global object all the internal V8 JavaScript code) or the
debug context (global to V8 where all the debugger related functions are
run).

/Søren

On Fri, Jan 8, 2010 at 15:42, Peter Rybin <[email protected]> wrote:

> Hi Soren
>
> I think I'd like to finally implement ProcessDebuggerRequests API call;
> http://code.google.com/p/v8/issues/detail?id=554
>
> I see two use-cases:
> 1. It should make user's life easier (currently you have to compile script
> with "void(0)" text, ignore "afterCompile" event, keep reference to script
> and ignore the script from list of scripts; it's better to implement this
> one time for all).
>
> 2. I will need ProcessDebuggerRequests call in several places in
> test-debug.cc: notification handler setting should become completely
> thread-safe and it cannot call Debugger::Unload anymore; it is used as
> thread-safe right now, which is not safe; I'm going to
> use ProcessDebuggerRequests to make V8 react on setting notification handler
> to NULL.
>
> Do you have an advice how I could implement
>  Debugger::ProcessDebuggerRequests  properly? It should enter V8 for some
> trivial task and let V8 process pending debug messages. It should use
> caller's V8 context. Currently I'm thinking about lazily adding global
> function to current context and simply calling it; the function should
> return "void(0)" and I think I should try to make its script hidden.
> Does it seem good or bad?
>
> Thanks,
> Peter
>
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to