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

Side by Side Diff: src/inspector/v8-debugger-agent-impl.cc

Issue 2685163006: [inspector] migrate set/remove BreakPoint to debug-interface.h (Closed)
Patch Set: added a test, ready for review Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/inspector/v8-debugger-agent-impl.h" 5 #include "src/inspector/v8-debugger-agent-impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "src/debug/debug-interface.h" 9 #include "src/debug/debug-interface.h"
10 #include "src/inspector/injected-script.h" 10 #include "src/inspector/injected-script.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 Response V8DebuggerAgentImpl::disable() { 168 Response V8DebuggerAgentImpl::disable() {
169 if (!enabled()) return Response::OK(); 169 if (!enabled()) return Response::OK();
170 170
171 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, 171 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints,
172 protocol::DictionaryValue::create()); 172 protocol::DictionaryValue::create());
173 m_state->setInteger(DebuggerAgentState::pauseOnExceptionsState, 173 m_state->setInteger(DebuggerAgentState::pauseOnExceptionsState,
174 v8::debug::NoBreakOnException); 174 v8::debug::NoBreakOnException);
175 m_state->setInteger(DebuggerAgentState::asyncCallStackDepth, 0); 175 m_state->setInteger(DebuggerAgentState::asyncCallStackDepth, 0);
176 176
177 if (isPaused()) m_debugger->continueProgram(); 177 if (isPaused()) m_debugger->continueProgram();
178
179 {
180 v8::HandleScope scope(m_isolate);
181 for (const auto& it : m_idToBreakpoints) removeBreakpointImpl(it.first);
182 }
183
178 m_debugger->disable(); 184 m_debugger->disable();
179 JavaScriptCallFrames emptyCallFrames; 185 JavaScriptCallFrames emptyCallFrames;
180 m_pausedCallFrames.swap(emptyCallFrames); 186 m_pausedCallFrames.swap(emptyCallFrames);
181 m_blackboxedPositions.clear(); 187 m_blackboxedPositions.clear();
182 m_blackboxPattern.reset(); 188 m_blackboxPattern.reset();
183 resetBlackboxedStateCache(); 189 resetBlackboxedStateCache();
184 m_scripts.clear(); 190 m_scripts.clear();
185 m_breakpointIdToDebuggerBreakpointIds.clear(); 191 m_idToBreakpoints.clear();
192 m_breakpointIdToSource.clear();
186 m_debugger->setAsyncCallStackDepth(this, 0); 193 m_debugger->setAsyncCallStackDepth(this, 0);
187 m_continueToLocationBreakpointId = String16(); 194 m_continueToLocationBreakpoint.Reset();
188 clearBreakDetails(); 195 clearBreakDetails();
189 m_scheduledDebuggerStep = NoStep; 196 m_scheduledDebuggerStep = NoStep;
190 m_javaScriptPauseScheduled = false; 197 m_javaScriptPauseScheduled = false;
191 m_skipAllPauses = false; 198 m_skipAllPauses = false;
192 m_state->setBoolean(DebuggerAgentState::skipAllPauses, false); 199 m_state->setBoolean(DebuggerAgentState::skipAllPauses, false);
193 m_state->remove(DebuggerAgentState::blackboxPattern); 200 m_state->remove(DebuggerAgentState::blackboxPattern);
194 m_enabled = false; 201 m_enabled = false;
195 m_state->setBoolean(DebuggerAgentState::debuggerEnabled, false); 202 m_state->setBoolean(DebuggerAgentState::debuggerEnabled, false);
196 return Response::OK(); 203 return Response::OK();
197 } 204 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 Response V8DebuggerAgentImpl::setBreakpoint( 321 Response V8DebuggerAgentImpl::setBreakpoint(
315 std::unique_ptr<protocol::Debugger::Location> location, 322 std::unique_ptr<protocol::Debugger::Location> location,
316 Maybe<String16> optionalCondition, String16* outBreakpointId, 323 Maybe<String16> optionalCondition, String16* outBreakpointId,
317 std::unique_ptr<protocol::Debugger::Location>* actualLocation) { 324 std::unique_ptr<protocol::Debugger::Location>* actualLocation) {
318 ScriptBreakpoint breakpoint( 325 ScriptBreakpoint breakpoint(
319 location->getScriptId(), location->getLineNumber(), 326 location->getScriptId(), location->getLineNumber(),
320 location->getColumnNumber(0), optionalCondition.fromMaybe(String16())); 327 location->getColumnNumber(0), optionalCondition.fromMaybe(String16()));
321 328
322 String16 breakpointId = 329 String16 breakpointId =
323 generateBreakpointId(breakpoint, UserBreakpointSource); 330 generateBreakpointId(breakpoint, UserBreakpointSource);
324 if (m_breakpointIdToDebuggerBreakpointIds.find(breakpointId) != 331 if (m_idToBreakpoints.find(breakpointId) != m_idToBreakpoints.end()) {
325 m_breakpointIdToDebuggerBreakpointIds.end()) {
326 return Response::Error("Breakpoint at specified location already exists."); 332 return Response::Error("Breakpoint at specified location already exists.");
327 } 333 }
328 *actualLocation = 334 *actualLocation =
329 resolveBreakpoint(breakpointId, breakpoint, UserBreakpointSource); 335 resolveBreakpoint(breakpointId, breakpoint, UserBreakpointSource);
330 if (!*actualLocation) return Response::Error("Could not resolve breakpoint"); 336 if (!*actualLocation) return Response::Error("Could not resolve breakpoint");
331 *outBreakpointId = breakpointId; 337 *outBreakpointId = breakpointId;
332 return Response::OK(); 338 return Response::OK();
333 } 339 }
334 340
335 Response V8DebuggerAgentImpl::removeBreakpoint(const String16& breakpointId) { 341 Response V8DebuggerAgentImpl::removeBreakpoint(const String16& breakpointId) {
336 if (!enabled()) return Response::Error(kDebuggerNotEnabled); 342 if (!enabled()) return Response::Error(kDebuggerNotEnabled);
337 protocol::DictionaryValue* breakpointsCookie = 343 protocol::DictionaryValue* breakpointsCookie =
338 m_state->getObject(DebuggerAgentState::javaScriptBreakpoints); 344 m_state->getObject(DebuggerAgentState::javaScriptBreakpoints);
339 if (breakpointsCookie) breakpointsCookie->remove(breakpointId); 345 if (breakpointsCookie) breakpointsCookie->remove(breakpointId);
340 removeBreakpointImpl(breakpointId); 346 removeBreakpointImpl(breakpointId);
341 return Response::OK(); 347 return Response::OK();
342 } 348 }
343 349
344 void V8DebuggerAgentImpl::removeBreakpointImpl(const String16& breakpointId) { 350 void V8DebuggerAgentImpl::removeBreakpointImpl(const String16& breakpointId) {
345 DCHECK(enabled()); 351 DCHECK(enabled());
346 BreakpointIdToDebuggerBreakpointIdsMap::iterator 352 auto it = m_idToBreakpoints.find(breakpointId);
347 debuggerBreakpointIdsIterator = 353 if (it == m_idToBreakpoints.end()) return;
348 m_breakpointIdToDebuggerBreakpointIds.find(breakpointId); 354 v8::HandleScope scope(m_isolate);
349 if (debuggerBreakpointIdsIterator == 355 for (const auto& breakpoint : it->second) {
350 m_breakpointIdToDebuggerBreakpointIds.end()) 356 v8::debug::ClearBreakPoint(m_isolate, breakpoint.Get(m_isolate));
351 return;
352 const std::vector<String16>& ids = debuggerBreakpointIdsIterator->second;
353 for (size_t i = 0; i < ids.size(); ++i) {
354 const String16& debuggerBreakpointId = ids[i];
355
356 m_debugger->removeBreakpoint(debuggerBreakpointId);
357 m_serverBreakpoints.erase(debuggerBreakpointId);
358 } 357 }
359 m_breakpointIdToDebuggerBreakpointIds.erase(breakpointId); 358 m_breakpointIdToSource.erase(it->first);
359 m_idToBreakpoints.erase(it);
360 } 360 }
361 361
362 Response V8DebuggerAgentImpl::getPossibleBreakpoints( 362 Response V8DebuggerAgentImpl::getPossibleBreakpoints(
363 std::unique_ptr<protocol::Debugger::Location> start, 363 std::unique_ptr<protocol::Debugger::Location> start,
364 Maybe<protocol::Debugger::Location> end, 364 Maybe<protocol::Debugger::Location> end,
365 std::unique_ptr<protocol::Array<protocol::Debugger::Location>>* locations) { 365 std::unique_ptr<protocol::Array<protocol::Debugger::Location>>* locations) {
366 String16 scriptId = start->getScriptId(); 366 String16 scriptId = start->getScriptId();
367 367
368 if (start->getLineNumber() < 0 || start->getColumnNumber(0) < 0) 368 if (start->getLineNumber() < 0 || start->getColumnNumber(0) < 0)
369 return Response::Error( 369 return Response::Error(
(...skipping 27 matching lines...) Expand all
397 .setLineNumber(v8Locations[i].GetLineNumber()) 397 .setLineNumber(v8Locations[i].GetLineNumber())
398 .setColumnNumber(v8Locations[i].GetColumnNumber()) 398 .setColumnNumber(v8Locations[i].GetColumnNumber())
399 .build()); 399 .build());
400 } 400 }
401 return Response::OK(); 401 return Response::OK();
402 } 402 }
403 403
404 Response V8DebuggerAgentImpl::continueToLocation( 404 Response V8DebuggerAgentImpl::continueToLocation(
405 std::unique_ptr<protocol::Debugger::Location> location) { 405 std::unique_ptr<protocol::Debugger::Location> location) {
406 if (!enabled()) return Response::Error(kDebuggerNotEnabled); 406 if (!enabled()) return Response::Error(kDebuggerNotEnabled);
407 if (!m_continueToLocationBreakpointId.isEmpty()) { 407 ScriptsMap::iterator it = m_scripts.find(location->getScriptId());
408 m_debugger->removeBreakpoint(m_continueToLocationBreakpointId); 408 if (it == m_scripts.end()) {
409 m_continueToLocationBreakpointId = ""; 409 return Response::Error("No script with given id found");
410 } 410 }
411 411
412 ScriptBreakpoint breakpoint(location->getScriptId(), 412 v8::HandleScope handle_scope(m_isolate);
413 location->getLineNumber(),
414 location->getColumnNumber(0), String16());
415 413
416 m_continueToLocationBreakpointId = m_debugger->setBreakpoint( 414 if (!m_continueToLocationBreakpoint.IsEmpty()) {
417 breakpoint, &breakpoint.line_number, &breakpoint.column_number); 415 v8::debug::ClearBreakPoint(m_isolate,
416 m_continueToLocationBreakpoint.Get(m_isolate));
417 m_continueToLocationBreakpoint.Reset();
418 }
419
420 v8::debug::Location position(location->getLineNumber(),
421 location->getColumnNumber(0));
422 v8::Local<v8::debug::BreakPoint> breakPoint = v8::debug::BreakPoint::New(
423 m_isolate, v8::Undefined(m_isolate), v8::Undefined(m_isolate));
424
425 v8::debug::Location result = it->second->setBreakpoint(position, breakPoint);
426 if (result.IsEmpty()) return Response::Error("Could not resolve breakpoint");
427 m_continueToLocationBreakpoint.Reset(m_isolate, breakPoint);
418 // TODO(kozyatinskiy): Return actual line and column number. 428 // TODO(kozyatinskiy): Return actual line and column number.
419 return resume(); 429 return resume();
420 } 430 }
421 431
422 bool V8DebuggerAgentImpl::isFunctionBlackboxed(const String16& scriptId, 432 bool V8DebuggerAgentImpl::isFunctionBlackboxed(const String16& scriptId,
423 const v8::debug::Location& start, 433 const v8::debug::Location& start,
424 const v8::debug::Location& end) { 434 const v8::debug::Location& end) {
425 ScriptsMap::iterator it = m_scripts.find(scriptId); 435 ScriptsMap::iterator it = m_scripts.find(scriptId);
426 if (it == m_scripts.end()) { 436 if (it == m_scripts.end()) {
427 // Unknown scripts are blackboxed. 437 // Unknown scripts are blackboxed.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 if (breakpoint.line_number < scriptIterator->second->startLine() || 477 if (breakpoint.line_number < scriptIterator->second->startLine() ||
468 scriptIterator->second->endLine() < breakpoint.line_number) 478 scriptIterator->second->endLine() < breakpoint.line_number)
469 return nullptr; 479 return nullptr;
470 480
471 // Translate from protocol location to v8 location for the debugger. 481 // Translate from protocol location to v8 location for the debugger.
472 ScriptBreakpoint translatedBreakpoint = breakpoint; 482 ScriptBreakpoint translatedBreakpoint = breakpoint;
473 m_debugger->wasmTranslation()->TranslateProtocolLocationToWasmScriptLocation( 483 m_debugger->wasmTranslation()->TranslateProtocolLocationToWasmScriptLocation(
474 &translatedBreakpoint.script_id, &translatedBreakpoint.line_number, 484 &translatedBreakpoint.script_id, &translatedBreakpoint.line_number,
475 &translatedBreakpoint.column_number); 485 &translatedBreakpoint.column_number);
476 486
477 int actualLineNumber; 487 v8::Local<v8::Value> condition = v8::Undefined(m_isolate);
478 int actualColumnNumber; 488 if (!breakpoint.condition.isEmpty())
479 String16 debuggerBreakpointId = m_debugger->setBreakpoint( 489 condition = toV8String(m_isolate, breakpoint.condition);
480 translatedBreakpoint, &actualLineNumber, &actualColumnNumber); 490 v8::Local<v8::Value> v8BreakpointId = toV8String(m_isolate, breakpointId);
481 if (debuggerBreakpointId.isEmpty()) return nullptr; 491 v8::Local<v8::debug::BreakPoint> breakPoint =
492 v8::debug::BreakPoint::New(m_isolate, condition, v8BreakpointId);
493 v8::debug::Location position(translatedBreakpoint.line_number,
494 translatedBreakpoint.column_number);
495 v8::debug::Location result =
496 scriptIterator->second->setBreakpoint(position, breakPoint);
497 if (result.IsEmpty()) return nullptr;
498
499 int actualLineNumber = result.GetLineNumber();
500 int actualColumnNumber = result.GetColumnNumber();
482 501
483 // Translate back from v8 location to protocol location for the return value. 502 // Translate back from v8 location to protocol location for the return value.
484 m_debugger->wasmTranslation()->TranslateWasmScriptLocationToProtocolLocation( 503 m_debugger->wasmTranslation()->TranslateWasmScriptLocationToProtocolLocation(
485 &translatedBreakpoint.script_id, &actualLineNumber, &actualColumnNumber); 504 &translatedBreakpoint.script_id, &actualLineNumber, &actualColumnNumber);
486 505
487 m_serverBreakpoints[debuggerBreakpointId] =
488 std::make_pair(breakpointId, source);
489 CHECK(!breakpointId.isEmpty()); 506 CHECK(!breakpointId.isEmpty());
490 507 m_idToBreakpoints[breakpointId].emplace_back(m_isolate, breakPoint);
491 m_breakpointIdToDebuggerBreakpointIds[breakpointId].push_back( 508 m_breakpointIdToSource[breakpointId] = source;
492 debuggerBreakpointId);
493 return buildProtocolLocation(translatedBreakpoint.script_id, actualLineNumber, 509 return buildProtocolLocation(translatedBreakpoint.script_id, actualLineNumber,
494 actualColumnNumber); 510 actualColumnNumber);
495 } 511 }
496 512
497 Response V8DebuggerAgentImpl::searchInContent( 513 Response V8DebuggerAgentImpl::searchInContent(
498 const String16& scriptId, const String16& query, 514 const String16& scriptId, const String16& query,
499 Maybe<bool> optionalCaseSensitive, Maybe<bool> optionalIsRegex, 515 Maybe<bool> optionalCaseSensitive, Maybe<bool> optionalIsRegex,
500 std::unique_ptr<Array<protocol::Debugger::SearchMatch>>* results) { 516 std::unique_ptr<Array<protocol::Debugger::SearchMatch>>* results) {
501 v8::HandleScope handles(m_isolate); 517 v8::HandleScope handles(m_isolate);
502 ScriptsMap::iterator it = m_scripts.find(scriptId); 518 ScriptsMap::iterator it = m_scripts.find(scriptId);
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 &breakpoint.column_number); 1084 &breakpoint.column_number);
1069 breakpointObject->getString(DebuggerAgentState::condition, 1085 breakpointObject->getString(DebuggerAgentState::condition,
1070 &breakpoint.condition); 1086 &breakpoint.condition);
1071 std::unique_ptr<protocol::Debugger::Location> location = 1087 std::unique_ptr<protocol::Debugger::Location> location =
1072 resolveBreakpoint(cookie.first, breakpoint, UserBreakpointSource); 1088 resolveBreakpoint(cookie.first, breakpoint, UserBreakpointSource);
1073 if (location) 1089 if (location)
1074 m_frontend.breakpointResolved(cookie.first, std::move(location)); 1090 m_frontend.breakpointResolved(cookie.first, std::move(location));
1075 } 1091 }
1076 } 1092 }
1077 1093
1078 void V8DebuggerAgentImpl::didPause(int contextId, 1094 void V8DebuggerAgentImpl::didPause(
1079 v8::Local<v8::Value> exception, 1095 int contextId, v8::Local<v8::Value> exception,
1080 const std::vector<String16>& hitBreakpoints, 1096 const v8::PersistentValueVector<v8::debug::BreakPoint>& hitBreakpoints,
1081 bool isPromiseRejection, bool isUncaught, 1097 bool isPromiseRejection, bool isUncaught, bool isOOMBreak) {
1082 bool isOOMBreak) {
1083 JavaScriptCallFrames frames = m_debugger->currentCallFrames(); 1098 JavaScriptCallFrames frames = m_debugger->currentCallFrames();
1084 m_pausedCallFrames.swap(frames); 1099 m_pausedCallFrames.swap(frames);
1085 v8::HandleScope handles(m_isolate); 1100 v8::HandleScope handles(m_isolate);
1086 1101
1087 std::vector<BreakReason> hitReasons; 1102 std::vector<BreakReason> hitReasons;
1088 1103
1089 if (isOOMBreak) { 1104 if (isOOMBreak) {
1090 hitReasons.push_back( 1105 hitReasons.push_back(
1091 std::make_pair(protocol::Debugger::Paused::ReasonEnum::OOM, nullptr)); 1106 std::make_pair(protocol::Debugger::Paused::ReasonEnum::OOM, nullptr));
1092 } else if (!exception.IsEmpty()) { 1107 } else if (!exception.IsEmpty()) {
(...skipping 15 matching lines...) Expand all
1108 breakAuxData = nullptr; 1123 breakAuxData = nullptr;
1109 } 1124 }
1110 hitReasons.push_back( 1125 hitReasons.push_back(
1111 std::make_pair(breakReason, std::move(breakAuxData))); 1126 std::make_pair(breakReason, std::move(breakAuxData)));
1112 } 1127 }
1113 } 1128 }
1114 1129
1115 std::unique_ptr<Array<String16>> hitBreakpointIds = Array<String16>::create(); 1130 std::unique_ptr<Array<String16>> hitBreakpointIds = Array<String16>::create();
1116 1131
1117 bool hasDebugCommandBreakpointReason = false; 1132 bool hasDebugCommandBreakpointReason = false;
1118 for (const auto& point : hitBreakpoints) { 1133 for (size_t i = 0; i < hitBreakpoints.Size(); ++i) {
1119 DebugServerBreakpointToBreakpointIdAndSourceMap::iterator 1134 String16 id = toProtocolStringWithTypeCheck(hitBreakpoints.Get(i)->Data());
1120 breakpointIterator = m_serverBreakpoints.find(point); 1135 if (id.isEmpty()) continue;
1121 if (breakpointIterator != m_serverBreakpoints.end()) { 1136 auto it = m_breakpointIdToSource.find(id);
1122 const String16& localId = breakpointIterator->second.first; 1137 if (it == m_breakpointIdToSource.end()) continue;
1123 hitBreakpointIds->addItem(localId); 1138 hitBreakpointIds->addItem(it->first);
1124 1139 if (!hasDebugCommandBreakpointReason &&
1125 BreakpointSource source = breakpointIterator->second.second; 1140 it->second == DebugCommandBreakpointSource) {
1126 if (!hasDebugCommandBreakpointReason && 1141 hasDebugCommandBreakpointReason = true;
1127 source == DebugCommandBreakpointSource) { 1142 hitReasons.push_back(std::make_pair(
1128 hasDebugCommandBreakpointReason = true; 1143 protocol::Debugger::Paused::ReasonEnum::DebugCommand, nullptr));
1129 hitReasons.push_back(std::make_pair(
1130 protocol::Debugger::Paused::ReasonEnum::DebugCommand, nullptr));
1131 }
1132 } 1144 }
1133 } 1145 }
1134 1146
1135 for (size_t i = 0; i < m_breakReason.size(); ++i) { 1147 for (size_t i = 0; i < m_breakReason.size(); ++i) {
1136 hitReasons.push_back(std::move(m_breakReason[i])); 1148 hitReasons.push_back(std::move(m_breakReason[i]));
1137 } 1149 }
1138 clearBreakDetails(); 1150 clearBreakDetails();
1139 1151
1140 String16 breakReason = protocol::Debugger::Paused::ReasonEnum::Other; 1152 String16 breakReason = protocol::Debugger::Paused::ReasonEnum::Other;
1141 std::unique_ptr<protocol::DictionaryValue> breakAuxData; 1153 std::unique_ptr<protocol::DictionaryValue> breakAuxData;
1142 if (hitReasons.size() == 1) { 1154 if (hitReasons.size() == 1) {
1143 breakReason = hitReasons[0].first; 1155 breakReason = hitReasons[0].first;
1144 breakAuxData = std::move(hitReasons[0].second); 1156 breakAuxData = std::move(hitReasons[0].second);
1145 } else if (hitReasons.size() > 1) { 1157 } else if (hitReasons.size() > 1) {
1146 breakReason = protocol::Debugger::Paused::ReasonEnum::Ambiguous; 1158 breakReason = protocol::Debugger::Paused::ReasonEnum::Ambiguous;
1147 std::unique_ptr<protocol::ListValue> reasons = 1159 std::unique_ptr<protocol::ListValue> reasons =
1148 protocol::ListValue::create(); 1160 protocol::ListValue::create();
1149 for (size_t i = 0; i < hitReasons.size(); ++i) { 1161 for (size_t i = 0; i < hitReasons.size(); ++i) {
1150 std::unique_ptr<protocol::DictionaryValue> reason = 1162 std::unique_ptr<protocol::DictionaryValue> reason =
1151 protocol::DictionaryValue::create(); 1163 protocol::DictionaryValue::create();
1152 reason->setString("reason", hitReasons[i].first); 1164 reason->setString("reason", hitReasons[i].first);
1153 if (hitReasons[i].second) 1165 if (hitReasons[i].second) {
1154 reason->setObject("auxData", std::move(hitReasons[i].second)); 1166 reason->setObject("auxData", std::move(hitReasons[i].second));
1167 }
1155 reasons->pushValue(std::move(reason)); 1168 reasons->pushValue(std::move(reason));
1156 } 1169 }
1157 breakAuxData = protocol::DictionaryValue::create(); 1170 breakAuxData = protocol::DictionaryValue::create();
1158 breakAuxData->setArray("reasons", std::move(reasons)); 1171 breakAuxData->setArray("reasons", std::move(reasons));
1159 } 1172 }
1160 1173
1161 std::unique_ptr<Array<CallFrame>> protocolCallFrames; 1174 std::unique_ptr<Array<CallFrame>> protocolCallFrames;
1162 Response response = currentCallFrames(&protocolCallFrames); 1175 Response response = currentCallFrames(&protocolCallFrames);
1163 if (!response.isSuccess()) protocolCallFrames = Array<CallFrame>::create(); 1176 if (!response.isSuccess()) protocolCallFrames = Array<CallFrame>::create();
1164 m_frontend.paused(std::move(protocolCallFrames), breakReason, 1177 m_frontend.paused(std::move(protocolCallFrames), breakReason,
1165 std::move(breakAuxData), std::move(hitBreakpointIds), 1178 std::move(breakAuxData), std::move(hitBreakpointIds),
1166 currentAsyncStackTrace()); 1179 currentAsyncStackTrace());
1167 m_scheduledDebuggerStep = NoStep; 1180 m_scheduledDebuggerStep = NoStep;
1168 m_javaScriptPauseScheduled = false; 1181 m_javaScriptPauseScheduled = false;
1169 1182
1170 if (!m_continueToLocationBreakpointId.isEmpty()) { 1183 if (!m_continueToLocationBreakpoint.IsEmpty()) {
1171 m_debugger->removeBreakpoint(m_continueToLocationBreakpointId); 1184 v8::debug::ClearBreakPoint(m_isolate,
1172 m_continueToLocationBreakpointId = ""; 1185 m_continueToLocationBreakpoint.Get(m_isolate));
1186 m_continueToLocationBreakpoint.Reset();
1173 } 1187 }
1174 } 1188 }
1175 1189
1176 void V8DebuggerAgentImpl::didContinue() { 1190 void V8DebuggerAgentImpl::didContinue() {
1177 JavaScriptCallFrames emptyCallFrames; 1191 JavaScriptCallFrames emptyCallFrames;
1178 m_pausedCallFrames.swap(emptyCallFrames); 1192 m_pausedCallFrames.swap(emptyCallFrames);
1179 clearBreakDetails(); 1193 clearBreakDetails();
1180 m_frontend.resumed(); 1194 m_frontend.resumed();
1181 } 1195 }
1182 1196
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 ScriptBreakpoint(scriptId, lineNumber, columnNumber, String16()), 1232 ScriptBreakpoint(scriptId, lineNumber, columnNumber, String16()),
1219 source)); 1233 source));
1220 } 1234 }
1221 1235
1222 void V8DebuggerAgentImpl::reset() { 1236 void V8DebuggerAgentImpl::reset() {
1223 if (!enabled()) return; 1237 if (!enabled()) return;
1224 m_scheduledDebuggerStep = NoStep; 1238 m_scheduledDebuggerStep = NoStep;
1225 m_blackboxedPositions.clear(); 1239 m_blackboxedPositions.clear();
1226 resetBlackboxedStateCache(); 1240 resetBlackboxedStateCache();
1227 m_scripts.clear(); 1241 m_scripts.clear();
1228 m_breakpointIdToDebuggerBreakpointIds.clear(); 1242 m_idToBreakpoints.clear();
1243 m_breakpointIdToSource.clear();
1229 } 1244 }
1230 1245
1231 } // namespace v8_inspector 1246 } // namespace v8_inspector
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698