Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
jsdIDebuggerService Interface Reference

Debugger service. More...

import "jsdIDebuggerService.idl";

Inheritance diagram for jsdIDebuggerService:
Inheritance graph
[legend]
Collaboration diagram for jsdIDebuggerService:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void on ()
 Turn on the debugger.
void onForRuntime (in JSRuntime rt)
 Turn on the debugger for a given runtime.
void off ()
 Turn the debugger off.
unsigned long pause ()
 Temporarily disable the debugger.
unsigned long unPause ()
 Undo a pause.
void GC ()
 Force the engine to perform garbage collection.
void clearProfileData ()
 Clear profile data for all scripts.
void insertFilter (in jsdIFilter filter, in jsdIFilter after)
 Adds an execution hook filter.
void appendFilter (in jsdIFilter filter)
 Same as insertFilter, except always add to the end of the list.
void removeFilter (in jsdIFilter filter)
 Remove a filter.
void swapFilters (in jsdIFilter filter_a, in jsdIFilter filter_b)
 Swap position of two filters.
void enumerateFilters (in jsdIFilterEnumerator enumerator)
 Enumerate registered filters.
void refreshFilters ()
 Force the debugger to resync its internal filter cache with the actual values in the jsdIFilter objects.
void clearFilters ()
 Clear the list of filters.
void enumerateContexts (in jsdIContextEnumerator enumerator)
 Enumerate all known contexts.
void enumerateScripts (in jsdIScriptEnumerator enumerator)
 Enumerate all scripts the debugger knows about.
void clearAllBreakpoints ()
 Clear all breakpoints in all scripts.
jsdIValue wrapValue ()
 When called from JavaScript, this method returns the jsdIValue wrapper for the given value.
unsigned long enterNestedEventLoop (in jsdINestCallback callback)
 Push a new network queue, and enter a new UI event loop.
unsigned long exitNestedEventLoop ()
 Exit the current nested event loop after the current iteration completes, and pop the network event queue.

Public Attributes

readonly attribute JSDContext JSDContext
 Internal use only.
attribute jsdIErrorHook errorHook
 Called when an error or warning occurs.
attribute jsdIScriptHook scriptHook
 Called when a jsdIScript is created or destroyed.
attribute jsdIExecutionHook breakpointHook
 Called when the engine encounters a breakpoint.
attribute jsdIExecutionHook debuggerHook
 Called when the engine encounters the debugger keyword.
attribute jsdIExecutionHook debugHook
 Called when the errorHook returns false.
attribute jsdIExecutionHook interruptHook
 Called before the next PC is executed.
attribute jsdIExecutionHook throwHook
 Called when an exception is thrown (even if it will be caught.)
attribute jsdICallHook topLevelHook
 Called before and after a toplevel script is evaluated.
attribute jsdICallHook functionHook
 Called before and after a function is called.
const long VERSION_1_0 = 100
 VERSION_* values must be kept in sync with the JSVersion enumeration in jspubtd.h.
const long VERSION_1_1 = 110
const long VERSION_1_2 = 120
const long VERSION_1_3 = 130
const long VERSION_1_4 = 140
const long VERSION_1_5 = 150
const long VERSION_DEFAULT = 0
const long VERSION_UNKNOWN = -1
const unsigned long ENABLE_NATIVE_FRAMES = 0x01
 These flags need to be kept in sync with the context flags defined in jsdebug.h.
const unsigned long PROFILE_WHEN_SET = 0x02
 Normally, if a script has a 0 in JSD_SCRIPT_PROFILE_BIT it is included in profile data, otherwise it is not profiled.
const unsigned long DEBUG_WHEN_SET = 0x04
 Normally, when the script in the top frame of a thread state has a 1 in JSD_SCRIPT_DEBUG_BIT, the execution hook is ignored.
const unsigned long COLLECT_PROFILE_DATA = 0x08
 When this flag is set the internal call hook will collect profile data.
const unsigned long HIDE_DISABLED_FRAMES = 0x10
 When this flag is set, stack frames that are disabled for debugging will not appear in the call stack chain.
const unsigned long MASK_TOP_FRAME_ONLY = 0x20
 When this flag is set, the debugger will only check the JSD_SCRIPT_DEBUG_BIT on the top (most recent) stack frame.
const unsigned long DISABLE_OBJECT_TRACE = 0x40
 When this flag is set, object creation will not be tracked.
attribute unsigned long flags
 Debugger service flags.
readonly attribute unsigned long implementationMajor
 Major version number of implementation.
readonly attribute unsigned long implementationMinor
 Minor version number of implementation.
readonly attribute string implementationString
 Free form string identifier for implementation.
attribute boolean initAtStartup
 |true| if the debugger should register an app-start observer in order to begin collecting debug information when mozilla is launched.
readonly attribute boolean isOn
 |true| if the debugger service has been turned on.
readonly attribute unsigned long pauseDepth
 Peek at the current pause depth of the debugger.

Detailed Description

Debugger service.

It's not a good idea to have more than one active client of the debugger service.

Definition at line 82 of file jsdIDebuggerService.idl.


Member Function Documentation

Same as insertFilter, except always add to the end of the list.

Clear all breakpoints in all scripts.

Clear the list of filters.

Clear profile data for all scripts.

Push a new network queue, and enter a new UI event loop.

Parameters:
callbackjsdINestCallback 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.

Enumerate all known contexts.

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.

Parameters:
enumeratorjsdIFilterEnumerator instance to be called back for the enumeration.

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.

Parameters:
enumeratorjsdIScriptEnumerator instance to be called back for the enumeration.

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.

Force the engine to perform garbage collection.

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.

Parameters:
filterObject representing the filter to add.
afterInsert |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.

Turn on the debugger for a given runtime.

Parameters:
rtThe 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.

Remove a filter.

If |filter| is not present this method throws NS_ERROR_INVALID_ARG.

Parameters:
filterObject representing the filter to remove. Must be the exact object passed to addFilter, not just a new object with the same properties.

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.

Undo a pause.

Returns:
depth The number of remaining pending pause calls.

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.


Member Data Documentation

Called when the engine encounters a breakpoint.

Definition at line 98 of file jsdIDebuggerService.idl.

When this flag is set the internal call hook will collect profile data.

Definition at line 166 of file jsdIDebuggerService.idl.

Normally, when the script in the top frame of a thread state has a 1 in JSD_SCRIPT_DEBUG_BIT, the execution hook is ignored.

Setting the DEBUG_WHEN_SET flag reverses this convention.

Definition at line 162 of file jsdIDebuggerService.idl.

Called when the engine encounters the debugger keyword.

Definition at line 102 of file jsdIDebuggerService.idl.

Called when the errorHook returns false.

Definition at line 106 of file jsdIDebuggerService.idl.

When this flag is set, object creation will not be tracked.

This will reduce the performance price you pay by enabling the debugger.

Definition at line 193 of file jsdIDebuggerService.idl.

These flags need to be kept in sync with the context flags defined in jsdebug.h.

Link native frames in call stacks.

Definition at line 150 of file jsdIDebuggerService.idl.

Called when an error or warning occurs.

Definition at line 90 of file jsdIDebuggerService.idl.

Debugger service flags.

Definition at line 198 of file jsdIDebuggerService.idl.

Called before and after a function is called.

Definition at line 122 of file jsdIDebuggerService.idl.

When this flag is set, stack frames that are disabled for debugging will not appear in the call stack chain.

Definition at line 171 of file jsdIDebuggerService.idl.

Major version number of implementation.

Definition at line 203 of file jsdIDebuggerService.idl.

Minor version number of implementation.

Definition at line 207 of file jsdIDebuggerService.idl.

Free form string identifier for implementation.

Definition at line 211 of file jsdIDebuggerService.idl.

|true| if the debugger should register an app-start observer in order to begin collecting debug information when mozilla is launched.

Definition at line 217 of file jsdIDebuggerService.idl.

Called before the next PC is executed.

Definition at line 110 of file jsdIDebuggerService.idl.

|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.

Definition at line 224 of file jsdIDebuggerService.idl.

Internal use only.

Definition at line 85 of file jsdIDebuggerService.idl.

When this flag is set, the debugger will only check the JSD_SCRIPT_DEBUG_BIT on the top (most recent) stack frame.

This makes it possible to stop in an enabled frame which was called from a stack that contains a disabled frame.

When this flag is not set, any stack that contains a disabled frame will not be debugged (the execution hook will not be invoked.)

This only applies when the reason for calling the hook would have been TYPE_INTERRUPTED or TYPE_THROW. TYPE_BREAKPOINT, TYPE_DEBUG_REQUESTED, and TYPE_DEBUGGER_KEYWORD always stop, regardless of this setting, as long as the top frame is not disabled.

If HIDE_DISABLED_FRAMES is set, this is effectively set as well.

Definition at line 188 of file jsdIDebuggerService.idl.

Peek at the current pause depth of the debugger.

Returns:
depth Number of pause() calls still waiting to be unPause()d.

Definition at line 252 of file jsdIDebuggerService.idl.

Normally, if a script has a 0 in JSD_SCRIPT_PROFILE_BIT it is included in profile data, otherwise it is not profiled.

Setting the PROFILE_WHEN_SET flag reverses this convention.

Definition at line 156 of file jsdIDebuggerService.idl.

Called when a jsdIScript is created or destroyed.

Definition at line 94 of file jsdIDebuggerService.idl.

Called when an exception is thrown (even if it will be caught.)

Definition at line 114 of file jsdIDebuggerService.idl.

Called before and after a toplevel script is evaluated.

Definition at line 118 of file jsdIDebuggerService.idl.

VERSION_* values must be kept in sync with the JSVersion enumeration in jspubtd.h.

Possible values for jsdIScript::version and jsdIContext::version.

Definition at line 133 of file jsdIDebuggerService.idl.

Definition at line 134 of file jsdIDebuggerService.idl.

Definition at line 135 of file jsdIDebuggerService.idl.

Definition at line 136 of file jsdIDebuggerService.idl.

Definition at line 137 of file jsdIDebuggerService.idl.

Definition at line 138 of file jsdIDebuggerService.idl.

Definition at line 139 of file jsdIDebuggerService.idl.

Definition at line 140 of file jsdIDebuggerService.idl.


The documentation for this interface was generated from the following file: