--- 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_SetTrap
JS_GetTrapOpcode
JS_ClearTrap
JS_ClearScriptTraps
JS_ClearAllTraps
JS_HandleTrap
JS_SetInterrupt
JS_ClearInterrupt
JS_PCToLineNumber
JS_LineNumberToPC
JS_GetFunctionScript
JS_GetFunctionNative
JS_GetFunctionFastNative
JS_GetScriptPrincipals
JSStackFrame
JS_FrameIterator
JS_GetFrameScript
JS_GetFramePC
JS_GetScriptedCaller
JS_StackFramePrincipals
JS_EvalFramePrincipals
JS_GetFrameAnnotation
JS_SetFrameAnnotation
JS_GetFramePrincipalArray
JS_IsNativeFrame
JS_GetFrameObject
{{ Deprecated_inline() }}JS_GetFrameScopeChain
JS_GetFrameCallObject
JS_GetFrameThis
JS_GetFrameFunction
JS_GetFrameFunctionObject
JS_IsConstructorFrame
JS_IsDebuggerFrame
JS_GetFrameReturnValue
JS_SetFrameReturnValue
JS_GetFrameCalleeObject
JSPropertyDesc
JSPD_ENUMERATE
JSPD_READONLY
JSPD_PERMANENT
JSPD_ALIAS
JSPD_ARGUMENT
JSPD_VARIABLE
JSPD_EXCEPTION
JSPD_ERROR
JSPropertyDescArray
JS_SetDebuggerHandler
JS_SetSourceHandler
JS_SetExecuteHook
JS_SetCallHook
JS_SetObjectHook
JS_SetThrowHook
JS_SetDebugErrorHook
JS_SetNewScriptHook
JS_SetDestroyScriptHook
These 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.