Changeset 15593 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jul 23, 2006, 11:06:30 PM (19 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r15583 r15593 1 2006-07-23 Mark Rowe <[email protected]> 2 3 Reviewed by Maciej. 4 5 Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions 6 http://bugzilla.opendarwin.org/show_bug.cgi?id=9686 7 8 JavaScriptCore portion of the fix. 9 10 * JavaScriptCore.exp: Update symbol for change in argument type. 11 * kjs/debugger.cpp: 12 (Debugger::detach): Clear map of recent exceptions. 13 (Debugger::hasHandledException): Track the most recent exception 14 thrown by an interpreter. 15 (Debugger::exception): Change exception argument to a JSValue. 16 * kjs/debugger.h: 17 * kjs/nodes.cpp: 18 (Node::debugExceptionIfNeeded): Notify the debugger of an exception 19 if it hasn't seen it before. 20 (ThrowNode::execute): Notify the debugger that an exception is being thrown. 21 * kjs/nodes.h: 22 1 23 2006-07-23 Geoffrey Garen <[email protected]> 2 24 -
trunk/JavaScriptCore/JavaScriptCore.exp
r15557 r15593 194 194 __ZN3KJS8Debugger12sourceUnusedEPNS_9ExecStateEi 195 195 __ZN3KJS8Debugger6attachEPNS_11InterpreterE 196 __ZN3KJS8Debugger9exceptionEPNS_9ExecStateEiiPNS_ 8JSObjectE196 __ZN3KJS8Debugger9exceptionEPNS_9ExecStateEiiPNS_7JSValueE 197 197 __ZN3KJS8DebuggerC2Ev 198 198 __ZN3KJS8DebuggerD2Ev -
trunk/JavaScriptCore/kjs/debugger.cpp
r15026 r15593 81 81 p = &q->next; 82 82 } 83 84 if (interp) 85 latestExceptions.remove(interp); 86 else 87 latestExceptions.clear(); 88 } 89 90 bool Debugger::hasHandledException(ExecState *exec, JSValue *exception) 91 { 92 if (latestExceptions.get(exec->dynamicInterpreter()).get() == exception) 93 return true; 94 95 latestExceptions.set(exec->dynamicInterpreter(), exception); 96 return false; 83 97 } 84 98 … … 95 109 96 110 bool Debugger::exception(ExecState */*exec*/, int /*sourceId*/, int /*lineno*/, 97 JS Object */*exceptionObj*/)111 JSValue */*exception*/) 98 112 { 99 113 return true; -
trunk/JavaScriptCore/kjs/debugger.h
r15026 r15593 24 24 #define _KJSDEBUGGER_H_ 25 25 26 #include <wtf/HashMap.h> 27 #include "protect.h" 28 26 29 namespace KJS { 27 30 … … 30 33 class ExecState; 31 34 class JSObject; 35 class JSValue; 32 36 class UString; 33 37 class List; … … 145 149 */ 146 150 virtual bool exception(ExecState *exec, int sourceId, int lineno, 147 JSObject *exceptionObj); 151 JSValue *exception); 152 153 bool hasHandledException(ExecState *, JSValue *); 148 154 149 155 /** … … 210 216 private: 211 217 DebuggerImp *rep; 218 HashMap<Interpreter*, ProtectedPtr<JSValue> > latestExceptions; 212 219 213 220 public: -
trunk/JavaScriptCore/kjs/nodes.cpp
r15468 r15593 58 58 JSValue *ex = exec->exception(); \ 59 59 exec->clearException(); \ 60 debugExceptionIfNeeded(exec, ex); \ 60 61 return Completion(Throw, ex); \ 61 62 } \ … … 66 67 if (exec->hadException()) { \ 67 68 setExceptionDetailsIfNeeded(exec); \ 69 debugExceptionIfNeeded(exec, exec->exception()); \ 68 70 return jsUndefined(); \ 69 71 } \ … … 74 76 if (exec->hadException()) { \ 75 77 setExceptionDetailsIfNeeded(exec); \ 78 debugExceptionIfNeeded(exec, exec->exception()); \ 76 79 return List(); \ 77 80 } \ … … 267 270 exception->put(exec, "sourceURL", jsString(currentSourceURL(exec))); 268 271 } 272 } 273 } 274 275 void Node::debugExceptionIfNeeded(ExecState* exec, JSValue* exceptionValue) 276 { 277 Debugger* dbg = exec->dynamicInterpreter()->debugger(); 278 if (dbg && !dbg->hasHandledException(exec, exceptionValue)) { 279 bool cont = dbg->exception(exec, currentSourceId(exec), m_line, exceptionValue); 280 if (!cont) 281 dbg->imp()->abort(); 269 282 } 270 283 } … … 2270 2283 KJS_CHECKEXCEPTION 2271 2284 2285 debugExceptionIfNeeded(exec, v); 2286 2272 2287 return Completion(Throw, v); 2273 2288 } -
trunk/JavaScriptCore/kjs/nodes.h
r15468 r15593 110 110 111 111 void setExceptionDetailsIfNeeded(ExecState*); 112 void debugExceptionIfNeeded(ExecState*, JSValue*); 112 113 113 114 int m_line;
Note:
See TracChangeset
for help on using the changeset viewer.