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

Unified Diff: runtime/vm/debugger.cc

Issue 10698051: Fix Dart_RemoveBreakpoint (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
===================================================================
--- runtime/vm/debugger.cc (revision 9254)
+++ runtime/vm/debugger.cc (working copy)
@@ -1461,7 +1461,8 @@
} else {
prev_bpt->set_next(curr_bpt->next());
}
- // Remove references from code breakpoints to this source breakpoint.
+ // Remove references from code breakpoints to this source breakpoint,
+ // and disable the code breakpoints.
UnlinkCodeBreakpoints(curr_bpt);
delete curr_bpt;
return;
@@ -1475,15 +1476,15 @@
// Turn code breakpoints associated with the given source breakpoint into
// internal breakpoints. They will later be deleted when control
-// returns from the user-defined breakpoint callback.
-// Breakpoints can only be deleted by the user when we are stopped
-// at another breakpoint, so we are guaranteed to remove the unlinked
-// code breakpoints when returning from the handler.
+// returns from the user-defined breakpoint callback. Also, disable the
+// breakpoint so it no longer fires if it should be hit before it gets
+// deleted.
void Debugger::UnlinkCodeBreakpoints(SourceBreakpoint* src_bpt) {
ASSERT(src_bpt != NULL);
CodeBreakpoint* curr_bpt = code_breakpoints_;
while (curr_bpt != NULL) {
if (curr_bpt->src_bpt() == src_bpt) {
+ curr_bpt->Disable();
curr_bpt->set_src_bpt(NULL);
}
curr_bpt = curr_bpt->next();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698