void jsd_DebuggerUnpause(JSDContext* jsdc) { JS_SetDebuggerHandler(jsdc->jsrt, jsd_DebuggerHandler, jsdc); JS_SetExecuteHook(jsdc->jsrt, jsd_TopLevelCallHook, jsdc); JS_SetCallHook(jsdc->jsrt, jsd_FunctionCallHook, jsdc); JS_SetThrowHook(jsdc->jsrt, jsd_ThrowHandler, jsdc); JS_SetDebugErrorHook(jsdc->jsrt, jsd_DebugErrorHook, jsdc); }
void jsd_DebuggerPause(JSDContext* jsdc, JSBool forceAllHooksOff) { JS_SetDebuggerHandler(jsdc->jsrt, NULL, NULL); if (forceAllHooksOff || !(jsdc->flags & JSD_COLLECT_PROFILE_DATA)) { JS_SetExecuteHook(jsdc->jsrt, NULL, NULL); JS_SetCallHook(jsdc->jsrt, NULL, NULL); } JS_SetThrowHook(jsdc->jsrt, NULL, NULL); JS_SetDebugErrorHook(jsdc->jsrt, NULL, NULL); }
/* * call-seq: * debugger=(debugger) * * Sets a debugger object */ static VALUE set_debugger(VALUE self, VALUE debugger) { JohnsonRuntime* runtime; JSDebugHooks* debug_hooks; rb_iv_set(self, "@debugger", debugger); Data_Get_Struct(self, JohnsonRuntime, runtime); Data_Get_Struct(debugger, JSDebugHooks, debug_hooks); JSContext * context = johnson_get_current_context(runtime); JS_SetInterrupt( runtime->js, debug_hooks->interruptHandler, debug_hooks->interruptHandlerData); JS_SetNewScriptHook( runtime->js, debug_hooks->newScriptHook, debug_hooks->newScriptHookData); JS_SetDestroyScriptHook( runtime->js, debug_hooks->destroyScriptHook, debug_hooks->destroyScriptHookData); JS_SetDebuggerHandler( runtime->js, debug_hooks->debuggerHandler, debug_hooks->debuggerHandlerData); JS_SetSourceHandler( runtime->js, debug_hooks->sourceHandler, debug_hooks->sourceHandlerData); JS_SetExecuteHook( runtime->js, debug_hooks->executeHook, debug_hooks->executeHookData); JS_SetCallHook( runtime->js, debug_hooks->callHook, debug_hooks->callHookData); JS_SetObjectHook( runtime->js, debug_hooks->objectHook, debug_hooks->objectHookData); JS_SetThrowHook( runtime->js, debug_hooks->throwHook, debug_hooks->throwHookData); JS_SetDebugErrorHook( runtime->js, debug_hooks->debugErrorHook, debug_hooks->debugErrorHookData); JS_SetContextDebugHooks(context, debug_hooks); return debugger; }