Changeset 85035 in webkit
- Timestamp:
- Apr 27, 2011 1:55:09 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r85034 r85035 1 2011-04-26 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: [protocol] Paused event should expose exception value that caused it 6 https://bugs.webkit.org/show_bug.cgi?id=58996 7 8 Debug.pause event now contains an optional reference to the exception 9 object in case script execution is paused on a JavaScript exception. 10 11 Also JavaScript call frames are passed directly into the injected script when 12 we need to wrap them for passing to the front-end. This change breaks cyclic 13 dependency ScriptDebugServer->InspectorDebuggerAgent->InjectedScript->InjectedScriptHost->ScriptDebugServer 14 15 * bindings/js/JSInjectedScriptHostCustom.cpp: 16 * bindings/js/ScriptDebugServer.cpp: 17 (WebCore::ScriptDebugServer::dispatchDidPause): 18 * bindings/js/ScriptDebugServer.h: 19 * bindings/v8/ScriptDebugServer.cpp: 20 (WebCore::ScriptDebugServer::breakProgram): 21 (WebCore::ScriptDebugServer::editScriptSource): 22 (WebCore::ScriptDebugServer::breakProgramCallback): 23 (WebCore::ScriptDebugServer::handleV8DebugEvent): 24 * bindings/v8/ScriptDebugServer.h: 25 * bindings/v8/custom/V8InjectedScriptHostCustom.cpp: 26 * inspector/InjectedScript.cpp: 27 (WebCore::InjectedScript::evaluateOnCallFrame): 28 (WebCore::InjectedScript::wrapCallFrames): 29 * inspector/InjectedScript.h: 30 * inspector/InjectedScriptHost.cpp: 31 * inspector/InjectedScriptHost.h: 32 (WebCore::InjectedScriptHost::init): 33 * inspector/InjectedScriptHost.idl: 34 * inspector/InjectedScriptSource.js: 35 (.): 36 * inspector/Inspector.json: 37 * inspector/InspectorAgent.cpp: 38 (WebCore::InspectorAgent::InspectorAgent): 39 * inspector/InspectorDebuggerAgent.cpp: 40 (WebCore::InspectorDebuggerAgent::evaluateOnCallFrame): 41 (WebCore::InspectorDebuggerAgent::currentCallFrames): 42 (WebCore::InspectorDebuggerAgent::wrapCallFrames): 43 (WebCore::InspectorDebuggerAgent::didPause): 44 (WebCore::InspectorDebuggerAgent::didContinue): 45 (WebCore::InspectorDebuggerAgent::clear): 46 * inspector/InspectorDebuggerAgent.h: 47 * inspector/ScriptDebugListener.h: 48 * inspector/WorkerInspectorController.cpp: 49 (WebCore::WorkerInspectorController::WorkerInspectorController): 50 1 51 2011-04-27 Pavel Feldman <pfeldman@google.com> 2 52 -
trunk/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
r84641 r85035 52 52 #include <runtime/JSLock.h> 53 53 54 #if ENABLE(JAVASCRIPT_DEBUGGER)55 #include "JavaScriptCallFrame.h"56 #include "JSJavaScriptCallFrame.h"57 #include "ScriptDebugServer.h"58 #endif59 60 54 using namespace JSC; 61 55 … … 73 67 JSLock lock(SilenceAssertionsOnly); 74 68 return ScriptValue(state->globalData(), toJS(state, deprecatedGlobalObjectForPrototype(state), node)); 75 }76 77 JSValue JSInjectedScriptHost::currentCallFrame(ExecState* exec)78 {79 #if ENABLE(JAVASCRIPT_DEBUGGER)80 JavaScriptCallFrame* callFrame = impl()->debuggerAgent()->scriptDebugServer().currentCallFrame();81 if (!callFrame || !callFrame->isValid())82 return jsUndefined();83 84 JSLock lock(SilenceAssertionsOnly);85 return toJS(exec, globalObject(), callFrame);86 #else87 UNUSED_PARAM(exec);88 return jsUndefined();89 #endif90 69 } 91 70 -
trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp
r84371 r85035 35 35 #include "EventLoop.h" 36 36 #include "Frame.h" 37 #include "JSJavaScriptCallFrame.h" 37 38 #include "JavaScriptCallFrame.h" 38 39 #include "ScriptBreakpoint.h" … … 189 190 } 190 191 191 bool ScriptDebugServer::editScriptSource(const String&, const String&, String* )192 bool ScriptDebugServer::editScriptSource(const String&, const String&, String*, ScriptValue*) 192 193 { 193 194 // FIXME(40300): implement this. … … 195 196 } 196 197 197 JavaScriptCallFrame* ScriptDebugServer::currentCallFrame()198 {199 if (!m_paused)200 return 0;201 return m_currentCallFrame.get();202 }203 204 198 void ScriptDebugServer::dispatchDidPause(ScriptDebugListener* listener) 205 199 { 206 200 ASSERT(m_paused); 207 ScriptState* state = m_currentCallFrame->scopeChain()->globalObject->globalExec(); 208 listener->didPause(state); 201 JSGlobalObject* globalObject = m_currentCallFrame->scopeChain()->globalObject.get(); 202 ScriptState* state = globalObject->globalExec(); 203 JSValue jsCallFrame; 204 { 205 if (m_currentCallFrame->isValid() && globalObject->inherits(&JSDOMGlobalObject::s_info)) { 206 JSDOMGlobalObject* domGlobalObject = static_cast<JSDOMGlobalObject*>(globalObject); 207 JSLock lock(SilenceAssertionsOnly); 208 jsCallFrame = toJS(state, domGlobalObject, m_currentCallFrame.get()); 209 } else 210 jsCallFrame = jsUndefined(); 211 } 212 listener->didPause(state, ScriptValue(state->globalData(), jsCallFrame), ScriptValue()); 209 213 } 210 214 -
trunk/Source/WebCore/bindings/js/ScriptDebugServer.h
r83601 r85035 51 51 namespace WebCore { 52 52 53 class JavaScriptCallFrame; 53 54 class ScriptDebugListener; 54 class JavaScriptCallFrame;55 class ScriptValue; 55 56 56 57 class ScriptDebugServer : protected JSC::Debugger { … … 79 80 void stepOutOfFunction(); 80 81 81 bool editScriptSource(const String& sourceID, const String& newContent, String* error );82 bool editScriptSource(const String& sourceID, const String& newContent, String* error, ScriptValue* newCallFrames); 82 83 83 84 void recompileAllJSFunctionsSoon(); 84 85 virtual void recompileAllJSFunctions(Timer<ScriptDebugServer>* = 0) = 0; 85 86 JavaScriptCallFrame* currentCallFrame();87 86 88 87 protected: -
trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp
r84890 r85035 38 38 #include "ScriptDebugListener.h" 39 39 #include "V8Binding.h" 40 #include "V8JavaScriptCallFrame.h" 40 41 #include <wtf/StdLibExtras.h> 41 42 … … 171 172 return; 172 173 173 m_paused PageContext = *context;174 m_pausedContext = *context; 174 175 v8::Handle<v8::Function> breakProgramFunction = m_breakProgramCallbackTemplate.get()->GetFunction(); 175 176 v8::Debug::Call(breakProgramFunction); 176 m_paused PageContext.Clear();177 m_pausedContext.Clear(); 177 178 } 178 179 … … 181 182 if (isPaused()) 182 183 quitMessageLoopOnPause(); 183 m_currentCallFrame.clear();184 184 m_executionState.clear(); 185 185 } … … 212 212 } 213 213 214 bool ScriptDebugServer::editScriptSource(const String& sourceID, const String& newContent, String* error )214 bool ScriptDebugServer::editScriptSource(const String& sourceID, const String& newContent, String* error, ScriptValue* newCallFrames) 215 215 { 216 216 ensureDebuggerScriptCompiled(); … … 238 238 239 239 // Call stack may have changed after if the edited function was on the stack. 240 if ( m_currentCallFrame)241 m_currentCallFrame.clear();240 if (isPaused()) 241 *newCallFrames = currentCallFrame(); 242 242 return true; 243 243 } 244 244 245 PassRefPtr<JavaScriptCallFrame>ScriptDebugServer::currentCallFrame()246 { 247 if (!m_currentCallFrame) {248 249 250 251 m_currentCallFrame = JavaScriptCallFrame::create(v8::Debug::GetDebugContext(), v8::Handle<v8::Object>::Cast(currentCallFrameV8));252 }253 return m_currentCallFrame;245 ScriptValue ScriptDebugServer::currentCallFrame() 246 { 247 ASSERT(isPaused()); 248 v8::Handle<v8::Function> currentCallFrameFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("currentCallFrame"))); 249 v8::Handle<v8::Value> argv[] = { m_executionState.get() }; 250 v8::Handle<v8::Value> currentCallFrameV8 = currentCallFrameFunction->Call(m_debuggerScript.get(), 1, argv); 251 RefPtr<JavaScriptCallFrame> currentCallFrame = JavaScriptCallFrame::create(v8::Debug::GetDebugContext(), v8::Handle<v8::Object>::Cast(currentCallFrameV8)); 252 v8::Context::Scope contextScope(m_pausedContext); 253 return ScriptValue(toV8(currentCallFrame.release())); 254 254 } 255 255 … … 275 275 276 276 ScriptDebugServer* thisPtr = toScriptDebugServer(args.Data()); 277 thisPtr->breakProgram(v8::Handle<v8::Object>::Cast(args[0])); 277 v8::Handle<v8::Value> exception; 278 thisPtr->breakProgram(v8::Handle<v8::Object>::Cast(args[0]), exception); 278 279 return v8::Undefined(); 279 280 } 280 281 281 void ScriptDebugServer::breakProgram(v8::Handle<v8::Object> executionState )282 void ScriptDebugServer::breakProgram(v8::Handle<v8::Object> executionState, v8::Handle<v8::Value> exception) 282 283 { 283 284 // Don't allow nested breaks. … … 285 286 return; 286 287 287 ScriptDebugListener* listener = getDebugListenerForContext(m_paused PageContext);288 ScriptDebugListener* listener = getDebugListenerForContext(m_pausedContext); 288 289 if (!listener) 289 290 return; 290 291 291 292 m_executionState.set(executionState); 292 ScriptState* currentCallFrameState = ScriptState::forContext(m_paused PageContext);293 listener->didPause(currentCallFrameState );294 295 runMessageLoopOnPause(m_paused PageContext);293 ScriptState* currentCallFrameState = ScriptState::forContext(m_pausedContext); 294 listener->didPause(currentCallFrameState, currentCallFrame(), ScriptValue(exception)); 295 296 runMessageLoopOnPause(m_pausedContext); 296 297 } 297 298 … … 330 331 dispatchDidParseSource(listener, object); 331 332 } else if (event == v8::Break || event == v8::Exception) { 333 v8::Handle<v8::Value> exception; 332 334 if (event == v8::Exception) { 333 335 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(1); … … 335 337 if (!stackTrace->GetFrameCount()) 336 338 return; 339 v8::Handle<v8::Object> eventData = eventDetails.GetEventData(); 340 v8::Handle<v8::Value> exceptionGetterValue = eventData->Get(v8::String::New("exception")); 341 ASSERT(!exceptionGetterValue.IsEmpty() && exceptionGetterValue->IsFunction()); 342 v8::Handle<v8::Value> argv[] = { v8::Handle<v8::Value>() }; 343 exception = v8::Handle<v8::Function>::Cast(exceptionGetterValue)->Call(eventData, 0, argv); 337 344 } 338 345 339 m_paused PageContext = *eventContext;340 breakProgram(eventDetails.GetExecutionState() );341 m_paused PageContext.Clear();346 m_pausedContext = *eventContext; 347 breakProgram(eventDetails.GetExecutionState(), exception); 348 m_pausedContext.Clear(); 342 349 } 343 350 } -
trunk/Source/WebCore/bindings/v8/ScriptDebugServer.h
r82590 r85035 34 34 #if ENABLE(JAVASCRIPT_DEBUGGER) 35 35 36 #include " JavaScriptCallFrame.h"36 #include "OwnHandle.h" 37 37 #include "PlatformString.h" 38 38 #include "ScriptBreakpoint.h" … … 47 47 48 48 class ScriptDebugListener; 49 class ScriptValue; 49 50 50 51 class ScriptDebugServer { … … 73 74 void stepOutOfFunction(); 74 75 75 bool editScriptSource(const String& sourceID, const String& newContent, String* error );76 bool editScriptSource(const String& sourceID, const String& newContent, String* error, ScriptValue* newCallFrames); 76 77 77 78 void recompileAllJSFunctionsSoon() { } 78 79 void recompileAllJSFunctions(Timer<ScriptDebugServer>* = 0) { } 79 80 PassRefPtr<JavaScriptCallFrame> currentCallFrame();81 80 82 81 class Task { … … 92 91 ~ScriptDebugServer() { } 93 92 93 ScriptValue currentCallFrame(); 94 94 95 virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Context>) = 0; 95 96 virtual void runMessageLoopOnPause(v8::Handle<v8::Context>) = 0; … … 97 98 98 99 static v8::Handle<v8::Value> breakProgramCallback(const v8::Arguments& args); 99 void breakProgram(v8::Handle<v8::Object> executionState );100 void breakProgram(v8::Handle<v8::Object> executionState, v8::Handle<v8::Value> exception); 100 101 101 102 static void v8DebugEventCallback(const v8::Debug::EventDetails& eventDetails); … … 110 111 PauseOnExceptionsState m_pauseOnExceptionsState; 111 112 OwnHandle<v8::Object> m_debuggerScript; 112 RefPtr<JavaScriptCallFrame> m_currentCallFrame;113 113 OwnHandle<v8::Object> m_executionState; 114 v8::Local<v8::Context> m_paused PageContext;114 v8::Local<v8::Context> m_pausedContext; 115 115 116 116 bool m_breakpointsActivated; -
trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
r82449 r85035 35 35 #include "InjectedScript.h" 36 36 #include "InjectedScriptHost.h" 37 #include "InspectorDebuggerAgent.h"38 37 #include "InspectorValues.h" 39 #include "ScriptDebugServer.h"40 38 #include "ScriptValue.h" 41 39 #include "V8Binding.h" … … 43 41 #include "V8Database.h" 44 42 #include "V8HiddenPropertyName.h" 45 #include "V8JavaScriptCallFrame.h"46 43 #include "V8Node.h" 47 44 #include "V8Proxy.h" … … 107 104 } 108 105 109 v8::Handle<v8::Value> V8InjectedScriptHost::currentCallFrameCallback(const v8::Arguments& args)110 {111 #if ENABLE(JAVASCRIPT_DEBUGGER)112 INC_STATS("InjectedScriptHost.currentCallFrame()");113 InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder());114 return toV8(host->debuggerAgent()->scriptDebugServer().currentCallFrame());115 #else116 UNUSED_PARAM(args);117 return v8::Undefined();118 #endif119 }120 121 106 v8::Handle<v8::Value> V8InjectedScriptHost::databaseIdCallback(const v8::Arguments& args) 122 107 { -
trunk/Source/WebCore/inspector/InjectedScript.cpp
r82803 r85035 72 72 } 73 73 74 void InjectedScript::evaluateOnCallFrame(ErrorString* errorString, const S tring& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorObject>* result)74 void InjectedScript::evaluateOnCallFrame(ErrorString* errorString, const ScriptValue& callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorObject>* result) 75 75 { 76 76 ScriptFunctionCall function(m_injectedScriptObject, "evaluateOnCallFrame"); 77 function.appendArgument(callFrames); 77 78 function.appendArgument(callFrameId); 78 79 function.appendArgument(expression); … … 132 133 133 134 #if ENABLE(JAVASCRIPT_DEBUGGER) 134 PassRefPtr<InspectorArray> InjectedScript::callFrames() 135 { 136 ASSERT(!hasNoValue()); 137 ScriptFunctionCall function(m_injectedScriptObject, "callFrames"); 135 PassRefPtr<InspectorArray> InjectedScript::wrapCallFrames(const ScriptValue& callFrames) 136 { 137 ASSERT(!hasNoValue()); 138 ScriptFunctionCall function(m_injectedScriptObject, "wrapCallFrames"); 139 function.appendArgument(callFrames); 138 140 ScriptValue callFramesValue = function.call(); 139 141 RefPtr<InspectorValue> result = callFramesValue.toInspectorValue(m_injectedScriptObject.scriptState()); -
trunk/Source/WebCore/inspector/InjectedScript.h
r82803 r85035 58 58 void evaluate(ErrorString*, const String& expression, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorObject>* result); 59 59 void evaluateOn(ErrorString*, const String& objectId, const String& expression, RefPtr<InspectorObject>* result); 60 void evaluateOnCallFrame(ErrorString*, const S tring& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorObject>* result);60 void evaluateOnCallFrame(ErrorString*, const ScriptValue& callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorObject>* result); 61 61 void getProperties(ErrorString*, const String& objectId, bool ignoreHasOwnProperty, RefPtr<InspectorArray>* result); 62 62 Node* nodeForObjectId(const String& objectId); … … 65 65 66 66 #if ENABLE(JAVASCRIPT_DEBUGGER) 67 PassRefPtr<InspectorArray> callFrames();67 PassRefPtr<InspectorArray> wrapCallFrames(const ScriptValue&); 68 68 #endif 69 69 -
trunk/Source/WebCore/inspector/InjectedScriptHost.cpp
r81572 r85035 47 47 #include "InspectorValues.h" 48 48 #include "Pasteboard.h" 49 50 #if ENABLE(JAVASCRIPT_DEBUGGER)51 #include "ScriptDebugServer.h"52 #endif53 49 54 50 #if ENABLE(DATABASE) -
trunk/Source/WebCore/inspector/InjectedScriptHost.h
r82449 r85035 48 48 class InspectorDOMStorageAgent; 49 49 class InspectorDatabaseAgent; 50 class InspectorDebuggerAgent;51 50 class InspectorFrontend; 52 51 class InspectorObject; … … 70 69 , InspectorDOMStorageAgent* domStorageAgent 71 70 #endif 72 #if ENABLE(JAVASCRIPT_DEBUGGER)73 , InspectorDebuggerAgent* debuggerAgent74 #endif75 71 ) 76 72 { … … 82 78 #if ENABLE(DOM_STORAGE) 83 79 m_domStorageAgent = domStorageAgent; 84 #endif85 #if ENABLE(JAVASCRIPT_DEBUGGER)86 m_debuggerAgent = debuggerAgent;87 80 #endif 88 81 } … … 113 106 void didDestroyWorker(long id); 114 107 #endif 115 #if ENABLE(JAVASCRIPT_DEBUGGER)116 InspectorDebuggerAgent* debuggerAgent() { return m_debuggerAgent; }117 #endif118 108 119 109 private: … … 128 118 InspectorDOMStorageAgent* m_domStorageAgent; 129 119 #endif 130 #if ENABLE(JAVASCRIPT_DEBUGGER)131 InspectorDebuggerAgent* m_debuggerAgent;132 #endif133 120 InspectorFrontend* m_frontend; 134 121 long m_lastWorkerId; -
trunk/Source/WebCore/inspector/InjectedScriptHost.idl
r81572 r85035 40 40 [Custom] DOMObject internalConstructorName(in DOMObject object); 41 41 42 [Custom] DOMObject currentCallFrame();43 42 [Custom] int databaseId(in DOMObject database); 44 43 [Custom] int storageId(in DOMObject storage); -
trunk/Source/WebCore/inspector/InjectedScriptSource.js
r84351 r85035 294 294 }, 295 295 296 callFrames: function() 297 { 298 var callFrame = InjectedScriptHost.currentCallFrame(); 296 wrapCallFrames: function(callFrame) 297 { 299 298 if (!callFrame) 300 299 return false; … … 309 308 }, 310 309 311 evaluateOnCallFrame: function( callFrameId, expression, objectGroup, injectCommandLineAPI)312 { 313 var callFrame = this._callFrameForId( callFrameId);310 evaluateOnCallFrame: function(topCallFrame, callFrameId, expression, objectGroup, injectCommandLineAPI) 311 { 312 var callFrame = this._callFrameForId(topCallFrame, callFrameId); 314 313 if (!callFrame) 315 314 return "Could not find call frame with given id"; … … 317 316 }, 318 317 319 _callFrameForId: function( callFrameId)318 _callFrameForId: function(topCallFrame, callFrameId) 320 319 { 321 320 var parsedCallFrameId = eval("(" + callFrameId + ")"); 322 321 var ordinal = parsedCallFrameId.ordinal; 323 var callFrame = InjectedScriptHost.currentCallFrame();322 var callFrame = topCallFrame; 324 323 while (--ordinal >= 0 && callFrame) 325 324 callFrame = callFrame.caller; -
trunk/Source/WebCore/inspector/Inspector.json
r84905 r85035 1502 1502 "type": "object", 1503 1503 "properties": [ 1504 { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "Call stack the virtual machine stopped on." } 1504 { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "Call stack the virtual machine stopped on." }, 1505 { "name": "exception", "$ref": "Runtime.RemoteObject", "optional": true, "description": "Current exception object if script execution is paused when an exception is being thrown." } 1505 1506 ], 1506 1507 "description": "Call stack information." -
trunk/Source/WebCore/inspector/InspectorAgent.cpp
r84905 r85035 153 153 , m_domStorageAgent.get() 154 154 #endif 155 #if ENABLE(JAVASCRIPT_DEBUGGER)156 , m_debuggerAgent.get()157 #endif158 155 ); 159 156 } -
trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
r83706 r85035 40 40 #include "PlatformString.h" 41 41 #include "ScriptDebugServer.h" 42 #include "ScriptObject.h" 42 43 #include <wtf/text/StringConcatenate.h> 43 44 … … 280 281 void InspectorDebuggerAgent::editScriptSource(ErrorString* error, const String& sourceID, const String& newContent, RefPtr<InspectorArray>* newCallFrames) 281 282 { 282 if (scriptDebugServer().editScriptSource(sourceID, newContent, error ))283 if (scriptDebugServer().editScriptSource(sourceID, newContent, error, &m_currentCallStack)) 283 284 *newCallFrames = currentCallFrames(); 284 285 } … … 356 357 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(callFrameId); 357 358 if (!injectedScript.hasNoValue()) 358 injectedScript.evaluateOnCallFrame(errorString, callFrameId, expression, objectGroup ? *objectGroup : "", includeCommandLineAPI ? *includeCommandLineAPI : false, result);359 injectedScript.evaluateOnCallFrame(errorString, m_currentCallStack, callFrameId, expression, objectGroup ? *objectGroup : "", includeCommandLineAPI ? *includeCommandLineAPI : false, result); 359 360 } 360 361 … … 368 369 return InspectorArray::create(); 369 370 } 370 return injectedScript. callFrames();371 return injectedScript.wrapCallFrames(m_currentCallStack); 371 372 } 372 373 … … 405 406 } 406 407 407 void InspectorDebuggerAgent::didPause(ScriptState* scriptState )408 void InspectorDebuggerAgent::didPause(ScriptState* scriptState, const ScriptValue& callFrames, const ScriptValue& exception) 408 409 { 409 410 ASSERT(scriptState && !m_pausedScriptState); 410 411 m_pausedScriptState = scriptState; 412 m_currentCallStack = callFrames; 411 413 412 414 if (!m_breakProgramDetails) … … 414 416 m_breakProgramDetails->setValue("callFrames", currentCallFrames()); 415 417 418 if (!exception.hasNoValue()) { 419 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(scriptState); 420 if (!injectedScript.hasNoValue()) 421 m_breakProgramDetails->setValue("exception", injectedScript.wrapObject(exception, "backtrace")); 422 } 423 416 424 m_frontend->paused(m_breakProgramDetails); 417 425 m_javaScriptPauseScheduled = false; … … 426 434 { 427 435 m_pausedScriptState = 0; 436 m_currentCallStack = ScriptValue(); 428 437 m_breakProgramDetails = 0; 429 438 m_frontend->resumed(); … … 441 450 { 442 451 m_pausedScriptState = 0; 452 m_currentCallStack = ScriptValue(); 443 453 m_scripts.clear(); 444 454 m_breakpointIdToDebugServerBreakpointIds.clear(); -
trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h
r83706 r85035 54 54 class InstrumentingAgents; 55 55 class ScriptDebugServer; 56 class ScriptValue; 56 57 57 58 typedef String ErrorString; … … 122 123 virtual void didParseSource(const String& sourceID, const String& url, const String& data, int lineOffset, int columnOffset, bool isContentScript); 123 124 virtual void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage); 124 virtual void didPause(ScriptState* );125 virtual void didPause(ScriptState*, const ScriptValue& callFrames, const ScriptValue& exception); 125 126 virtual void didContinue(); 126 127 … … 161 162 InspectorFrontend::Debugger* m_frontend; 162 163 ScriptState* m_pausedScriptState; 164 ScriptValue m_currentCallStack; 163 165 ScriptsMap m_scripts; 164 166 BreakpointIdToDebugServerBreakpointIdsMap m_breakpointIdToDebugServerBreakpointIds; -
trunk/Source/WebCore/inspector/ScriptDebugListener.h
r83601 r85035 37 37 38 38 namespace WebCore { 39 class ScriptValue; 39 40 40 41 class ScriptDebugListener { … … 44 45 virtual void didParseSource(const String& sourceID, const String& url, const String& data, int lineOffset, int columnOffset, bool isContentScript) = 0; 45 46 virtual void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage) = 0; 46 virtual void didPause(ScriptState* ) = 0;47 virtual void didPause(ScriptState*, const ScriptValue& callFrames, const ScriptValue& exception) = 0; 47 48 virtual void didContinue() = 0; 48 49 }; -
trunk/Source/WebCore/inspector/WorkerInspectorController.cpp
r84892 r85035 87 87 , 0 88 88 #endif 89 #if ENABLE(JAVASCRIPT_DEBUGGER)90 , m_debuggerAgent.get()91 #endif92 89 ); 93 90 }
Note: See TracChangeset
for help on using the changeset viewer.