Chromium Code Reviews| 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 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1538 if (lowest_pc_index >= 0) { | 1538 if (lowest_pc_index >= 0) { |
| 1539 // We found the pc descriptor that has the lowest execution address. | 1539 // We found the pc descriptor that has the lowest execution address. |
| 1540 // This is the first possible breakpoint after the requested token | 1540 // This is the first possible breakpoint after the requested token |
| 1541 // position. We use this instead of the nearest PC descriptor | 1541 // position. We use this instead of the nearest PC descriptor |
| 1542 // measured in token index distance. | 1542 // measured in token index distance. |
| 1543 best_fit_index = lowest_pc_index; | 1543 best_fit_index = lowest_pc_index; |
| 1544 } | 1544 } |
| 1545 if (best_fit_index >= 0) { | 1545 if (best_fit_index >= 0) { |
| 1546 return desc.TokenPos(best_fit_index); | 1546 return desc.TokenPos(best_fit_index); |
| 1547 } | 1547 } |
| 1548 // We didn't find a safe point in the given token range. Try and find | |
| 1549 // a safe point in the remaining source code of the function. | |
| 1550 if (last_token_pos < func.end_token_pos()) { | |
|
Ivan Posva
2014/05/02 04:58:56
This looks a bit strange to me. First we start by
| |
| 1551 return ResolveBreakpointPos(func, last_token_pos, func.end_token_pos()); | |
| 1552 } | |
| 1548 return -1; | 1553 return -1; |
| 1549 } | 1554 } |
| 1550 | 1555 |
| 1551 | 1556 |
| 1552 void Debugger::MakeCodeBreakpointAt(const Function& func, | 1557 void Debugger::MakeCodeBreakpointAt(const Function& func, |
| 1553 SourceBreakpoint* bpt) { | 1558 SourceBreakpoint* bpt) { |
| 1554 ASSERT((bpt != NULL) && bpt->IsResolved()); | 1559 ASSERT((bpt != NULL) && bpt->IsResolved()); |
| 1555 ASSERT(!func.HasOptimizedCode()); | 1560 ASSERT(!func.HasOptimizedCode()); |
| 1556 Code& code = Code::Handle(func.unoptimized_code()); | 1561 Code& code = Code::Handle(func.unoptimized_code()); |
| 1557 ASSERT(!code.IsNull()); | 1562 ASSERT(!code.IsNull()); |
| (...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2528 } | 2533 } |
| 2529 | 2534 |
| 2530 | 2535 |
| 2531 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 2536 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 2532 ASSERT(bpt->next() == NULL); | 2537 ASSERT(bpt->next() == NULL); |
| 2533 bpt->set_next(code_breakpoints_); | 2538 bpt->set_next(code_breakpoints_); |
| 2534 code_breakpoints_ = bpt; | 2539 code_breakpoints_ = bpt; |
| 2535 } | 2540 } |
| 2536 | 2541 |
| 2537 } // namespace dart | 2542 } // namespace dart |
| OLD | NEW |