summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/ScriptDebugServer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/v8/ScriptDebugServer.cpp')
-rw-r--r--WebCore/bindings/v8/ScriptDebugServer.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/WebCore/bindings/v8/ScriptDebugServer.cpp b/WebCore/bindings/v8/ScriptDebugServer.cpp
index 38fcd8a..8553ee5 100644
--- a/WebCore/bindings/v8/ScriptDebugServer.cpp
+++ b/WebCore/bindings/v8/ScriptDebugServer.cpp
@@ -126,7 +126,7 @@ void ScriptDebugServer::removeListener(ScriptDebugListener* listener, Page* page
// FIXME: Remove all breakpoints set by the agent.
}
-void ScriptDebugServer::setBreakpoint(const String& sourceID, unsigned lineNumber, ScriptBreakpoint breakpoint)
+bool ScriptDebugServer::setBreakpoint(const String& sourceID, ScriptBreakpoint breakpoint, unsigned lineNumber, unsigned* actualLineNumber)
{
#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
v8::HandleScope scope;
@@ -140,7 +140,14 @@ void ScriptDebugServer::setBreakpoint(const String& sourceID, unsigned lineNumbe
args->Set(v8::String::New("enabled"), v8::Boolean::New(breakpoint.enabled));
v8::Handle<v8::Function> setBreakpointFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("setBreakpoint")));
- v8::Debug::Call(setBreakpointFunction, args);
+ v8::Handle<v8::Value> result = v8::Debug::Call(setBreakpointFunction, args);
+ if (!result->IsNumber())
+ return false;
+ ASSERT(result->Int32Value() >= 0);
+ *actualLineNumber = result->Int32Value();
+ return true;
+#else
+ return false;
#endif
}
@@ -299,7 +306,7 @@ PassRefPtr<JavaScriptCallFrame> ScriptDebugServer::currentCallFrame()
v8::Handle<v8::Function> currentCallFrameFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("currentCallFrame")));
v8::Handle<v8::Value> argv[] = { m_executionState.get() };
v8::Handle<v8::Value> currentCallFrameV8 = currentCallFrameFunction->Call(m_debuggerScript.get(), 1, argv);
- m_currentCallFrame = JavaScriptCallFrame::create(v8::Debug::GetDebugContext(), v8::Handle<v8::Object>::Cast(currentCallFrameV8));
+ m_currentCallFrame = JavaScriptCallFrame::create(v8::Debug::GetDebugContext(), v8::Handle<v8::Object>::Cast(currentCallFrameV8));
}
return m_currentCallFrame;
}