Revision: 15021
Author:   [email protected]
Date:     Sun Jun  9 13:10:29 2013
Log: Find breakpoint by PC rather than source position when clearing breakpoint

Current approach is to find breakpoint by the statement position that was used when setting breakpoint. This doesn't work when setting breakpoint by anything else but statement position.

(Question: could PC of existing breakpoint change, for example because of recompilation, or this approach is safe)

[email protected]

Review URL: https://codereview.chromium.org/15685010
http://code.google.com/p/v8/source/detail?r=15021

Modified:
 /branches/bleeding_edge/src/debug.cc

=======================================
--- /branches/bleeding_edge/src/debug.cc        Fri Jun  7 09:48:22 2013
+++ /branches/bleeding_edge/src/debug.cc        Sun Jun  9 13:10:29 2013
@@ -1241,15 +1241,11 @@
       // Get information in the break point.
       BreakPointInfo* break_point_info = BreakPointInfo::cast(result);
       Handle<DebugInfo> debug_info = node->debug_info();
-      Handle<SharedFunctionInfo> shared(debug_info->shared());
- int source_position = break_point_info->statement_position()->value();
-
-      // Source positions starts with zero.
-      ASSERT(source_position >= 0);

       // Find the break point and clear it.
       BreakLocationIterator it(debug_info, SOURCE_BREAK_LOCATIONS);
-      it.FindBreakLocationFromPosition(source_position);
+      it.FindBreakLocationFromAddress(debug_info->code()->entry() +
+          break_point_info->code_position()->value());
       it.ClearBreakPoint(break_point_object);

// If there are no more break points left remove the debug info for this

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to