Public Types | Public Member Functions | Public Attributes

jsdIExecutionHook Interface Reference

Hook instances of this interface up to the jsdIDebuggerService::breakpointHook, debuggerHook, errorHook, interruptHook, and throwHook properties. More...

import "jsdIDebuggerService.idl";

List of all members.

Public Types

enum  { TYPE_INTERRUPTED = 0U }
 

Hook instances of this interface up to the jsdIDebuggerService::breakpointHook, debuggerHook, errorHook, interruptHook, and throwHook properties.

More...
enum  { TYPE_BREAKPOINT = 1U }
 

Execution stopped by a trap instruction (i.e.

More...
enum  { TYPE_DEBUG_REQUESTED = 2U }
 

Error handler returned an "invoke debugger" value.

More...
enum  { TYPE_DEBUGGER_KEYWORD = 3U }
 

Debugger keyword encountered.

More...
enum  { TYPE_THROW = 4U }
 

Exception was thrown.

More...
enum  { RETURN_HOOK_ERROR = 0U }
 

RETURN_* values must be kept in sync with JSD_HOOK_RETURN_* defines in jsdebug.h.

More...
enum  { RETURN_CONTINUE = 1U }
 

Continue processing normally.

More...
enum  { RETURN_ABORT = 2U }
 

Same effect as RETURN_HOOK_ERROR.

More...
enum  { RETURN_RET_WITH_VAL = 3U }
 

Return the value of the |val| parameter.

More...
enum  { RETURN_THROW_WITH_VAL = 4U }
 

Throw the value of the |val| parameter.

More...
enum  { RETURN_CONTINUE_THROW = 5U }
 

Continue the current throw.

More...

Public Member Functions

virtual nsresult OnExecute (jsdIStackFrame *frame, PRUint32 type, jsdIValue **val, PRUint32 *_retval)=0
unsigned long onExecute (in jsdIStackFrame frame, in unsigned long type, inout jsdIValue val)

Public Attributes

const unsigned long TYPE_INTERRUPTED = 0
 TYPE_* values must be kept in sync with JSD_HOOK_* defines in jsdebug.h.
const unsigned long TYPE_BREAKPOINT = 1
 Execution stopped by a trap instruction (i.e.
const unsigned long TYPE_DEBUG_REQUESTED = 2
 Error handler returned an "invoke debugger" value.
const unsigned long TYPE_DEBUGGER_KEYWORD = 3
 Debugger keyword encountered.
const unsigned long TYPE_THROW = 4
 Exception was thrown.
const unsigned long RETURN_HOOK_ERROR = 0
 RETURN_* values must be kept in sync with JSD_HOOK_RETURN_* defines in jsdebug.h.
const unsigned long RETURN_CONTINUE = 1
 Continue processing normally.
const unsigned long RETURN_ABORT = 2
 Same effect as RETURN_HOOK_ERROR.
const unsigned long RETURN_RET_WITH_VAL = 3
 Return the value of the |val| parameter.
const unsigned long RETURN_THROW_WITH_VAL = 4
 Throw the value of the |val| parameter.
const unsigned long RETURN_CONTINUE_THROW = 5
 Continue the current throw.

Detailed Description

Hook instances of this interface up to the jsdIDebuggerService::breakpointHook, debuggerHook, errorHook, interruptHook, and throwHook properties.


Member Enumeration Documentation

anonymous enum

Hook instances of this interface up to the jsdIDebuggerService::breakpointHook, debuggerHook, errorHook, interruptHook, and throwHook properties.

TYPE_* values must be kept in sync with JSD_HOOK_* defines in jsdebug.h. Execution stopped because we're in single step mode.

Enumerator:
TYPE_INTERRUPTED 
anonymous enum

Execution stopped by a trap instruction (i.e.

breakoint.)

Enumerator:
TYPE_BREAKPOINT 
anonymous enum

Error handler returned an "invoke debugger" value.

Enumerator:
TYPE_DEBUG_REQUESTED 
anonymous enum

Debugger keyword encountered.

Enumerator:
TYPE_DEBUGGER_KEYWORD 
anonymous enum

Exception was thrown.

Enumerator:
TYPE_THROW 
anonymous enum

RETURN_* values must be kept in sync with JSD_HOOK_RETURN_* defines in jsdebug.h.

Indicates unrecoverable error processing the hook. This will cause the script being executed to be aborted without raising a JavaScript exception.

Enumerator:
RETURN_HOOK_ERROR 
anonymous enum

Continue processing normally.

This is the "do nothing special" return value for all hook types *except* TYPE_THROW. Returning RETURN_CONTINUE from TYPE_THROW cause the exception to be ignored. Return RETURN_CONTINUE_THROW to continue exception processing from TYPE_THROW hooks.

Enumerator:
RETURN_CONTINUE 
anonymous enum

Same effect as RETURN_HOOK_ERROR.

Enumerator:
RETURN_ABORT 
anonymous enum

Return the value of the |val| parameter.

Enumerator:
RETURN_RET_WITH_VAL 
anonymous enum

Throw the value of the |val| parameter.

Enumerator:
RETURN_THROW_WITH_VAL 
anonymous enum

Continue the current throw.

Enumerator:
RETURN_CONTINUE_THROW 

Member Function Documentation

virtual nsresult jsdIExecutionHook::OnExecute ( jsdIStackFrame frame,
PRUint32  type,
jsdIValue **  val,
PRUint32 *  _retval 
) [pure virtual]
Parameters:
frame A jsdIStackFrame object representing the bottom stack frame.
type One of the jsdIExecutionHook::TYPE_ constants.
val in - Current exception (if any) when this method is called. out - If you return RETURN_THROW_WITH_VAL, value to be thrown. If you return RETURN_RET_WITH_VAL, value to return. All other return values, not significant.
Return values:
One of the jsdIExecutionHook::RETURN_* constants.
unsigned long jsdIExecutionHook::onExecute ( in jsdIStackFrame  frame,
in unsigned long  type,
inout jsdIValue  val 
)
Parameters:
frame A jsdIStackFrame object representing the bottom stack frame.
type One of the jsdIExecutionHook::TYPE_ constants.
val in - Current exception (if any) when this method is called. out - If you return RETURN_THROW_WITH_VAL, value to be thrown. If you return RETURN_RET_WITH_VAL, value to return. All other return values, not significant.
Return values:
One of the jsdIExecutionHook::RETURN_* constants.

Member Data Documentation

const unsigned long jsdIExecutionHook::RETURN_ABORT = 2

Same effect as RETURN_HOOK_ERROR.

const unsigned long jsdIExecutionHook::RETURN_CONTINUE = 1

Continue processing normally.

This is the "do nothing special" return value for all hook types *except* TYPE_THROW. Returning RETURN_CONTINUE from TYPE_THROW cause the exception to be ignored. Return RETURN_CONTINUE_THROW to continue exception processing from TYPE_THROW hooks.

const unsigned long jsdIExecutionHook::RETURN_CONTINUE_THROW = 5

Continue the current throw.

const unsigned long jsdIExecutionHook::RETURN_HOOK_ERROR = 0

RETURN_* values must be kept in sync with JSD_HOOK_RETURN_* defines in jsdebug.h.

Indicates unrecoverable error processing the hook. This will cause the script being executed to be aborted without raising a JavaScript exception.

const unsigned long jsdIExecutionHook::RETURN_RET_WITH_VAL = 3

Return the value of the |val| parameter.

const unsigned long jsdIExecutionHook::RETURN_THROW_WITH_VAL = 4

Throw the value of the |val| parameter.

const unsigned long jsdIExecutionHook::TYPE_BREAKPOINT = 1

Execution stopped by a trap instruction (i.e.

breakoint.)

const unsigned long jsdIExecutionHook::TYPE_DEBUG_REQUESTED = 2

Error handler returned an "invoke debugger" value.

const unsigned long jsdIExecutionHook::TYPE_DEBUGGER_KEYWORD = 3

Debugger keyword encountered.

const unsigned long jsdIExecutionHook::TYPE_INTERRUPTED = 0

TYPE_* values must be kept in sync with JSD_HOOK_* defines in jsdebug.h.

Execution stopped because we're in single step mode.

const unsigned long jsdIExecutionHook::TYPE_THROW = 4

Exception was thrown.


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