Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: runtime/vm/debugger.cc

Issue 10544159: Fix issue 3636, break on exception (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/exceptions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "vm/code_generator.h" 7 #include "vm/code_generator.h"
8 #include "vm/code_patcher.h" 8 #include "vm/code_patcher.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 return true; 646 return true;
647 } 647 }
648 if (class_name.Equals("AssertionError")) { 648 if (class_name.Equals("AssertionError")) {
649 return true; 649 return true;
650 } 650 }
651 return false; 651 return false;
652 } 652 }
653 653
654 654
655 void Debugger::SignalExceptionThrown(const Object& exc) { 655 void Debugger::SignalExceptionThrown(const Object& exc) {
656 if (ignore_breakpoints_) { 656 if (ignore_breakpoints_ || (event_handler_ == NULL)) {
657 return; 657 return;
658 } 658 }
659 DebuggerStackTrace* stack_trace = CollectStackTrace(); 659 DebuggerStackTrace* stack_trace = CollectStackTrace();
660 if (!ShouldPauseOnException(stack_trace, exc)) { 660 if (!ShouldPauseOnException(stack_trace, exc)) {
661 return; 661 return;
662 } 662 }
663 // No single-stepping possible after this pause event. 663 // No single-stepping possible after this pause event.
664 last_bpt_line_ = -1; 664 last_bpt_line_ = -1;
665 if (event_handler_ != NULL) { 665 ASSERT(stack_trace_ == NULL);
666 ASSERT(stack_trace_ == NULL); 666 stack_trace_ = stack_trace;
667 stack_trace_ = stack_trace; 667 ASSERT(obj_cache_ == NULL);
668 ASSERT(obj_cache_ == NULL); 668 obj_cache_ = new RemoteObjectCache(64);
669 obj_cache_ = new RemoteObjectCache(64); 669 DebuggerEvent event;
670 DebuggerEvent event; 670 event.type = kExceptionThrown;
671 event.type = kExceptionThrown; 671 event.exception = &exc;
672 event.exception = &exc; 672 ASSERT(event_handler_ != NULL);
673 (*event_handler_)(&event); 673 (*event_handler_)(&event);
674 stack_trace_ = NULL; 674 stack_trace_ = NULL;
675 obj_cache_ = NULL; // Remote object cache is zone allocated. 675 obj_cache_ = NULL; // Remote object cache is zone allocated.
676 }
677 } 676 }
678 677
679 678
680 CodeBreakpoint* Debugger::MakeCodeBreakpoint(const Function& func, 679 CodeBreakpoint* Debugger::MakeCodeBreakpoint(const Function& func,
681 intptr_t token_index) { 680 intptr_t token_index) {
682 ASSERT(func.HasCode()); 681 ASSERT(func.HasCode());
683 ASSERT(!func.HasOptimizedCode()); 682 ASSERT(!func.HasOptimizedCode());
684 Code& code = Code::Handle(func.unoptimized_code()); 683 Code& code = Code::Handle(func.unoptimized_code());
685 ASSERT(!code.IsNull()); 684 ASSERT(!code.IsNull());
686 PcDescriptors& desc = PcDescriptors::Handle(code.pc_descriptors()); 685 PcDescriptors& desc = PcDescriptors::Handle(code.pc_descriptors());
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 } 1334 }
1336 1335
1337 1336
1338 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { 1337 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) {
1339 ASSERT(bpt->next() == NULL); 1338 ASSERT(bpt->next() == NULL);
1340 bpt->set_next(code_breakpoints_); 1339 bpt->set_next(code_breakpoints_);
1341 code_breakpoints_ = bpt; 1340 code_breakpoints_ = bpt;
1342 } 1341 }
1343 1342
1344 } // namespace dart 1343 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/exceptions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698