OLD | NEW |
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 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 // make any change that change isFunctionBlackboxed output - adding parsed | 1128 // make any change that change isFunctionBlackboxed output - adding parsed |
1129 // script is changing. | 1129 // script is changing. |
1130 scriptRef->resetBlackboxedStateCache(); | 1130 scriptRef->resetBlackboxedStateCache(); |
1131 | 1131 |
1132 Maybe<String16> sourceMapURLParam = scriptRef->sourceMappingURL(); | 1132 Maybe<String16> sourceMapURLParam = scriptRef->sourceMappingURL(); |
1133 Maybe<protocol::DictionaryValue> executionContextAuxDataParam( | 1133 Maybe<protocol::DictionaryValue> executionContextAuxDataParam( |
1134 std::move(executionContextAuxData)); | 1134 std::move(executionContextAuxData)); |
1135 const bool* isLiveEditParam = isLiveEdit ? &isLiveEdit : nullptr; | 1135 const bool* isLiveEditParam = isLiveEdit ? &isLiveEdit : nullptr; |
1136 const bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr; | 1136 const bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr; |
1137 const bool* isModuleParam = isModule ? &isModule : nullptr; | 1137 const bool* isModuleParam = isModule ? &isModule : nullptr; |
1138 if (success) | 1138 std::unique_ptr<V8StackTraceImpl> stack = |
| 1139 V8StackTraceImpl::capture(m_inspector->debugger(), contextGroupId, 1); |
| 1140 std::unique_ptr<protocol::Runtime::StackTrace> stackTrace = |
| 1141 stack && !stack->isEmpty() ? stack->buildInspectorObjectImpl() : nullptr; |
| 1142 if (success) { |
1139 m_frontend.scriptParsed( | 1143 m_frontend.scriptParsed( |
1140 scriptId, scriptURL, scriptRef->startLine(), scriptRef->startColumn(), | 1144 scriptId, scriptURL, scriptRef->startLine(), scriptRef->startColumn(), |
1141 scriptRef->endLine(), scriptRef->endColumn(), contextId, | 1145 scriptRef->endLine(), scriptRef->endColumn(), contextId, |
1142 scriptRef->hash(), std::move(executionContextAuxDataParam), | 1146 scriptRef->hash(), std::move(executionContextAuxDataParam), |
1143 isLiveEditParam, std::move(sourceMapURLParam), hasSourceURLParam, | 1147 isLiveEditParam, std::move(sourceMapURLParam), hasSourceURLParam, |
1144 isModuleParam, scriptRef->source().length()); | 1148 isModuleParam, scriptRef->source().length(), std::move(stackTrace)); |
1145 else | 1149 } else { |
1146 m_frontend.scriptFailedToParse( | 1150 m_frontend.scriptFailedToParse( |
1147 scriptId, scriptURL, scriptRef->startLine(), scriptRef->startColumn(), | 1151 scriptId, scriptURL, scriptRef->startLine(), scriptRef->startColumn(), |
1148 scriptRef->endLine(), scriptRef->endColumn(), contextId, | 1152 scriptRef->endLine(), scriptRef->endColumn(), contextId, |
1149 scriptRef->hash(), std::move(executionContextAuxDataParam), | 1153 scriptRef->hash(), std::move(executionContextAuxDataParam), |
1150 std::move(sourceMapURLParam), hasSourceURLParam, isModuleParam, | 1154 std::move(sourceMapURLParam), hasSourceURLParam, isModuleParam, |
1151 scriptRef->source().length()); | 1155 scriptRef->source().length(), std::move(stackTrace)); |
| 1156 } |
1152 | 1157 |
1153 if (scriptURL.isEmpty() || !success) return; | 1158 if (scriptURL.isEmpty() || !success) return; |
1154 | 1159 |
1155 protocol::DictionaryValue* breakpointsCookie = | 1160 protocol::DictionaryValue* breakpointsCookie = |
1156 m_state->getObject(DebuggerAgentState::javaScriptBreakpoints); | 1161 m_state->getObject(DebuggerAgentState::javaScriptBreakpoints); |
1157 if (!breakpointsCookie) return; | 1162 if (!breakpointsCookie) return; |
1158 | 1163 |
1159 for (size_t i = 0; i < breakpointsCookie->size(); ++i) { | 1164 for (size_t i = 0; i < breakpointsCookie->size(); ++i) { |
1160 auto cookie = breakpointsCookie->at(i); | 1165 auto cookie = breakpointsCookie->at(i); |
1161 protocol::DictionaryValue* breakpointObject = | 1166 protocol::DictionaryValue* breakpointObject = |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 void V8DebuggerAgentImpl::reset() { | 1348 void V8DebuggerAgentImpl::reset() { |
1344 if (!enabled()) return; | 1349 if (!enabled()) return; |
1345 m_scheduledDebuggerStep = NoStep; | 1350 m_scheduledDebuggerStep = NoStep; |
1346 m_blackboxedPositions.clear(); | 1351 m_blackboxedPositions.clear(); |
1347 resetBlackboxedStateCache(); | 1352 resetBlackboxedStateCache(); |
1348 m_scripts.clear(); | 1353 m_scripts.clear(); |
1349 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1354 m_breakpointIdToDebuggerBreakpointIds.clear(); |
1350 } | 1355 } |
1351 | 1356 |
1352 } // namespace v8_inspector | 1357 } // namespace v8_inspector |
OLD | NEW |