Commit f485f44a authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

Revert "[inspector] breakpoint after last break position should not jump to first line"

This reverts commit 61292f0b.

Reason for revert: Breaks layout tests:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/18913

Original change's description:
> [inspector] breakpoint after last break position should not jump to first line
> 
> R=​jgruber@chromium.org
> 
> Bug: chromium:730177
> Change-Id: I0f3666a333604cb80bb51410c5edf2aceb0c6ef5
> Reviewed-on: https://chromium-review.googlesource.com/717717
> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#48556}

TBR=kozyatinskiy@chromium.org,jgruber@chromium.org

Change-Id: Ic4e961bf9c82e43281779c79e22660a55bfcb29d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:730177
Reviewed-on: https://chromium-review.googlesource.com/720376Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48567}
parent 041de0aa
......@@ -603,13 +603,8 @@ bool Debug::SetBreakPointForScript(Handle<Script> script,
Handle<DebugInfo> debug_info(shared->GetDebugInfo());
// Find breakable position returns first breakable position after
// *source_position, it can return 0 if no break location is found after
// *source_position.
int breakable_position = FindBreakablePosition(debug_info, *source_position);
if (breakable_position < *source_position) return false;
*source_position = breakable_position;
// Find the break point and change it.
*source_position = FindBreakablePosition(debug_info, *source_position);
DebugInfo::SetBreakPoint(debug_info, *source_position, break_point_object);
// At least one active break point now.
DCHECK_LT(0, debug_info->GetBreakPointCount());
......
......@@ -4,7 +4,7 @@
var source =
"var foo = function foo() {\n" +
" var a = 1;\n" +
" return 1;\n" +
"}\n" +
"//@ sourceURL=test";
......
Tests breakpoint at last line.
{
breakpointId : <breakpointId>
locations : [
[0] : {
columnNumber : 12
lineNumber : 3
scriptId : <scriptId>
}
]
}
{
breakpointId : <breakpointId>
locations : [
]
}
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let {session, contextGroup, Protocol} = InspectorTest.start('Tests breakpoint at last line.');
let source = `
let a = 1;
//# sourceURL=foo.js
let b = 2;
`;
(async function test() {
Protocol.Debugger.enable();
Protocol.Runtime.evaluate({expression: source});
let {result} = await Protocol.Debugger.setBreakpointByUrl({
url: 'foo.js',
lineNumber: 3,
columnNumber: 12
});
InspectorTest.logMessage(result);
({result} = await Protocol.Debugger.setBreakpointByUrl({
url: 'foo.js',
lineNumber: 4
}));
InspectorTest.logMessage(result);
InspectorTest.completeTest();
})();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment