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 ASSERT(isPaused()); |
| 319 ASSERT(!m_executionState.IsEmpty()); |
| 320 v8::Handle<v8::Value> argv[] = { m_executionState }; |
| 321 v8::Handle<v8::Value> result = callDebuggerMethod("frameCount", WTF_ARRAY_LE
NGTH(argv), argv); |
| 322 if (result->IsInt32()) |
| 323 return result->Int32Value(); |
| 324 return 0; |
| 325 } |
| 326 |
317 PassRefPtr<JavaScriptCallFrame> ScriptDebugServer::wrapCallFrames(int maximumLim
it, ScopeInfoDetails scopeDetails) | 327 PassRefPtr<JavaScriptCallFrame> ScriptDebugServer::wrapCallFrames(int maximumLim
it, ScopeInfoDetails scopeDetails) |
318 { | 328 { |
319 const int scopeBits = 2; | 329 const int scopeBits = 2; |
320 COMPILE_ASSERT(NoScopes < (1 << scopeBits), not_enough_bits_to_encode_ScopeI
nfoDetails); | 330 COMPILE_ASSERT(NoScopes < (1 << scopeBits), not_enough_bits_to_encode_ScopeI
nfoDetails); |
321 | 331 |
322 ASSERT(maximumLimit >= 0); | 332 ASSERT(maximumLimit >= 0); |
323 int data = (maximumLimit << scopeBits) | scopeDetails; | 333 int data = (maximumLimit << scopeBits) | scopeDetails; |
324 v8::Handle<v8::Value> currentCallFrameV8; | 334 v8::Handle<v8::Value> currentCallFrameV8; |
325 if (m_executionState.IsEmpty()) { | 335 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"))); | 336 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 { | 628 { |
619 return PassOwnPtr<ScriptSourceCode>(); | 629 return PassOwnPtr<ScriptSourceCode>(); |
620 } | 630 } |
621 | 631 |
622 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou
rce, const String& url, const String& functionName) | 632 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou
rce, const String& url, const String& functionName) |
623 { | 633 { |
624 return source; | 634 return source; |
625 } | 635 } |
626 | 636 |
627 } // namespace WebCore | 637 } // namespace WebCore |
OLD | NEW |