KJS::Debugger
#include <debugger.h>

Public Member Functions | |
Debugger () | |
virtual | ~Debugger () |
virtual bool | atStatement (ExecState *exec, int sourceId, int firstLine, int lastLine) |
virtual void | attach (Interpreter *interp) |
virtual void | detach (Interpreter *interp) |
virtual bool | enterContext (ExecState *exec, int sourceId, int lineno, JSObject *function, const List &args) |
virtual bool | exception (ExecState *exec, int sourceId, int lineno, JSValue *exception) |
virtual bool | exitContext (ExecState *exec, int sourceId, int lineno, JSObject *function) |
bool | hasHandledException (ExecState *, JSValue *) |
DebuggerImp * | imp () const |
void | reportAtStatement (ExecState *exec, int sourceId, int firstLine, int lastLine) |
void | reportException (ExecState *exec, JSValue *exception) |
void | reportSourceParsed (ExecState *exec, FunctionBodyNode *body, int sourceId, UString sourceURL, const UString &source, int startingLineNumber, int errorLine, const UString &errorMsg) |
virtual bool | shouldReindentSources () const |
virtual bool | shouldReportCaught () const |
virtual bool | sourceParsed (ExecState *exec, int sourceId, const UString &sourceURL, const UString &source, int startingLineNumber, int errorLine, const UString &errorMsg) |
Static Public Attributes | |
static int | debuggersPresent = 0 |
Detailed Description
Provides an interface which receives notification about various script-execution related events such as statement execution and function calls.
WARNING: This interface is still a work in progress and is not yet officially publicly available. It is likely to change in binary incompatible (and possibly source incompatible) ways in future versions. It is anticipated that at some stage the interface will be frozen and made available for general use.
Definition at line 54 of file debugger.h.
Constructor & Destructor Documentation
◆ Debugger()
Debugger::Debugger | ( | ) |
Creates a new debugger.
Definition at line 51 of file debugger.cpp.
◆ ~Debugger()
|
virtual |
Destroys the debugger.
If the debugger is attached to any interpreters, it is automatically detached.
Definition at line 58 of file debugger.cpp.
Member Function Documentation
◆ atStatement()
|
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 122 of file debugger.cpp.
◆ attach()
|
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 64 of file debugger.cpp.
◆ detach()
|
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 77 of file debugger.cpp.
◆ enterContext()
|
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 continued, false if it should be aborted
Definition at line 141 of file debugger.cpp.
◆ 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 exception The exception object
- Returns
- true if execution should be continue, false if it should be aborted
Definition at line 116 of file debugger.cpp.
◆ exitContext()
|
virtual |
Called when the interpreter 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 147 of file debugger.cpp.
◆ sourceParsed()
|
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 110 of file debugger.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 03:54:57 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.