Commit f2fe13f6 authored by Alexey Kozyatinskiy's avatar Alexey Kozyatinskiy Committed by Commit Bot

[inspector] don't call clearAllBreakpoints

This call from inspector side is redundant, V8 will clear all breakpoints on removing debug delegate in v8::internal::Debug::Unload method.

In any case for correct support of multiclient we need to clear breakpoints in V8DebuggerAgentImpl::disable method.

R=dgozman@chromium.org

Bug: v8:5510,chromium:652939
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I66f9b97797860bad28884a099928d54ac3560428
Reviewed-on: https://chromium-review.googlesource.com/592281
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: 's avatarDmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47022}
parent f455986f
......@@ -58,14 +58,6 @@ DebuggerScript.removeBreakpoint = function(execState, info)
Debug.findBreakPoint(info.breakpointId, true);
}
/**
* @param {!ExecutionState} execState
*/
DebuggerScript.clearBreakpoints = function(execState)
{
Debug.clearAllBreakPoints();
}
/**
* @param {!Array<!BreakPoint>|undefined} breakpoints
*/
......
......@@ -7,8 +7,6 @@
*/
var Debug = {};
Debug.clearAllBreakPoints = function() {}
/** @return {!Array<!Script>} */
Debug.scripts = function() {}
......
......@@ -362,6 +362,8 @@ Response V8DebuggerAgentImpl::disable() {
m_blackboxPattern.reset();
resetBlackboxedStateCache();
m_scripts.clear();
// TODO(kozyatinskiy): to support multiclient we need to remove breakpoints
// here.
m_breakpointIdToDebuggerBreakpointIds.clear();
m_debugger->setAsyncCallStackDepth(this, 0);
clearBreakDetails();
......
......@@ -204,7 +204,6 @@ void V8Debugger::enable() {
void V8Debugger::disable() {
if (--m_enableCount) return;
DCHECK(enabled());
clearBreakpoints();
clearContinueToLocation();
m_debuggerScript.Reset();
m_debuggerContext.Reset();
......@@ -319,18 +318,6 @@ void V8Debugger::removeBreakpoint(const String16& breakpointId) {
.ToLocalChecked();
}
void V8Debugger::clearBreakpoints() {
v8::HandleScope scope(m_isolate);
v8::Local<v8::Context> context = debuggerContext();
v8::Context::Scope contextScope(context);
v8::Local<v8::Function> clearBreakpoints = v8::Local<v8::Function>::Cast(
m_debuggerScript.Get(m_isolate)
->Get(context, toV8StringInternalized(m_isolate, "clearBreakpoints"))
.ToLocalChecked());
v8::debug::Call(debuggerContext(), clearBreakpoints).ToLocalChecked();
}
void V8Debugger::setBreakpointsActive(bool active) {
if (!enabled()) {
UNREACHABLE();
......
......@@ -115,7 +115,6 @@ class V8Debugger : public v8::debug::DebugDelegate {
v8::Local<v8::Value> argv[],
bool catchExceptions);
v8::Local<v8::Context> debuggerContext() const;
void clearBreakpoints();
void clearContinueToLocation();
bool shouldContinueToCurrentLocation();
......
Tests that we clear breakpoints on agent disabled
function foo() {#}
foo();#debugger;
// 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 that we clear breakpoints on agent disabled');
(async function test() {
session.setupScriptMap();
Protocol.Runtime.evaluate({expression: 'function foo() {}'});
Protocol.Debugger.enable();
let {params:{scriptId}} = await Protocol.Debugger.onceScriptParsed();
await Protocol.Debugger.setBreakpoint({
location: {
lineNumber: 0, columnNumber: 16, scriptId
}
});
Protocol.Runtime.evaluate({expression: 'foo()'});
var {params:{callFrames}} = await Protocol.Debugger.oncePaused();
await session.logSourceLocation(callFrames[0].location);
await Protocol.Debugger.disable();
await Protocol.Debugger.enable();
Protocol.Debugger.onPaused(InspectorTest.logMessage);
Protocol.Runtime.evaluate({expression: 'foo();debugger;'});
var {params:{callFrames}} = await Protocol.Debugger.oncePaused();
await session.logSourceLocation(callFrames[0].location);
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