TerminateExecution while debugging

32 views
Skip to first unread message

treck

unread,
Jul 16, 2016, 5:52:22 PM7/16/16
to v8-users
I have question about v8::V8::TerminateExecution function.

I set up debugger by using v8::Debug::SetMessageHandler. While javascript code is running, I need possibility to stop execution.
I have two cases:
  1. javascript is executing `while(1);` -> stopping works and Local<Script>::Run() breaks
  2. javascript paused due to breakpoint -> stopping doesn't work and Local<Script>::Run() doesn't break (TerminateExecution doesn't seem to work)

I've noticed that sending debugger command 'disconnect' (i.e. "{\"seq\":%1," "\"type\":\"request\"," "\"command\":\"disconnect\"" "}") before TerminateExecution(isolate) makes that 2nd case works OK (1st is OK too).

Is this approach enough to stop javascript execution while using v8 debugger?

Ben Noordhuis

unread,
Jul 17, 2016, 3:28:16 AM7/17/16
to v8-users
Yes, if I understand your question correctly. The disconnect command
disables breakpoints and resumes execution, allowing the termination
exception to kick in.

treck

unread,
Jul 17, 2016, 8:38:17 AM7/17/16
to v8-users
Thank you for information.
Reply all
Reply to author
Forward
0 new messages