Commit 72ddbca6 authored by Alexey Kozyatinskiy's avatar Alexey Kozyatinskiy Committed by Commit Bot

[inspector] remove breakpoints when agent is disabled

It's important in multi-session case, each agent should cleanup own breakpoints on disabled.

R=dgozman@chromium.org

Bug: none
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I1b2182aa01e74c7e9f36addf998c779d1d32feef
Reviewed-on: https://chromium-review.googlesource.com/594272
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: 's avatarDmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47103}
parent ac774a36
......@@ -362,8 +362,11 @@ Response V8DebuggerAgentImpl::disable() {
m_blackboxPattern.reset();
resetBlackboxedStateCache();
m_scripts.clear();
// TODO(kozyatinskiy): to support multiclient we need to remove breakpoints
// here.
for (const auto& it : m_breakpointIdToDebuggerBreakpointIds) {
for (const auto& id : it.second) {
v8::debug::RemoveBreakpoint(m_isolate, id);
}
}
m_breakpointIdToDebuggerBreakpointIds.clear();
m_debugger->setAsyncCallStackDepth(this, 0);
clearBreakDetails();
......
......@@ -201,3 +201,12 @@ Resuming in 2
Resumed in 2
Deactivating breakpoints in 2
Evaluating common breakpoint in 1
Activating breakpoints in 1
Activating breakpoints in 2
Disabling debugger agent in 1
Evaluating breakpoint in 1 (should not be triggered)
Paused in 2:
reason: other
hit breakpoints:
location: <anonymous>@1
data: null
......@@ -162,6 +162,16 @@ function bar() {
InspectorTest.log('Evaluating common breakpoint in 1');
await session1.Protocol.Runtime.evaluate({expression: 'foo();'});
InspectorTest.log('Activating breakpoints in 1');
await session1.Protocol.Debugger.setBreakpointsActive({active: true});
InspectorTest.log('Activating breakpoints in 2');
await session2.Protocol.Debugger.setBreakpointsActive({active: true});
InspectorTest.log('Disabling debugger agent in 1');
await session1.Protocol.Debugger.disable();
InspectorTest.log('Evaluating breakpoint in 1 (should not be triggered)');
session2.Protocol.Runtime.evaluate({expression: 'baz();\ndebugger;'});
await waitForPaused(session2, 2);
InspectorTest.completeTest();
function waitForBothPaused() {
......
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