jsdIDebuggerService
| IID: | 9dd9006a-4e5e-4a80-ac3d-007fb7335ca4 |
| Inherits From: | nsISupports |
This interface is intended to be used as a service.
This interface is implemented by the following components:
Constants
Properties
jsdIExecutionHook breakpointHook
Called when the engine encounters a breakpoint.
jsdIExecutionHook debuggerHook
Called when the engine encounters the debugger keyword.
jsdIExecutionHook debugHook
Called when the errorHook returns false.
jsdIErrorHook errorHook
Called when an error or warning occurs.
PRUint32 flags
Debugger service flags.
jsdICallHook functionHook
Called before and after a function is called.
readonly PRUint32 implementationMajor
Major version number of implementation.
readonly PRUint32 implementationMinor
Minor version number of implementation.
readonly char* implementationString
Free form string identifier for implementation.
PRBool initAtStartup
True if the debugger should register an app-start observer in order to begin collecting debug information when mozilla is launched.
jsdIExecutionHook interruptHook
Called before the next PC is executed.
readonly PRBool isOn
True if the debugger service has been turned on. This does not necessarily mean another app is actively using the service, as the autostart pref may have turned the service on.
readonly JSDContext* JSDContext
readonly PRUint32 pauseDepth
Peek at the current pause depth of the debugger.
jsdIScriptHook scriptHook
Called when a jsdIScript is created or destroyed.
jsdIExecutionHook throwHook
Called when an exception is thrown (even if it will be caught.)
jsdICallHook topLevelHook
Called before and after a toplevel script is evaluated.
Methods
void appendFilter ( jsdIFilter filter )
void clearAllBreakpoints ( )
void clearFilters ( )
void clearProfileData ( )
void DumpHeap ( char* fileName )
PRUint32 enterNestedEventLoop ( jsdINestCallback callback )
void enumerateContexts ( jsdIContextEnumerator enumerator )
void enumerateFilters ( jsdIFilterEnumerator enumerator )
void enumerateScripts ( jsdIScriptEnumerator enumerator )
PRUint32 exitNestedEventLoop ( )
void GC ( )
void insertFilter ( jsdIFilter filter , jsdIFilter after )
void off ( )
void on ( )
[noscript] void onForRuntime ( JSRuntime* rt )
PRUint32 pause ( )
void refreshFilters ( )
void removeFilter ( jsdIFilter filter )
void swapFilters ( jsdIFilter filter_a , jsdIFilter filter_b )
PRUint32 unPause ( )
jsdIValue wrapValue ( )
void appendFilter ( jsdIFilter filter )
Same as insertFilter, except always add to the end of the list.
- Arguments:
- filter
void DumpHeap ( char* fileName )
Output dump of JS heap.
- Arguments:
- fileName: Filename to dump the heap into.
PRUint32 enterNestedEventLoop ( jsdINestCallback callback )
Push a new network queue, and enter a new UI event loop.
- Arguments:
- callback: jsdINestCallback instance to be called back after the network queue has been pushed, but before the UI loop starts.
- Returns:
- depth returns the current number of times the event loop has been nested. your code can use it for sanity checks.
void enumerateContexts ( jsdIContextEnumerator enumerator )
Enumerate all known contexts.
- Arguments:
- enumerator
void enumerateFilters ( jsdIFilterEnumerator enumerator )
Enumerate registered filters. This routine refreshes each filter before passing them on to the enumeration function. Calling this with a null enumerator is equivalent to jsdIService::refreshFilters.
- Arguments:
- enumerator: jsdIFilterEnumerator instance to be called back for the enumeration.
void enumerateScripts ( jsdIScriptEnumerator enumerator )
Enumerate all scripts the debugger knows about. Any scripts created before you turned the debugger on, or after turning the debugger off will not be available unless the autostart perf is set.
- Arguments:
- enumerator: jsdIScriptEnumerator instance to be called back for the enumeration.
PRUint32 exitNestedEventLoop ( )
Exit the current nested event loop after the current iteration completes, and pop the network event queue.
- Returns:
- depth returns the current number of times the event loop has been nested. your code can use it for sanity checks.
void insertFilter ( jsdIFilter filter , jsdIFilter after )
Adds an execution hook filter. These filters are consulted each time one of the jsdIExecutionHooks is about to be called. Filters are matched in a first in, first compared fashion. The first filter to match determines whether or not the hook is called. Use swapFilter to reorder existing filters, and removeFilter to remove them.
If filter is already present this method throws NS_ERROR_INVALID_ARG.
- Arguments:
- filter: Object representing the filter to add.
- after: Insert |filter| after this one. Pass null to insert at the beginning.
Turn the debugger off. This will invalidate all of your jsdIEphemeral derived objects, and clear all of your breakpoints. In theory you should be able to turn the debugger back on at some later time without any problems.
Turn on the debugger. This function should only be called from JavaScript code. The debugger will be enabled on the runtime the call is made on, as determined by nsIXPCNativeCallContext.
void onForRuntime ( JSRuntime* rt )
Turn on the debugger for a given runtime.
- Arguments:
- rt: The runtime you want to debug. You cannot turn the debugger on for multiple runtimes.
Temporarily disable the debugger. Hooks will not be called while the debugger is paused. Multiple calls to pause will increase the "pause depth", and equal number of unPause calles must be made to resume normal debugging.
- Returns:
- depth Number of times pause has been called since the debugger has been unpaused.
Force the debugger to resync its internal filter cache with the actual values in the jsdIFilter objects. To refresh a single filter use jsdIService::swapFilters. This method is equivalent to jsdIService::enumerateFilters with a null enumerator.
void removeFilter ( jsdIFilter filter )
Remove a filter.
If filter is not present this method throws NS_ERROR_INVALID_ARG.
- Arguments:
- filter: Object representing the filter to remove. Must be the exact object passed to addFilter, not just a new object with the same properties.
void swapFilters ( jsdIFilter filter_a , jsdIFilter filter_b )
Swap position of two filters.
If filter_a is not present, this method throws NS_ERROR_INVALID_ARG. If filter_b is not present, filter_a is replaced by filter_b. If filter_a == filter_b, then filter is refreshed.
- Arguments:
- filter_a
- filter_b
jsdIValue wrapValue ( )
When called from JavaScript, this method returns the jsdIValue wrapper for the given value. If a wrapper does not exist one will be created. When called from another language this method returns an xpconnect defined error code.
Reference documentation is generated from Mozilla's source.
