Changeset 33979 in webkit for trunk/JavaScriptCore/kjs/debugger.h
- Timestamp:
- May 21, 2008, 6:20:45 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/debugger.h
r28471 r33979 21 21 */ 22 22 23 #ifndef _KJSDEBUGGER_H_24 #define _KJSDEBUGGER_H_23 #ifndef Debugger_h 24 #define Debugger_h 25 25 26 #include <wtf/Hash Map.h>26 #include <wtf/HashSet.h> 27 27 #include "protect.h" 28 28 29 29 namespace KJS { 30 30 31 class Debugger Imp;31 class DebuggerCallFrame; 32 32 class ExecState; 33 33 class JSGlobalObject; 34 34 class JSObject; 35 35 class JSValue; 36 class List; 37 class SourceProvider; 36 38 class UString; 37 class List; 38 39 39 40 /** 40 41 * @internal … … 43 44 * script-execution related events such as statement execution and function 44 45 * calls. 45 *46 * WARNING: This interface is still a work in progress and is not yet47 * offically publicly available. It is likely to change in binary incompatible48 * (and possibly source incompatible) ways in future versions. It is49 * anticipated that at some stage the interface will be frozen and made50 * available for general use.51 46 */ 52 47 class Debugger { … … 64 59 virtual ~Debugger(); 65 60 66 DebuggerImp *imp() const { return rep; }67 68 61 /** 69 62 * Attaches the debugger to specified global object. This will cause this … … 77 70 * 78 71 * @param The global object to attach to. 79 *80 * @see detach()81 72 */ 82 73 void attach(JSGlobalObject*); … … 85 76 * Detach the debugger from a global object. 86 77 * 87 * @param The global object to detach from. If 0, the debugger will be 88 * detached from all global objects to which it is attached. 89 * 90 * @see attach() 78 * @param The global object to detach from. 91 79 */ 92 80 void detach(JSGlobalObject*); … … 112 100 * @param errorMsg The error description, or null if the source code 113 101 was valid and parsed successfully 114 * @return true if execution should be continue, false if it should115 * be aborted116 102 */ 117 virtual bool sourceParsed(ExecState *exec, int sourceId, const UString &sourceURL, 118 const UString &source, int startingLineNumber, int errorLine, const UString &errorMsg); 119 120 /** 121 * Called when all functions/programs associated with a particular 122 * sourceId have been deleted. After this function has been called for 123 * a particular sourceId, that sourceId will not be used again. 124 * 125 * The default implementation does nothing. Override this method if 126 * you want to process this event. 127 * 128 * @param exec The current execution state 129 * @param sourceId The ID of the source code (corresponds to the 130 * sourceId supplied in other functions such as atLine() 131 * @return true if execution should be continue, false if it should 132 * be aborted 133 */ 134 virtual bool sourceUnused(ExecState *exec, int sourceId); 103 virtual void sourceParsed(ExecState*, int sourceId, const UString& sourceURL, 104 const SourceProvider& source, int startingLineNumber, int errorLine, const UString& errorMsg) = 0; 135 105 136 106 /** … … 144 114 * @param lineno The line at which the error occurred 145 115 * @param exceptionObj The exception object 146 * @return true if execution should be continue, false if it should147 * be aborted148 116 */ 149 virtual bool exception(ExecState *exec, int sourceId, int lineno, 150 JSValue *exception); 151 152 bool hasHandledException(ExecState *, JSValue *); 117 virtual void exception(const DebuggerCallFrame&, int sourceId, int lineno) = 0; 153 118 154 119 /** … … 164 129 * @param lastLine The ending line of the statement that is about to be 165 130 * executed (usually the same as firstLine) 166 * @return true if execution should be continue, false if it should167 * be aborted168 131 */ 169 virtual bool atStatement(ExecState *exec, int sourceId, int firstLine, 170 int lastLine); 132 virtual void atStatement(const DebuggerCallFrame&, int sourceId, int lineno) = 0; 171 133 /** 172 134 * Called on each function call. Use together with @ref #returnEvent … … 183 145 * @param sourceId The ID of the source code being executed 184 146 * @param lineno The line that is about to be executed 185 * @param function The function being called186 * @param args The arguments that were passed to the function187 * line is being executed188 * @return true if execution should be continue, false if it should189 * be aborted190 147 */ 191 virtual bool callEvent(ExecState *exec, int sourceId, int lineno, 192 JSObject *function, const List &args); 148 virtual void callEvent(const DebuggerCallFrame&, int sourceId, int lineno) = 0; 193 149 194 150 /** … … 206 162 * @param sourceId The ID of the source code being executed 207 163 * @param lineno The line that is about to be executed 208 * @param function The function being called209 * @return true if execution should be continue, false if it should210 * be aborted211 164 */ 212 virtual bool returnEvent(ExecState *exec, int sourceId, int lineno, 213 JSObject *function); 165 virtual void returnEvent(const DebuggerCallFrame&, int sourceId, int lineno) = 0; 214 166 215 167 private: 216 DebuggerImp *rep; 217 HashMap<JSGlobalObject*, ProtectedPtr<JSValue> > latestExceptions; 218 219 public: 220 static int debuggersPresent; 168 HashSet<JSGlobalObject*> m_globalObjects; 221 169 }; 222 170 223 } 171 } // namespace KJS 224 172 225 173 #endif
Note:
See TracChangeset
for help on using the changeset viewer.