| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 "return "), | 431 "return "), |
| 432 expression); | 432 expression); |
| 433 expression = v8::String::Concat(expression, v8::String::New("} })")); | 433 expression = v8::String::Concat(expression, v8::String::New("} })")); |
| 434 | 434 |
| 435 v8::Handle<v8::Script> script = v8::Script::Compile(expression); | 435 v8::Handle<v8::Script> script = v8::Script::Compile(expression); |
| 436 if (script.IsEmpty()) // Return immediately in case of exception to let the
caller handle it. | 436 if (script.IsEmpty()) // Return immediately in case of exception to let the
caller handle it. |
| 437 return v8::Handle<v8::Value>(); | 437 return v8::Handle<v8::Value>(); |
| 438 v8::Debug::GetDebugContext()->Enter(); | 438 v8::Debug::GetDebugContext()->Enter(); |
| 439 v8::Handle<v8::Function> function = script->Run().As<v8::Function>(); | 439 v8::Handle<v8::Function> function = script->Run().As<v8::Function>(); |
| 440 v8::Debug::GetDebugContext()->Exit(); | 440 v8::Debug::GetDebugContext()->Exit(); |
| 441 Dart_ExceptionPauseInfo previousPauseInfo = Dart_GetExceptionPauseInfo(); | |
| 442 // FIXME: it is not clear this is the right long term solution but for now | |
| 443 // we prevent pausing on exceptions when executing an evaluate statement to | |
| 444 // avoid crashing debug dartium builds. | |
| 445 Dart_SetExceptionPauseInfo(kNoPauseOnExceptions); | |
| 446 v8::Handle<v8::Value> ret = function->Call(receiver, 2, scopes); | 441 v8::Handle<v8::Value> ret = function->Call(receiver, 2, scopes); |
| 447 Dart_SetExceptionPauseInfo(previousPauseInfo); | |
| 448 return ret; | 442 return ret; |
| 449 } | 443 } |
| 450 | 444 |
| 451 void DartDebugServer::ensureHooksInstalled() | 445 void DartDebugServer::ensureHooksInstalled() |
| 452 { | 446 { |
| 453 DEFINE_STATIC_LOCAL(bool, hooksInstalled, (false)); | 447 DEFINE_STATIC_LOCAL(bool, hooksInstalled, (false)); |
| 454 | 448 |
| 455 if (hooksInstalled) | 449 if (hooksInstalled) |
| 456 return; | 450 return; |
| 457 | 451 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 479 nativeCallbacks->Set(v8::String::New("getBreakpointLine"), v8::FunctionTempl
ate::New(&getBreakpointLine)->GetFunction()); | 473 nativeCallbacks->Set(v8::String::New("getBreakpointLine"), v8::FunctionTempl
ate::New(&getBreakpointLine)->GetFunction()); |
| 480 nativeCallbacks->Set(v8::String::New("setExceptionPauseInfo"), v8::FunctionT
emplate::New(&setExceptionPauseInfo)->GetFunction()); | 474 nativeCallbacks->Set(v8::String::New("setExceptionPauseInfo"), v8::FunctionT
emplate::New(&setExceptionPauseInfo)->GetFunction()); |
| 481 nativeCallbacks->Set(v8::String::New("stepInto"), v8::FunctionTemplate::New(
&stepInto)->GetFunction()); | 475 nativeCallbacks->Set(v8::String::New("stepInto"), v8::FunctionTemplate::New(
&stepInto)->GetFunction()); |
| 482 nativeCallbacks->Set(v8::String::New("stepOver"), v8::FunctionTemplate::New(
&stepOver)->GetFunction()); | 476 nativeCallbacks->Set(v8::String::New("stepOver"), v8::FunctionTemplate::New(
&stepOver)->GetFunction()); |
| 483 nativeCallbacks->Set(v8::String::New("stepOut"), v8::FunctionTemplate::New(&
stepOut)->GetFunction()); | 477 nativeCallbacks->Set(v8::String::New("stepOut"), v8::FunctionTemplate::New(&
stepOut)->GetFunction()); |
| 484 nativeCallbacks->Set(v8::String::New("evaluateInScope"), evaluateInScopeFunc
tion); | 478 nativeCallbacks->Set(v8::String::New("evaluateInScope"), evaluateInScopeFunc
tion); |
| 485 m_dartDebugObject.get()->Set(v8::String::New("nativeCallbacks"), nativeCallb
acks); | 479 m_dartDebugObject.get()->Set(v8::String::New("nativeCallbacks"), nativeCallb
acks); |
| 486 } | 480 } |
| 487 | 481 |
| 488 } | 482 } |
| OLD | NEW |