| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/debugger.h" | 5 #include "vm/debugger.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2388 ASSERT(obj_cache_ == NULL); | 2388 ASSERT(obj_cache_ == NULL); |
| 2389 if ((bpt != NULL) && bpt->IsSingleShot()) { | 2389 if ((bpt != NULL) && bpt->IsSingleShot()) { |
| 2390 RemoveBreakpoint(bpt->id()); | 2390 RemoveBreakpoint(bpt->id()); |
| 2391 bpt = NULL; | 2391 bpt = NULL; |
| 2392 } | 2392 } |
| 2393 | 2393 |
| 2394 DebuggerEvent event(isolate_, DebuggerEvent::kBreakpointReached); | 2394 DebuggerEvent event(isolate_, DebuggerEvent::kBreakpointReached); |
| 2395 event.set_top_frame(top_frame); | 2395 event.set_top_frame(top_frame); |
| 2396 event.set_breakpoint(bpt); | 2396 event.set_breakpoint(bpt); |
| 2397 Object& closure_or_null = Object::Handle(top_frame->GetAsyncOperation()); | 2397 Object& closure_or_null = Object::Handle(top_frame->GetAsyncOperation()); |
| 2398 event.set_async_continuation(&closure_or_null); | 2398 if (!closure_or_null.IsNull()) { |
| 2399 event.set_async_continuation(&closure_or_null); |
| 2400 const Script& script = Script::Handle(top_frame->SourceScript()); |
| 2401 const TokenStream& tokens = TokenStream::Handle(script.tokens()); |
| 2402 TokenStream::Iterator iter(tokens, top_frame->TokenPos()); |
| 2403 if ((iter.CurrentTokenKind() == Token::kIDENT) && |
| 2404 ((iter.CurrentLiteral() == Symbols::Await().raw()) || |
| 2405 (iter.CurrentLiteral() == Symbols::YieldKw().raw()))) { |
| 2406 event.set_at_async_jump(true); |
| 2407 } |
| 2408 } |
| 2399 Pause(&event); | 2409 Pause(&event); |
| 2400 } | 2410 } |
| 2401 | 2411 |
| 2402 | 2412 |
| 2403 void Debugger::DebuggerStepCallback() { | 2413 void Debugger::DebuggerStepCallback() { |
| 2404 ASSERT(isolate_->single_step()); | 2414 ASSERT(isolate_->single_step()); |
| 2405 // We can't get here unless the debugger event handler enabled | 2415 // We can't get here unless the debugger event handler enabled |
| 2406 // single stepping. | 2416 // single stepping. |
| 2407 ASSERT(HasEventHandler()); | 2417 ASSERT(HasEventHandler()); |
| 2408 // Don't pause recursively. | 2418 // Don't pause recursively. |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3008 } | 3018 } |
| 3009 | 3019 |
| 3010 | 3020 |
| 3011 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 3021 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 3012 ASSERT(bpt->next() == NULL); | 3022 ASSERT(bpt->next() == NULL); |
| 3013 bpt->set_next(code_breakpoints_); | 3023 bpt->set_next(code_breakpoints_); |
| 3014 code_breakpoints_ = bpt; | 3024 code_breakpoints_ = bpt; |
| 3015 } | 3025 } |
| 3016 | 3026 |
| 3017 } // namespace dart | 3027 } // namespace dart |
| OLD | NEW |