Changeset 15593 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp


Ignore:
Timestamp:
Jul 23, 2006, 11:06:30 PM (19 years ago)
Author:
thatcher
Message:

JavaScriptCore:

Reviewed by Maciej.

Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
http://bugzilla.opendarwin.org/show_bug.cgi?id=9686

JavaScriptCore portion of the fix.

  • JavaScriptCore.exp: Update symbol for change in argument type.
  • kjs/debugger.cpp: (Debugger::detach): Clear map of recent exceptions. (Debugger::hasHandledException): Track the most recent exception thrown by an interpreter. (Debugger::exception): Change exception argument to a JSValue.
  • kjs/debugger.h:
  • kjs/nodes.cpp: (Node::debugExceptionIfNeeded): Notify the debugger of an exception if it hasn't seen it before. (ThrowNode::execute): Notify the debugger that an exception is being thrown.
  • kjs/nodes.h:

2006-07-23 Geoffrey Garen <[email protected]>

Patch by Eric Albert, reviewed by Darin and me.


  • Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code crashes (Collector::markStackObjectsConservatively)


  • bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an int. (JavaJSObject::getSlot): (JavaJSObject::setSlot):
  • kjs/collector.cpp: (KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned, and we want to scan the stack for pointers.
  • JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the XCode war has started up again!

WebCore:

Reviewed by maciej.

Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
http://bugzilla.opendarwin.org/show_bug.cgi?id=9686

WebCore portion of the fix.

  • bridge/mac/WebCoreScriptDebugger.h: (-[WebScriptDebugger exceptionRaised:sourceId:line::]): Add delegate method.
  • bridge/mac/WebCoreScriptDebugger.mm: (WebCoreScriptDebuggerImp::exception): Call delegate method when an exception is raised.

WebKit:

Reviewed by Maciej.

Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
http://bugzilla.opendarwin.org/show_bug.cgi?id=9686

WebKit portion of the fix.

  • DefaultDelegates/WebDefaultScriptDebugDelegate.m: (-[WebDefaultScriptDebugDelegate webView:exceptionWasRaised:sourceId:line:forWebFrame:]):
  • DefaultDelegates/WebScriptDebugServer.h:
  • DefaultDelegates/WebScriptDebugServer.m: (-[WebScriptDebugServer webView:exceptionWasRaised:sourceId:line:forWebFrame:]): Notify listeners that an exception has been raised.
  • WebView/WebScriptDebugDelegate.h:
  • WebView/WebScriptDebugDelegate.m: (-[WebScriptCallFrame exceptionRaised:sourceId:line:]): Dispatch through to delegate and WebScriptDebugServer.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r15468 r15593  
    5858    JSValue *ex = exec->exception(); \
    5959    exec->clearException(); \
     60    debugExceptionIfNeeded(exec, ex); \
    6061    return Completion(Throw, ex); \
    6162  } \
     
    6667  if (exec->hadException()) { \
    6768    setExceptionDetailsIfNeeded(exec); \
     69    debugExceptionIfNeeded(exec, exec->exception()); \
    6870    return jsUndefined(); \
    6971  } \
     
    7476  if (exec->hadException()) { \
    7577    setExceptionDetailsIfNeeded(exec); \
     78    debugExceptionIfNeeded(exec, exec->exception()); \
    7679    return List(); \
    7780  } \
     
    267270            exception->put(exec, "sourceURL", jsString(currentSourceURL(exec)));
    268271        }
     272    }
     273}
     274
     275void 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();
    269282    }
    270283}
     
    22702283  KJS_CHECKEXCEPTION
    22712284
     2285  debugExceptionIfNeeded(exec, v);
     2286
    22722287  return Completion(Throw, v);
    22732288}
Note: See TracChangeset for help on using the changeset viewer.