OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 ensureDebuggerScriptCompiled(); | 161 ensureDebuggerScriptCompiled(); |
162 v8::HandleScope scope(m_isolate); | 162 v8::HandleScope scope(m_isolate); |
163 v8::Context::Scope contextScope(v8::Debug::GetDebugContext()); | 163 v8::Context::Scope contextScope(v8::Debug::GetDebugContext()); |
164 | 164 |
165 v8::Handle<v8::Value> argv[] = { v8::Int32::New(m_isolate, pauseOnExceptions State) }; | 165 v8::Handle<v8::Value> argv[] = { v8::Int32::New(m_isolate, pauseOnExceptions State) }; |
166 callDebuggerMethod("setPauseOnExceptionsState", 1, argv); | 166 callDebuggerMethod("setPauseOnExceptionsState", 1, argv); |
167 } | 167 } |
168 | 168 |
169 void ScriptDebugServer::setPauseOnNextStatement(bool pause) | 169 void ScriptDebugServer::setPauseOnNextStatement(bool pause) |
170 { | 170 { |
171 if (isPaused()) | 171 ASSERT(!isPaused()); |
172 return; | |
173 if (pause) | 172 if (pause) |
174 v8::Debug::DebugBreak(m_isolate); | 173 v8::Debug::DebugBreak(m_isolate); |
175 else | 174 else |
176 v8::Debug::CancelDebugBreak(m_isolate); | 175 v8::Debug::CancelDebugBreak(m_isolate); |
177 } | 176 } |
178 | 177 |
179 bool ScriptDebugServer::canBreakProgram() | 178 bool ScriptDebugServer::canBreakProgram() |
180 { | 179 { |
181 if (!m_breakpointsActivated) | 180 if (!m_breakpointsActivated) |
182 return false; | 181 return false; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
307 *error = toCoreStringWithUndefinedOrNullCheck(resultTuple->Get(1)); | 306 *error = toCoreStringWithUndefinedOrNullCheck(resultTuple->Get(1)); |
308 errorData = TypeBuilder::Debugger::SetScriptSourceError::create(); | 307 errorData = TypeBuilder::Debugger::SetScriptSourceError::create(); |
309 errorData->setCompileError(compileError); | 308 errorData->setCompileError(compileError); |
310 return false; | 309 return false; |
311 } | 310 } |
312 } | 311 } |
313 *error = "Unknown error."; | 312 *error = "Unknown error."; |
314 return false; | 313 return false; |
315 } | 314 } |
316 | 315 |
316 int ScriptDebugServer::frameCount() | |
317 { | |
318 v8::Handle<v8::Value> result; | |
319 if (m_executionState.IsEmpty()) { | |
320 v8::Handle<v8::Function> frameCountFunction = v8::Local<v8::Function>::C ast(m_debuggerScript.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "frameCo unt"))); | |
yurys
2014/06/03 13:19:43
AFAIU this branch is unused so I'd rather put an A
aandrey
2014/06/04 08:51:27
Done.
| |
321 result = v8::Debug::Call(frameCountFunction); | |
322 } else { | |
323 v8::Handle<v8::Value> argv[] = { m_executionState }; | |
324 result = callDebuggerMethod("frameCount", WTF_ARRAY_LENGTH(argv), argv); | |
325 } | |
326 if (result->IsInt32()) | |
327 return result->Int32Value(); | |
328 return 0; | |
329 } | |
330 | |
317 PassRefPtr<JavaScriptCallFrame> ScriptDebugServer::wrapCallFrames(int maximumLim it, ScopeInfoDetails scopeDetails) | 331 PassRefPtr<JavaScriptCallFrame> ScriptDebugServer::wrapCallFrames(int maximumLim it, ScopeInfoDetails scopeDetails) |
318 { | 332 { |
319 const int scopeBits = 2; | 333 const int scopeBits = 2; |
320 COMPILE_ASSERT(NoScopes < (1 << scopeBits), not_enough_bits_to_encode_ScopeI nfoDetails); | 334 COMPILE_ASSERT(NoScopes < (1 << scopeBits), not_enough_bits_to_encode_ScopeI nfoDetails); |
321 | 335 |
322 ASSERT(maximumLimit >= 0); | 336 ASSERT(maximumLimit >= 0); |
323 int data = (maximumLimit << scopeBits) | scopeDetails; | 337 int data = (maximumLimit << scopeBits) | scopeDetails; |
324 v8::Handle<v8::Value> currentCallFrameV8; | 338 v8::Handle<v8::Value> currentCallFrameV8; |
325 if (m_executionState.IsEmpty()) { | 339 if (m_executionState.IsEmpty()) { |
326 v8::Handle<v8::Function> currentCallFrameFunction = v8::Local<v8::Functi on>::Cast(m_debuggerScript.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "c urrentCallFrame"))); | 340 v8::Handle<v8::Function> currentCallFrameFunction = v8::Local<v8::Functi on>::Cast(m_debuggerScript.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "c urrentCallFrame"))); |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
618 { | 632 { |
619 return PassOwnPtr<ScriptSourceCode>(); | 633 return PassOwnPtr<ScriptSourceCode>(); |
620 } | 634 } |
621 | 635 |
622 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou rce, const String& url, const String& functionName) | 636 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou rce, const String& url, const String& functionName) |
623 { | 637 { |
624 return source; | 638 return source; |
625 } | 639 } |
626 | 640 |
627 } // namespace WebCore | 641 } // namespace WebCore |
OLD | NEW |