From e79ba28aa8791300177a982279282725c7639fcb Mon Sep 17 00:00:00 2001 From: "peter.rybin@gmail.com" Date: Sun, 9 Jun 2013 20:10:29 +0000 Subject: [PATCH] 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) R=yangguo@chromium.org Review URL: https://codereview.chromium.org/15685010 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15021 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/debug.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/debug.cc b/src/debug.cc index 6b5730c..5d26ba2 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -1241,15 +1241,11 @@ void Debug::ClearBreakPoint(Handle break_point_object) { // Get information in the break point. BreakPointInfo* break_point_info = BreakPointInfo::cast(result); Handle debug_info = node->debug_info(); - Handle 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 -- 2.7.4