On Tue, Nov 16, 2010 at 23:21, Peter Rybin <[email protected]> wrote:

> > >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.
> >
> > Do you happen to know what state the Virtual Machine (is this the
> > right word for it)
> I guess so.
> > is in when you call into C++ code from JavaScript
> > code?
> What exactly do you mean by "state" here?
>
> > If you call a DebugBreak from C++ (while inside a call from JS)
> > it seems like it should wait for the C++ code to finish, return
> > control to V8 and then execute the break. I am wondering if that is
> > the issue I was having here and if this actually works like that.
>
> Yes. DebugBreak schedules a break. The break actually happens when
> JavaScript is being executed. As far as I know, technically it only
> happens one entering a function (i.e. if nobody is calling a function
> break will not happen).
>
> Internally the break is "provoked" by causing a fake stack overflow
(raising the stack limit to top of memory), so the break can happen where
the is a stack check in the code. This is currently at each function entry
and on backwards branches. Stack check on backwards branches are required to
break in code like 'while (true){}'.

Regards,
Søren

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

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

Reply via email to