/js/src/jsdbgapi.h

http://github.com/zpao/v8monkey · C Header · 593 lines · 280 code · 136 blank · 177 comment · 4 complexity · 54dedb7b2e174e577bf4d74a4ee05440 MD5 · raw file

  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2. * vim: set ts=8 sw=4 et tw=99:
  3. *
  4. * ***** BEGIN LICENSE BLOCK *****
  5. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  6. *
  7. * The contents of this file are subject to the Mozilla Public License Version
  8. * 1.1 (the "License"); you may not use this file except in compliance with
  9. * the License. You may obtain a copy of the License at
  10. * http://www.mozilla.org/MPL/
  11. *
  12. * Software distributed under the License is distributed on an "AS IS" basis,
  13. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  14. * for the specific language governing rights and limitations under the
  15. * License.
  16. *
  17. * The Original Code is Mozilla Communicator client code, released
  18. * March 31, 1998.
  19. *
  20. * The Initial Developer of the Original Code is
  21. * Netscape Communications Corporation.
  22. * Portions created by the Initial Developer are Copyright (C) 1998
  23. * the Initial Developer. All Rights Reserved.
  24. *
  25. * Contributor(s):
  26. * Nick Fitzgerald <nfitzgerald@mozilla.com>
  27. *
  28. * Alternatively, the contents of this file may be used under the terms of
  29. * either of the GNU General Public License Version 2 or later (the "GPL"),
  30. * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  31. * in which case the provisions of the GPL or the LGPL are applicable instead
  32. * of those above. If you wish to allow use of your version of this file only
  33. * under the terms of either the GPL or the LGPL, and not to allow others to
  34. * use your version of this file under the terms of the MPL, indicate your
  35. * decision by deleting the provisions above and replace them with the notice
  36. * and other provisions required by the GPL or the LGPL. If you do not delete
  37. * the provisions above, a recipient may use your version of this file under
  38. * the terms of any one of the MPL, the GPL or the LGPL.
  39. *
  40. * ***** END LICENSE BLOCK ***** */
  41. #ifndef jsdbgapi_h___
  42. #define jsdbgapi_h___
  43. /*
  44. * JS debugger API.
  45. */
  46. #include "jsapi.h"
  47. #include "jsprvtd.h"
  48. JS_BEGIN_EXTERN_C
  49. extern JS_PUBLIC_API(JSCrossCompartmentCall *)
  50. JS_EnterCrossCompartmentCallScript(JSContext *cx, JSScript *target);
  51. extern JS_PUBLIC_API(JSCrossCompartmentCall *)
  52. JS_EnterCrossCompartmentCallStackFrame(JSContext *cx, JSStackFrame *target);
  53. #ifdef __cplusplus
  54. JS_END_EXTERN_C
  55. namespace JS {
  56. class JS_PUBLIC_API(AutoEnterScriptCompartment)
  57. {
  58. protected:
  59. JSCrossCompartmentCall *call;
  60. public:
  61. AutoEnterScriptCompartment() : call(NULL) {}
  62. bool enter(JSContext *cx, JSScript *target);
  63. bool entered() const { return call != NULL; }
  64. ~AutoEnterScriptCompartment() {
  65. if (call && call != reinterpret_cast<JSCrossCompartmentCall*>(1))
  66. JS_LeaveCrossCompartmentCall(call);
  67. }
  68. };
  69. class JS_PUBLIC_API(AutoEnterFrameCompartment) : public AutoEnterScriptCompartment
  70. {
  71. public:
  72. bool enter(JSContext *cx, JSStackFrame *target);
  73. };
  74. } /* namespace JS */
  75. #ifdef DEBUG
  76. JS_FRIEND_API(void) js_DumpValue(const js::Value &val);
  77. JS_FRIEND_API(void) js_DumpId(jsid id);
  78. JS_FRIEND_API(void) js_DumpStackFrame(JSContext *cx, js::StackFrame *start = NULL);
  79. #endif
  80. JS_BEGIN_EXTERN_C
  81. #endif
  82. extern JS_PUBLIC_API(JSString *)
  83. JS_DecompileScript(JSContext *cx, JSScript *script, const char *name, uintN indent);
  84. /*
  85. * Currently, we only support runtime-wide debugging. In the future, we should
  86. * be able to support compartment-wide debugging.
  87. */
  88. extern JS_PUBLIC_API(void)
  89. JS_SetRuntimeDebugMode(JSRuntime *rt, JSBool debug);
  90. /*
  91. * Debug mode is a compartment-wide mode that enables a debugger to attach
  92. * to and interact with running methodjit-ed frames. In particular, it causes
  93. * every function to be compiled as if an eval was present (so eval-in-frame)
  94. * can work, and it ensures that functions can be re-JITed for other debug
  95. * features. In general, it is not safe to interact with frames that were live
  96. * before debug mode was enabled. For this reason, it is also not safe to
  97. * enable debug mode while frames are live.
  98. */
  99. /* Get current state of debugging mode. */
  100. extern JS_PUBLIC_API(JSBool)
  101. JS_GetDebugMode(JSContext *cx);
  102. /*
  103. * Turn on/off debugging mode for a single compartment. This should only be
  104. * used when no code from this compartment is running or on the stack in any
  105. * thread.
  106. */
  107. JS_FRIEND_API(JSBool)
  108. JS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, JSBool debug);
  109. /*
  110. * Turn on/off debugging mode for a context's compartment.
  111. */
  112. JS_FRIEND_API(JSBool)
  113. JS_SetDebugMode(JSContext *cx, JSBool debug);
  114. /* Turn on single step mode. */
  115. extern JS_PUBLIC_API(JSBool)
  116. JS_SetSingleStepMode(JSContext *cx, JSScript *script, JSBool singleStep);
  117. /* The closure argument will be marked. */
  118. extern JS_PUBLIC_API(JSBool)
  119. JS_SetTrap(JSContext *cx, JSScript *script, jsbytecode *pc,
  120. JSTrapHandler handler, jsval closure);
  121. extern JS_PUBLIC_API(void)
  122. JS_ClearTrap(JSContext *cx, JSScript *script, jsbytecode *pc,
  123. JSTrapHandler *handlerp, jsval *closurep);
  124. extern JS_PUBLIC_API(void)
  125. JS_ClearScriptTraps(JSContext *cx, JSScript *script);
  126. extern JS_PUBLIC_API(void)
  127. JS_ClearAllTrapsForCompartment(JSContext *cx);
  128. extern JS_PUBLIC_API(JSBool)
  129. JS_SetInterrupt(JSRuntime *rt, JSInterruptHook handler, void *closure);
  130. extern JS_PUBLIC_API(JSBool)
  131. JS_ClearInterrupt(JSRuntime *rt, JSInterruptHook *handlerp, void **closurep);
  132. /************************************************************************/
  133. extern JS_PUBLIC_API(JSBool)
  134. JS_SetWatchPoint(JSContext *cx, JSObject *obj, jsid id,
  135. JSWatchPointHandler handler, JSObject *closure);
  136. extern JS_PUBLIC_API(JSBool)
  137. JS_ClearWatchPoint(JSContext *cx, JSObject *obj, jsid id,
  138. JSWatchPointHandler *handlerp, JSObject **closurep);
  139. extern JS_PUBLIC_API(JSBool)
  140. JS_ClearWatchPointsForObject(JSContext *cx, JSObject *obj);
  141. extern JS_PUBLIC_API(JSBool)
  142. JS_ClearAllWatchPoints(JSContext *cx);
  143. /************************************************************************/
  144. extern JS_PUBLIC_API(uintN)
  145. JS_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc);
  146. extern JS_PUBLIC_API(jsbytecode *)
  147. JS_LineNumberToPC(JSContext *cx, JSScript *script, uintN lineno);
  148. extern JS_PUBLIC_API(jsbytecode *)
  149. JS_EndPC(JSContext *cx, JSScript *script);
  150. extern JS_PUBLIC_API(JSBool)
  151. JS_GetLinePCs(JSContext *cx, JSScript *script,
  152. uintN startLine, uintN maxLines,
  153. uintN* count, uintN** lines, jsbytecode*** pcs);
  154. extern JS_PUBLIC_API(uintN)
  155. JS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun);
  156. extern JS_PUBLIC_API(JSBool)
  157. JS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun);
  158. /*
  159. * N.B. The mark is in the context temp pool and thus the caller must take care
  160. * to call JS_ReleaseFunctionLocalNameArray in a LIFO manner (wrt to any other
  161. * call that may use the temp pool.
  162. */
  163. extern JS_PUBLIC_API(uintptr_t *)
  164. JS_GetFunctionLocalNameArray(JSContext *cx, JSFunction *fun, void **markp);
  165. extern JS_PUBLIC_API(JSAtom *)
  166. JS_LocalNameToAtom(uintptr_t w);
  167. extern JS_PUBLIC_API(JSString *)
  168. JS_AtomKey(JSAtom *atom);
  169. extern JS_PUBLIC_API(void)
  170. JS_ReleaseFunctionLocalNameArray(JSContext *cx, void *mark);
  171. extern JS_PUBLIC_API(JSScript *)
  172. JS_GetFunctionScript(JSContext *cx, JSFunction *fun);
  173. extern JS_PUBLIC_API(JSNative)
  174. JS_GetFunctionNative(JSContext *cx, JSFunction *fun);
  175. extern JS_PUBLIC_API(JSPrincipals *)
  176. JS_GetScriptPrincipals(JSContext *cx, JSScript *script);
  177. extern JS_PUBLIC_API(JSPrincipals *)
  178. JS_GetScriptOriginPrincipals(JSContext *cx, JSScript *script);
  179. /*
  180. * Stack Frame Iterator
  181. *
  182. * Used to iterate through the JS stack frames to extract
  183. * information from the frames.
  184. */
  185. extern JS_PUBLIC_API(JSStackFrame *)
  186. JS_FrameIterator(JSContext *cx, JSStackFrame **iteratorp);
  187. extern JS_PUBLIC_API(JSScript *)
  188. JS_GetFrameScript(JSContext *cx, JSStackFrame *fp);
  189. extern JS_PUBLIC_API(jsbytecode *)
  190. JS_GetFramePC(JSContext *cx, JSStackFrame *fp);
  191. /*
  192. * Get the closest scripted frame below fp. If fp is null, start from cx->fp.
  193. */
  194. extern JS_PUBLIC_API(JSStackFrame *)
  195. JS_GetScriptedCaller(JSContext *cx, JSStackFrame *fp);
  196. extern JS_PUBLIC_API(void *)
  197. JS_GetFrameAnnotation(JSContext *cx, JSStackFrame *fp);
  198. extern JS_PUBLIC_API(void)
  199. JS_SetFrameAnnotation(JSContext *cx, JSStackFrame *fp, void *annotation);
  200. extern JS_PUBLIC_API(JSBool)
  201. JS_IsScriptFrame(JSContext *cx, JSStackFrame *fp);
  202. extern JS_PUBLIC_API(JSObject *)
  203. JS_GetFrameScopeChain(JSContext *cx, JSStackFrame *fp);
  204. extern JS_PUBLIC_API(JSObject *)
  205. JS_GetFrameCallObject(JSContext *cx, JSStackFrame *fp);
  206. extern JS_PUBLIC_API(JSBool)
  207. JS_GetFrameThis(JSContext *cx, JSStackFrame *fp, jsval *thisv);
  208. extern JS_PUBLIC_API(JSFunction *)
  209. JS_GetFrameFunction(JSContext *cx, JSStackFrame *fp);
  210. extern JS_PUBLIC_API(JSObject *)
  211. JS_GetFrameFunctionObject(JSContext *cx, JSStackFrame *fp);
  212. JS_PUBLIC_API(JSFunction *)
  213. JS_GetScriptFunction(JSContext *cx, JSScript *script);
  214. extern JS_PUBLIC_API(JSObject *)
  215. JS_GetParentOrScopeChain(JSContext *cx, JSObject *obj);
  216. /* XXXrginda Initially published with typo */
  217. #define JS_IsContructorFrame JS_IsConstructorFrame
  218. extern JS_PUBLIC_API(JSBool)
  219. JS_IsConstructorFrame(JSContext *cx, JSStackFrame *fp);
  220. extern JS_PUBLIC_API(JSBool)
  221. JS_IsDebuggerFrame(JSContext *cx, JSStackFrame *fp);
  222. extern JS_PUBLIC_API(JSBool)
  223. JS_IsGlobalFrame(JSContext *cx, JSStackFrame *fp);
  224. extern JS_PUBLIC_API(jsval)
  225. JS_GetFrameReturnValue(JSContext *cx, JSStackFrame *fp);
  226. extern JS_PUBLIC_API(void)
  227. JS_SetFrameReturnValue(JSContext *cx, JSStackFrame *fp, jsval rval);
  228. /**
  229. * Return fp's callee function object (fp->callee) if it has one. Note that
  230. * this API cannot fail. A null return means "no callee": fp is a global or
  231. * eval-from-global frame, not a call frame.
  232. *
  233. * This API began life as an infallible getter, but now it can return either:
  234. *
  235. * 1. An optimized closure that was compiled assuming the function could not
  236. * escape and be called from sites the compiler could not see.
  237. *
  238. * 2. A "joined function object", an optimization whereby SpiderMonkey avoids
  239. * creating fresh function objects for every evaluation of a function
  240. * expression that is used only once by a consumer that either promises to
  241. * clone later when asked for the value or that cannot leak the value.
  242. *
  243. * Because Mozilla's Gecko embedding of SpiderMonkey (and no doubt other
  244. * embeddings) calls this API in potentially performance-sensitive ways (e.g.
  245. * in nsContentUtils::GetDocumentFromCaller), we are leaving this API alone. It
  246. * may now return an unwrapped non-escaping optimized closure, or a joined
  247. * function object. Such optimized objects may work well if called from the
  248. * correct context, never mutated or compared for identity, etc.
  249. *
  250. * However, if you really need to get the same callee object that JS code would
  251. * see, which means undoing the optimizations, where an undo attempt can fail,
  252. * then use JS_GetValidFrameCalleeObject.
  253. */
  254. extern JS_PUBLIC_API(JSObject *)
  255. JS_GetFrameCalleeObject(JSContext *cx, JSStackFrame *fp);
  256. /**
  257. * Return fp's callee function object after running the deferred closure
  258. * cloning "method read barrier". This API can fail! If the frame has no
  259. * callee, this API returns true with JSVAL_IS_VOID(*vp).
  260. */
  261. extern JS_PUBLIC_API(JSBool)
  262. JS_GetValidFrameCalleeObject(JSContext *cx, JSStackFrame *fp, jsval *vp);
  263. /************************************************************************/
  264. extern JS_PUBLIC_API(const char *)
  265. JS_GetScriptFilename(JSContext *cx, JSScript *script);
  266. extern JS_PUBLIC_API(const jschar *)
  267. JS_GetScriptSourceMap(JSContext *cx, JSScript *script);
  268. extern JS_PUBLIC_API(uintN)
  269. JS_GetScriptBaseLineNumber(JSContext *cx, JSScript *script);
  270. extern JS_PUBLIC_API(uintN)
  271. JS_GetScriptLineExtent(JSContext *cx, JSScript *script);
  272. extern JS_PUBLIC_API(JSVersion)
  273. JS_GetScriptVersion(JSContext *cx, JSScript *script);
  274. /************************************************************************/
  275. /*
  276. * Hook setters for script creation and destruction, see jsprvtd.h for the
  277. * typedefs. These macros provide binary compatibility and newer, shorter
  278. * synonyms.
  279. */
  280. #define JS_SetNewScriptHook JS_SetNewScriptHookProc
  281. #define JS_SetDestroyScriptHook JS_SetDestroyScriptHookProc
  282. extern JS_PUBLIC_API(void)
  283. JS_SetNewScriptHook(JSRuntime *rt, JSNewScriptHook hook, void *callerdata);
  284. extern JS_PUBLIC_API(void)
  285. JS_SetDestroyScriptHook(JSRuntime *rt, JSDestroyScriptHook hook,
  286. void *callerdata);
  287. /************************************************************************/
  288. extern JS_PUBLIC_API(JSBool)
  289. JS_EvaluateUCInStackFrame(JSContext *cx, JSStackFrame *fp,
  290. const jschar *chars, uintN length,
  291. const char *filename, uintN lineno,
  292. jsval *rval);
  293. extern JS_PUBLIC_API(JSBool)
  294. JS_EvaluateInStackFrame(JSContext *cx, JSStackFrame *fp,
  295. const char *bytes, uintN length,
  296. const char *filename, uintN lineno,
  297. jsval *rval);
  298. /************************************************************************/
  299. typedef struct JSPropertyDesc {
  300. jsval id; /* primary id, atomized string, or int */
  301. jsval value; /* property value */
  302. uint8_t flags; /* flags, see below */
  303. uint8_t spare; /* unused */
  304. uint16_t slot; /* argument/variable slot */
  305. jsval alias; /* alias id if JSPD_ALIAS flag */
  306. } JSPropertyDesc;
  307. #define JSPD_ENUMERATE 0x01 /* visible to for/in loop */
  308. #define JSPD_READONLY 0x02 /* assignment is error */
  309. #define JSPD_PERMANENT 0x04 /* property cannot be deleted */
  310. #define JSPD_ALIAS 0x08 /* property has an alias id */
  311. #define JSPD_ARGUMENT 0x10 /* argument to function */
  312. #define JSPD_VARIABLE 0x20 /* local variable in function */
  313. #define JSPD_EXCEPTION 0x40 /* exception occurred fetching the property, */
  314. /* value is exception */
  315. #define JSPD_ERROR 0x80 /* native getter returned JS_FALSE without */
  316. /* throwing an exception */
  317. typedef struct JSPropertyDescArray {
  318. uint32_t length; /* number of elements in array */
  319. JSPropertyDesc *array; /* alloc'd by Get, freed by Put */
  320. } JSPropertyDescArray;
  321. typedef struct JSScopeProperty JSScopeProperty;
  322. extern JS_PUBLIC_API(JSScopeProperty *)
  323. JS_PropertyIterator(JSObject *obj, JSScopeProperty **iteratorp);
  324. extern JS_PUBLIC_API(JSBool)
  325. JS_GetPropertyDesc(JSContext *cx, JSObject *obj, JSScopeProperty *shape,
  326. JSPropertyDesc *pd);
  327. extern JS_PUBLIC_API(JSBool)
  328. JS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda);
  329. extern JS_PUBLIC_API(void)
  330. JS_PutPropertyDescArray(JSContext *cx, JSPropertyDescArray *pda);
  331. /************************************************************************/
  332. extern JS_PUBLIC_API(JSBool)
  333. JS_SetDebuggerHandler(JSRuntime *rt, JSDebuggerHandler hook, void *closure);
  334. extern JS_PUBLIC_API(JSBool)
  335. JS_SetSourceHandler(JSRuntime *rt, JSSourceHandler handler, void *closure);
  336. extern JS_PUBLIC_API(JSBool)
  337. JS_SetExecuteHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);
  338. extern JS_PUBLIC_API(JSBool)
  339. JS_SetCallHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);
  340. extern JS_PUBLIC_API(JSBool)
  341. JS_SetThrowHook(JSRuntime *rt, JSThrowHook hook, void *closure);
  342. extern JS_PUBLIC_API(JSBool)
  343. JS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure);
  344. /************************************************************************/
  345. extern JS_PUBLIC_API(size_t)
  346. JS_GetObjectTotalSize(JSContext *cx, JSObject *obj);
  347. extern JS_PUBLIC_API(size_t)
  348. JS_GetFunctionTotalSize(JSContext *cx, JSFunction *fun);
  349. extern JS_PUBLIC_API(size_t)
  350. JS_GetScriptTotalSize(JSContext *cx, JSScript *script);
  351. /*
  352. * Return true if obj is a "system" object, that is, one created by
  353. * JS_NewSystemObject with the system flag set and not JS_NewObject.
  354. *
  355. * What "system" means is up to the API client.
  356. */
  357. extern JS_PUBLIC_API(JSBool)
  358. JS_IsSystemObject(JSContext *cx, JSObject *obj);
  359. /*
  360. * Mark an object as being a system object. This should be called immediately
  361. * after allocating the object. A system object is an object for which
  362. * JS_IsSystemObject returns true.
  363. */
  364. extern JS_PUBLIC_API(JSBool)
  365. JS_MakeSystemObject(JSContext *cx, JSObject *obj);
  366. /************************************************************************/
  367. extern JS_FRIEND_API(void)
  368. js_RevertVersion(JSContext *cx);
  369. extern JS_PUBLIC_API(const JSDebugHooks *)
  370. JS_GetGlobalDebugHooks(JSRuntime *rt);
  371. extern JS_PUBLIC_API(JSDebugHooks *)
  372. JS_SetContextDebugHooks(JSContext *cx, const JSDebugHooks *hooks);
  373. /* Disable debug hooks for this context. */
  374. extern JS_PUBLIC_API(JSDebugHooks *)
  375. JS_ClearContextDebugHooks(JSContext *cx);
  376. /**
  377. * Start any profilers that are available and have been configured on for this
  378. * platform. This is NOT thread safe.
  379. *
  380. * The profileName is used by some profilers to describe the current profiling
  381. * run. It may be used for part of the filename of the output, but the
  382. * specifics depend on the profiler. Many profilers will ignore it. Passing in
  383. * NULL is legal; some profilers may use it to output to stdout or similar.
  384. *
  385. * Returns true if no profilers fail to start.
  386. */
  387. extern JS_PUBLIC_API(JSBool)
  388. JS_StartProfiling(const char *profileName);
  389. /**
  390. * Stop any profilers that were previously started with JS_StartProfiling.
  391. * Returns true if no profilers fail to stop.
  392. */
  393. extern JS_PUBLIC_API(JSBool)
  394. JS_StopProfiling(const char *profileName);
  395. /**
  396. * Write the current profile data to the given file, if applicable to whatever
  397. * profiler is being used.
  398. */
  399. extern JS_PUBLIC_API(JSBool)
  400. JS_DumpProfile(const char *outfile, const char *profileName);
  401. /**
  402. * Pause currently active profilers (only supported by some profilers). Returns
  403. * whether any profilers failed to pause. (Profilers that do not support
  404. * pause/resume do not count.)
  405. */
  406. extern JS_PUBLIC_API(JSBool)
  407. JS_PauseProfilers(const char *profileName);
  408. /**
  409. * Resume suspended profilers
  410. */
  411. extern JS_PUBLIC_API(JSBool)
  412. JS_ResumeProfilers(const char *profileName);
  413. /**
  414. * Add various profiling-related functions as properties of the given object.
  415. */
  416. extern JS_PUBLIC_API(JSBool)
  417. JS_DefineProfilingFunctions(JSContext *cx, JSObject *obj);
  418. /* Defined in vm/Debugger.cpp. */
  419. extern JS_PUBLIC_API(JSBool)
  420. JS_DefineDebuggerObject(JSContext *cx, JSObject *obj);
  421. /**
  422. * The profiling API calls are not able to report errors, so they use a
  423. * thread-unsafe global memory buffer to hold the last error encountered. This
  424. * should only be called after something returns false.
  425. */
  426. JS_PUBLIC_API(const char *)
  427. JS_UnsafeGetLastProfilingError();
  428. #ifdef MOZ_CALLGRIND
  429. extern JS_FRIEND_API(JSBool)
  430. js_StopCallgrind();
  431. extern JS_FRIEND_API(JSBool)
  432. js_StartCallgrind();
  433. extern JS_FRIEND_API(JSBool)
  434. js_DumpCallgrind(const char *outfile);
  435. #endif /* MOZ_CALLGRIND */
  436. #ifdef MOZ_VTUNE
  437. extern JS_FRIEND_API(bool)
  438. js_StartVtune(const char *profileName);
  439. extern JS_FRIEND_API(bool)
  440. js_StopVtune();
  441. extern JS_FRIEND_API(bool)
  442. js_PauseVtune();
  443. extern JS_FRIEND_API(bool)
  444. js_ResumeVtune();
  445. #endif /* MOZ_VTUNE */
  446. extern JS_PUBLIC_API(void)
  447. JS_DumpBytecode(JSContext *cx, JSScript *script);
  448. extern JS_PUBLIC_API(void)
  449. JS_DumpCompartmentBytecode(JSContext *cx);
  450. extern JS_PUBLIC_API(void)
  451. JS_DumpPCCounts(JSContext *cx, JSScript *script);
  452. extern JS_PUBLIC_API(void)
  453. JS_DumpCompartmentPCCounts(JSContext *cx);
  454. extern JS_PUBLIC_API(JSObject *)
  455. JS_UnwrapObject(JSObject *obj);
  456. JS_END_EXTERN_C
  457. #endif /* jsdbgapi_h___ */