KJS
KJS::Debugger Class Reference
#include <debugger.h>
Detailed Description
Definition at line 53 of file debugger.h.
Public Member Functions | |
| Debugger () | |
| virtual | ~Debugger () |
| DebuggerImp * | imp () const |
| virtual void | attach (Interpreter *interp) |
| virtual void | detach (Interpreter *interp) |
| virtual bool | sourceParsed (ExecState *exec, int sourceId, const UString &sourceURL, const UString &source, int startingLineNumber, int errorLine, const UString &errorMsg) |
| virtual bool | exception (ExecState *exec, int sourceId, int lineno, JSValue *exception) |
| bool | hasHandledException (ExecState *, JSValue *) |
| virtual bool | atStatement (ExecState *exec, int sourceId, int firstLine, int lastLine) |
| virtual bool | enterContext (ExecState *exec, int sourceId, int lineno, JSObject *function, const List &args) |
| virtual bool | exitContext (ExecState *exec, int sourceId, int lineno, JSObject *function) |
Static Public Attributes | |
| static int | debuggersPresent = 0 |
Constructor & Destructor Documentation
| Debugger::Debugger | ( | ) |
| Debugger::~Debugger | ( | ) | [virtual] |
Destroys the debugger.
If the debugger is attached to any interpreters, it is automatically detached.
Definition at line 51 of file debugger.cpp.
Member Function Documentation
| DebuggerImp* KJS::Debugger::imp | ( | ) | const [inline] |
Definition at line 67 of file debugger.h.
| void Debugger::attach | ( | Interpreter * | interp | ) | [virtual] |
Attaches the debugger to specified interpreter.
This will cause this object to receive notification of events from the interpreter.
If the interpreter is deleted, the debugger will automatically be detached.
Note: only one debugger can be attached to an interpreter at a time. Attaching another debugger to the same interpreter will cause the original debugger to be detached from that interpreter.
- Parameters:
-
interp The interpreter to attach to
- See also:
- detach()
Definition at line 57 of file debugger.cpp.
| void Debugger::detach | ( | Interpreter * | interp | ) | [virtual] |
Detach the debugger from an interpreter.
- Parameters:
-
interp The interpreter to detach from. If 0, the debugger will be detached from all interpreters to which it is attached.
- See also:
- attach()
Definition at line 68 of file debugger.cpp.
| bool Debugger::sourceParsed | ( | ExecState * | exec, | |
| int | sourceId, | |||
| const UString & | sourceURL, | |||
| const UString & | source, | |||
| int | startingLineNumber, | |||
| int | errorLine, | |||
| const UString & | errorMsg | |||
| ) | [virtual] |
Called to notify the debugger that some javascript source code has been parsed.
For calls to Interpreter::evaluate(), this will be called with the supplied source code before any other code is parsed. Other situations in which this may be called include creation of a function using the Function() constructor, or the eval() function.
The default implementation does nothing. Override this method if you want to process this event.
- Parameters:
-
exec The current execution state sourceId The ID of the source code (corresponds to the sourceId supplied in other functions such as atStatement() sourceURL Where the source code that was parsed came from source The source code that was parsed startingLineNumber The line number at which parsing started errorLine The line number at which parsing encountered an error, or -1 if the source code was valid and parsed successfully errorMsg The error description, or null if the source code was valid and parsed successfully
- Returns:
- true if execution should be continue, false if it should be aborted
Definition at line 98 of file debugger.cpp.
| bool Debugger::exception | ( | ExecState * | exec, | |
| int | sourceId, | |||
| int | lineno, | |||
| JSValue * | exception | |||
| ) | [virtual] |
Called when an exception is thrown during script execution.
The default implementation does nothing. Override this method if you want to process this event.
- Parameters:
-
exec The current execution state sourceId The ID of the source code being executed lineno The line at which the error occurred exceptionObj The exception object
- Returns:
- true if execution should be continue, false if it should be aborted
Definition at line 104 of file debugger.cpp.
Definition at line 89 of file debugger.cpp.
| bool Debugger::atStatement | ( | ExecState * | exec, | |
| int | sourceId, | |||
| int | firstLine, | |||
| int | lastLine | |||
| ) | [virtual] |
Called when a line of the script is reached (before it is executed).
The default implementation does nothing. Override this method if you want to process this event.
- Parameters:
-
exec The current execution state sourceId The ID of the source code being executed firstLine The starting line of the statement that is about to be executed lastLine The ending line of the statement that is about to be executed (usually the same as firstLine)
- Returns:
- true if execution should be continue, false if it should be aborted
Definition at line 110 of file debugger.cpp.
| bool Debugger::enterContext | ( | ExecState * | exec, | |
| int | sourceId, | |||
| int | lineno, | |||
| JSObject * | function, | |||
| const List & | args | |||
| ) | [virtual] |
Called when the interpreter enters a new execution context (stack frame).
This can happen in three situations:
- A call to Interpreter::evaluate(). This has a codeType of GlobalCode
- A call to the builtin eval() function. The sourceId corresponds to the code passed in to eval. This has a codeType of EvalCode. The lineno here is always 0 since execution starts at the beginning of the script.
- A function call. This only occurs for functions defined in ECMAScript code, whether via the normal function() { ... } syntax or a call to the built-in Function() constructor (anonymous functions). In the former case, the sourceId and lineno indicate the location at which the function was defined. For anonymous functions, the sourceId corresponds to the code passed into the Function() constructor.
enterContext() is not called for functions implemented in the native code, since these do not use an execution context.
- Parameters:
-
exec The current execution state (corresponding to the new stack sourceId The ID of the source code being executed lineno The line that is about to be executed function The function being called. 0 in non-function context. args The arguments that were passed to the function line is being executed. Empty in non-function contexts.
- Returns:
- true if execution should be continue, false if it should be aborted
Definition at line 116 of file debugger.cpp.
| bool Debugger::exitContext | ( | ExecState * | exec, | |
| int | sourceId, | |||
| int | lineno, | |||
| JSObject * | function | |||
| ) | [virtual] |
Called when the inteprreter exits an execution context.
This always corresponds to a previous call to enterContext()
The default implementation does nothing. Override this method if you want to process this event.
- Parameters:
-
exec The current execution state sourceId The ID of the source code being executed lineno The line that is about to be executed function The function being returned from, if there is one
- Returns:
- true if execution should be continue, false if it should be aborted
Definition at line 122 of file debugger.cpp.
Member Data Documentation
int Debugger::debuggersPresent = 0 [static] |
Definition at line 214 of file debugger.h.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference