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

Unified Diff: src/debug.cc

Issue 658723005: Fix break location calculation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | test/mjsunit/regress/regress-419663.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index 2329b250f3e9ffdfd3e8bb5fac19f9a9958c505d..15c1a8bc709f791003917402a8efd6344dacb46a 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -1096,7 +1096,7 @@ bool Debug::SetBreakPoint(Handle<JSFunction> function,
it.FindBreakLocationFromPosition(*source_position, STATEMENT_ALIGNED);
it.SetBreakPoint(break_point_object);
- *source_position = it.position();
+ *source_position = it.statement_position();
// At least one active break point now.
return debug_info->GetBreakPointCount() > 0;
@@ -1140,7 +1140,10 @@ bool Debug::SetBreakPointForScript(Handle<Script> script,
it.FindBreakLocationFromPosition(position, alignment);
it.SetBreakPoint(break_point_object);
- *source_position = it.position() + shared->start_position();
+ position = (alignment == STATEMENT_ALIGNED) ? it.statement_position()
+ : it.position();
+
+ *source_position = position + shared->start_position();
// At least one active break point now.
DCHECK(debug_info->GetBreakPointCount() > 0);
@@ -1566,9 +1569,6 @@ Handle<Object> Debug::GetSourceBreakLocations(
case BREAK_POSITION_ALIGNED:
position = break_point_info->source_position();
break;
- default:
- UNREACHABLE();
- position = break_point_info->statement_position();
}
locations->set(count++, position);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-419663.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698