mozilla

Revision 139953 of JSDBGAPI Reference

  • Revision slug: JSDBGAPI_Reference
  • Revision title: JSDBGAPI Reference
  • Revision id: 139953
  • Created:
  • Creator: Jorend
  • Is current revision? No
  • Comment categorize

Revision Content


Obviously this stuff is almost entirely undocumented.

See the implementation of the <tt>trap, untrap, watch, unwatch, line2pc</tt>, and <tt>pc2line</tt> functions in {{ Source("js/src/js.cpp") }}. Also the (scant) comments in {{ Source("js/src/jsdbgapi.h") }}.

Breakpoints

Watchpoints

Inspecting the stack

Evaluating debug code

Examining object properties

Hooks

Memory usage

System objects

Profiling

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.

{{ languages( { "ja": "ja/JSDBGAPI_Reference" } ) }}

Revision Source

<p>
</p><p><br>
Obviously this stuff is almost entirely undocumented.
</p><p>See the implementation of the <tt>trap, untrap, watch, unwatch, line2pc</tt>, and <tt>pc2line</tt> functions in {{ Source("js/src/js.cpp") }}. Also the (scant) comments in {{ Source("js/src/jsdbgapi.h") }}.
</p>
<h3 name="Breakpoints"> Breakpoints </h3>
<ul><li> <code><a href="en/JS_SetTrap">JS_SetTrap</a></code>
</li><li> <code><a href="en/JS_GetTrapOpcode">JS_GetTrapOpcode</a></code>
</li><li> <code><a href="en/JS_ClearTrap">JS_ClearTrap</a></code>
</li><li> <code><a href="en/JS_ClearScriptTraps">JS_ClearScriptTraps</a></code>
</li><li> <code><a href="en/JS_ClearAllTraps">JS_ClearAllTraps</a></code>
</li><li> <code><a href="en/JS_HandleTrap">JS_HandleTrap</a></code>
</li><li> <code><a href="en/JS_SetInterrupt">JS_SetInterrupt</a></code>
</li><li> <code><a href="en/JS_ClearInterrupt">JS_ClearInterrupt</a></code>
</li></ul>
<h3 name="Watchpoints"> Watchpoints </h3>
<ul><li> <code><a href="en/JS_SetWatchPoint">JS_SetWatchPoint</a></code>
</li><li> <code><a href="en/JS_ClearWatchPoint">JS_ClearWatchPoint</a></code>
</li><li> <code><a href="en/JS_ClearWatchPointsForObject">JS_ClearWatchPointsForObject</a></code>
</li><li> <code><a href="en/JS_ClearAllWatchPoints">JS_ClearAllWatchPoints</a></code>
</li></ul>
<h3 name="Inspecting_the_stack"> Inspecting the stack </h3>
<ul><li> <code><a href="en/JS_PCToLineNumber">JS_PCToLineNumber</a></code>
</li><li> <code><a href="en/JS_LineNumberToPC">JS_LineNumberToPC</a></code>
</li><li> <code><a href="en/JS_GetFunctionScript">JS_GetFunctionScript</a></code>
</li><li> <code><a href="en/JS_GetFunctionNative">JS_GetFunctionNative</a></code>
</li><li> <code><a href="en/JS_GetFunctionFastNative">JS_GetFunctionFastNative</a></code>
</li><li> <code><a href="en/JS_GetScriptPrincipals">JS_GetScriptPrincipals</a></code>
</li></ul>
<ul><li> typedef <code><a href="en/JSStackFrame">JSStackFrame</a></code>
</li><li> <code><a href="en/JS_FrameIterator">JS_FrameIterator</a></code>
</li><li> <code><a href="en/JS_GetFrameScript">JS_GetFrameScript</a></code>
</li><li> <code><a href="en/JS_GetFramePC">JS_GetFramePC</a></code>
</li><li> <code><a href="en/JS_GetScriptedCaller">JS_GetScriptedCaller</a></code>
</li><li> <code><a href="en/JS_StackFramePrincipals">JS_StackFramePrincipals</a></code>
</li><li> <code><a href="en/JS_EvalFramePrincipals">JS_EvalFramePrincipals</a></code>
</li><li> <code><a href="en/JS_GetFrameAnnotation">JS_GetFrameAnnotation</a></code>
</li><li> <code><a href="en/JS_SetFrameAnnotation">JS_SetFrameAnnotation</a></code>
</li><li> <code><a href="en/JS_GetFramePrincipalArray">JS_GetFramePrincipalArray</a></code>
</li><li> <code><a href="en/JS_IsNativeFrame">JS_IsNativeFrame</a></code>
</li><li> <code><a href="en/JS_GetFrameObject">JS_GetFrameObject</a></code> {{ Deprecated_inline() }}
</li><li> <code><a href="en/JS_GetFrameScopeChain">JS_GetFrameScopeChain</a></code>
</li><li> <code><a href="en/JS_GetFrameCallObject">JS_GetFrameCallObject</a></code>
</li><li> <code><a href="en/JS_GetFrameThis">JS_GetFrameThis</a></code>
</li><li> <code><a href="en/JS_GetFrameFunction">JS_GetFrameFunction</a></code>
</li><li> <code><a href="en/JS_GetFrameFunctionObject">JS_GetFrameFunctionObject</a></code>
</li><li> <code><a href="en/JS_IsConstructorFrame">JS_IsConstructorFrame</a></code>
</li><li> <code><a href="en/JS_IsDebuggerFrame">JS_IsDebuggerFrame</a></code>
</li><li> <code><a href="en/JS_GetFrameReturnValue">JS_GetFrameReturnValue</a></code>
</li><li> <code><a href="en/JS_SetFrameReturnValue">JS_SetFrameReturnValue</a></code>
</li><li> <code><a href="en/JS_GetFrameCalleeObject">JS_GetFrameCalleeObject</a></code>
</li></ul>
<ul><li> <code><a href="en/JS_GetScriptFilename">JS_GetScriptFilename</a></code>
</li><li> <code><a href="en/JS_GetScriptBaseLineNumber">JS_GetScriptBaseLineNumber</a></code>
</li><li> <code><a href="en/JS_GetScriptLineExtent">JS_GetScriptLineExtent</a></code>
</li><li> <code><a href="en/JS_GetScriptVersion">JS_GetScriptVersion</a></code>
</li></ul>
<ul><li> <code><a href="en/JS_GetTopScriptFilenameFlags">JS_GetTopScriptFilenameFlags</a></code>
</li><li> <code><a href="en/JS_GetScriptFilenameFlags">JS_GetScriptFilenameFlags</a></code>
</li><li> <code><a href="en/JS_FlagScriptFilenamePrefix">JS_FlagScriptFilenamePrefix</a></code>
</li></ul>
<ul><li> <code><a href="en/JSFILENAME_NULL">JSFILENAME_NULL</a></code>
</li><li> <code><a href="en/JSFILENAME_SYSTEM">JSFILENAME_SYSTEM</a></code>
</li><li> <code><a href="en/JSFILENAME_PROTECTED">JSFILENAME_PROTECTED</a></code>
</li></ul>
<h3 name="Evaluating_debug_code"> Evaluating debug code </h3>
<ul><li> <code><a href="en/JS_EvaluateInStackFrame">JS_EvaluateInStackFrame</a></code>
</li></ul>
<h3 name="Examining_object_properties"> Examining object properties </h3>
<ul><li> typedef <code><a href="en/JSPropertyDesc">JSPropertyDesc</a></code>
</li></ul>
<ul><li> <code><a href="en/JSPD_ENUMERATE">JSPD_ENUMERATE</a></code>
</li><li> <code><a href="en/JSPD_READONLY">JSPD_READONLY</a></code>
</li><li> <code><a href="en/JSPD_PERMANENT">JSPD_PERMANENT</a></code>
</li><li> <code><a href="en/JSPD_ALIAS">JSPD_ALIAS</a></code>
</li><li> <code><a href="en/JSPD_ARGUMENT">JSPD_ARGUMENT</a></code>
</li><li> <code><a href="en/JSPD_VARIABLE">JSPD_VARIABLE</a></code>
</li><li> <code><a href="en/JSPD_EXCEPTION">JSPD_EXCEPTION</a></code>
</li><li> <code><a href="en/JSPD_ERROR">JSPD_ERROR</a></code>
</li></ul>
<ul><li> typedef <code><a href="en/JSPropertyDescArray">JSPropertyDescArray</a></code>
</li></ul>
<ul><li> <code><a href="en/JS_PropertyIterator">JS_PropertyIterator</a></code>
</li><li> <code><a href="en/JS_GetPropertyDesc">JS_GetPropertyDesc</a></code>
</li><li> <code><a href="en/JS_GetPropertyDescArray">JS_GetPropertyDescArray</a></code>
</li><li> <code><a href="en/JS_PutPropertyDescArray">JS_PutPropertyDescArray</a></code>
</li></ul>
<h3 name="Hooks"> Hooks </h3>
<ul><li> <code><a href="en/JS_SetDebuggerHandler">JS_SetDebuggerHandler</a></code>
</li><li> <code><a href="en/JS_SetSourceHandler">JS_SetSourceHandler</a></code>
</li><li> <code><a href="en/JS_SetExecuteHook">JS_SetExecuteHook</a></code>
</li><li> <code><a href="en/JS_SetCallHook">JS_SetCallHook</a></code>
</li><li> <code><a href="en/JS_SetObjectHook">JS_SetObjectHook</a></code>
</li><li> <code><a href="en/JS_SetThrowHook">JS_SetThrowHook</a></code>
</li><li> <code><a href="en/JS_SetDebugErrorHook">JS_SetDebugErrorHook</a></code>
</li><li> <code><a href="en/JS_SetNewScriptHook">JS_SetNewScriptHook</a></code>
</li><li> <code><a href="en/JS_SetDestroyScriptHook">JS_SetDestroyScriptHook</a></code>
</li></ul>
<ul><li> <code><a href="en/JS_GetGlobalDebugHooks">JS_GetGlobalDebugHooks</a></code>
</li><li> <code><a href="en/JS_SetContextDebugHooks">JS_SetContextDebugHooks</a></code>
</li></ul>
<h3 name="Memory_usage"> Memory usage </h3>
<ul><li> <code><a href="en/JS_GetObjectTotalSize">JS_GetObjectTotalSize</a></code>
</li><li> <code><a href="en/JS_GetFunctionTotalSize">JS_GetFunctionTotalSize</a></code>
</li><li> <code><a href="en/JS_GetScriptTotalSize">JS_GetScriptTotalSize</a></code>
</li></ul>
<h3 name="System_objects"> System objects </h3>
<ul><li> <code><a href="en/JS_IsSystemObject">JS_IsSystemObject</a></code>
</li><li> <code><a href="en/JS_NewSystemObject">JS_NewSystemObject</a></code>
</li></ul>
<h3 name="Profiling"> Profiling </h3>
<p>These functions can be used to profile a SpiderMonkey application using the Mac profiler, Shark. See <a href="en/Profiling_JavaScript_with_Shark">Profiling JavaScript with Shark</a>.
</p>
<ul><li> <code><a href="en/JS_ConnectShark">JS_ConnectShark</a></code>
</li><li> <code><a href="en/JS_DisconnectShark">JS_DisconnectShark</a></code>
</li><li> <code><a href="en/JS_StartChudRemote">JS_StartChudRemote</a></code>
</li><li> <code><a href="en/JS_StopChudRemote">JS_StopChudRemote</a></code>
</li></ul>
<p>The following <code><a href="en/JSNative">JSNative</a></code> functions can be used to expose the above four APIs to scripts.
</p>
<ul><li> <code><a href="en/Js_ConnectShark">js_ConnectShark</a></code>
</li><li> <code><a href="en/Js_DisconnectShark">js_DisconnectShark</a></code>
</li><li> <code><a href="en/Js_StartShark">js_StartShark</a></code>
</li><li> <code><a href="en/Js_StopShark">js_StopShark</a></code>
</li></ul>
{{ languages( { "ja": "ja/JSDBGAPI_Reference" } ) }}
Revert to this revision