Changeset 28468 in webkit for trunk/JavaScriptCore/kjs/debugger.cpp
- Timestamp:
- Dec 5, 2007, 6:31:41 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/debugger.cpp
r17372 r28468 32 32 33 33 namespace KJS { 34 struct Attached Interpreter34 struct AttachedGlobalObject 35 35 { 36 36 public: 37 Attached Interpreter(Interpreter *i, AttachedInterpreter *ai) : interp(i), next(ai) { ++Debugger::debuggersPresent; }38 ~Attached Interpreter() { --Debugger::debuggersPresent; }39 Interpreter *interp;40 Attached Interpreter *next;37 AttachedGlobalObject(JSGlobalObject* o, AttachedGlobalObject* ai) : globalObj(o), next(ai) { ++Debugger::debuggersPresent; } 38 ~AttachedGlobalObject() { --Debugger::debuggersPresent; } 39 JSGlobalObject* globalObj; 40 AttachedGlobalObject* next; 41 41 }; 42 42 … … 56 56 } 57 57 58 void Debugger::attach( Interpreter* interp)58 void Debugger::attach(JSGlobalObject* globalObject) 59 59 { 60 Debugger *other = interp->debugger();60 Debugger* other = globalObject->debugger(); 61 61 if (other == this) 62 62 return; 63 63 if (other) 64 other->detach( interp);65 interp->setDebugger(this);66 rep-> interps = new AttachedInterpreter(interp, rep->interps);64 other->detach(globalObject); 65 globalObject->setDebugger(this); 66 rep->globalObjects = new AttachedGlobalObject(globalObject, rep->globalObjects); 67 67 } 68 68 69 void Debugger::detach( Interpreter* interp)69 void Debugger::detach(JSGlobalObject* globalObj) 70 70 { 71 // iterate the addresses where Attached Interpreterpointers are stored71 // iterate the addresses where AttachedGlobalObject pointers are stored 72 72 // so we can unlink items from the list 73 Attached Interpreter **p = &rep->interps;74 Attached Interpreter*q;73 AttachedGlobalObject **p = &rep->globalObjects; 74 AttachedGlobalObject *q; 75 75 while ((q = *p)) { 76 if (! interp || q->interp == interp) {76 if (!globalObj || q->globalObj == globalObj) { 77 77 *p = q->next; 78 q-> interp->setDebugger(0);78 q->globalObj->setDebugger(0); 79 79 delete q; 80 80 } else … … 82 82 } 83 83 84 if ( interp)85 latestExceptions.remove( interp);84 if (globalObj) 85 latestExceptions.remove(globalObj); 86 86 else 87 87 latestExceptions.clear(); … … 90 90 bool Debugger::hasHandledException(ExecState *exec, JSValue *exception) 91 91 { 92 if (latestExceptions.get(exec->dynamic Interpreter()).get() == exception)92 if (latestExceptions.get(exec->dynamicGlobalObject()).get() == exception) 93 93 return true; 94 94 95 latestExceptions.set(exec->dynamic Interpreter(), exception);95 latestExceptions.set(exec->dynamicGlobalObject(), exception); 96 96 return false; 97 97 }
Note:
See TracChangeset
for help on using the changeset viewer.