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

Unified Diff: test/mjsunit/debug-breakpoints.js

Issue 18349004: Debug: support breakpoints set in the middle of statement (try #2 after rollback) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | « test/cctest/test-debug.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/debug-breakpoints.js
diff --git a/test/mjsunit/debug-breakpoints.js b/test/mjsunit/debug-breakpoints.js
index 13020343b0ec61f351dfaf984a599de5c60af979..148acfc9ef49fab580fb38d9972dddadcd1db4b9 100644
--- a/test/mjsunit/debug-breakpoints.js
+++ b/test/mjsunit/debug-breakpoints.js
@@ -29,7 +29,7 @@
// Get the Debug object exposed from the debug context global object.
Debug = debug.Debug
-function f() {a=1;b=2};
+function f() {a=1;b=2}
function g() {
a=1;
b=2;
@@ -121,13 +121,13 @@ assertTrue(Debug.showBreakPoints(g).indexOf("[B0]") < 0);
// Tests for setting break points by script id and position.
-function setBreakpointByPosition(f, position)
+function setBreakpointByPosition(f, position, opt_position_alignment)
{
var break_point = Debug.setBreakPointByScriptIdAndPosition(
Debug.findScript(f).id,
position + Debug.sourcePosition(f),
"",
- true);
+ true, opt_position_alignment);
return break_point.number();
}
@@ -204,3 +204,22 @@ Debug.clearBreakPoint(bp3);
//b=2;
//}
assertTrue(Debug.showBreakPoints(g).indexOf("[B0]") < 0);
+
+// Tests for setting break points without statement aligment.
+// (This may be sensitive to compiler break position map generation).
+function h() {a=f(f2(1,2),f3())+f3();b=f3();}
+var scenario = [
+ [5, "{a[B0]=f"],
+ [6, "{a=[B0]f("],
+ [7, "{a=f([B0]f2("],
+ [16, "f2(1,2),[B0]f3()"],
+ [22, "+[B0]f3()"]
+];
+for(var i = 0; i < scenario.length; i++) {
+ bp1 = setBreakpointByPosition(h, scenario[i][0],
+ Debug.BreakPositionAlignment.BreakPosition);
+ assertTrue(Debug.showBreakPoints(h, undefined,
+ Debug.BreakPositionAlignment.BreakPosition).indexOf(scenario[i][1]) > 0);
+ Debug.clearBreakPoint(bp1);
+}
+
« no previous file with comments | « test/cctest/test-debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698