--- title: JSDBGAPI 参考 slug: JSDBGAPI_Reference translation_of: Mozilla/Projects/SpiderMonkey/JSDBGAPI ---
Obviously this stuff is almost entirely undocumented.
See the implementation of the trap, untrap, watch, unwatch, line2pc, and pc2line functions in {{ Source("js/src/shell/js.cpp") }}. Also the (scant) comments in {{ Source("js/src/jsdbgapi.h") }}.
JS_SetTrapJS_GetTrapOpcodeJS_ClearTrapJS_ClearScriptTrapsJS_ClearAllTrapsJS_HandleTrapJS_SetInterruptJS_ClearInterruptJS_PCToLineNumberJS_LineNumberToPCJS_GetFunctionScriptJS_GetFunctionNativeJS_GetFunctionFastNativeJS_GetScriptPrincipalsJSStackFrameJS_FrameIteratorJS_GetFrameScriptJS_GetFramePCJS_GetScriptedCallerJS_StackFramePrincipalsJS_EvalFramePrincipalsJS_GetFrameAnnotationJS_SetFrameAnnotationJS_GetFramePrincipalArrayJS_IsNativeFrameJS_GetFrameObject {{ Deprecated_inline() }}JS_GetFrameScopeChainJS_GetFrameCallObjectJS_GetFrameThisJS_GetFrameFunctionJS_GetFrameFunctionObjectJS_IsConstructorFrameJS_IsDebuggerFrameJS_GetFrameReturnValueJS_SetFrameReturnValueJS_GetFrameCalleeObjectJSPropertyDescJSPD_ENUMERATEJSPD_READONLYJSPD_PERMANENTJSPD_ALIASJSPD_ARGUMENTJSPD_VARIABLEJSPD_EXCEPTIONJSPD_ERRORJSPropertyDescArrayJS_SetDebuggerHandlerJS_SetSourceHandlerJS_SetExecuteHookJS_SetCallHookJS_SetObjectHookJS_SetThrowHookJS_SetDebugErrorHookJS_SetNewScriptHookJS_SetDestroyScriptHookThese functions can be used to profile a SpiderMonkey application using the Mac profiler, Shark. See Profiling JavaScript with Shark.
The following JSNative functions can be used to expose the above four APIs to scripts.