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 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 if (!objects->Set(debuggerContext, static_cast<int>(frameOrdinal), details) | 1024 if (!objects->Set(debuggerContext, static_cast<int>(frameOrdinal), details) |
1025 .FromMaybe(false)) { | 1025 .FromMaybe(false)) { |
1026 return Response::InternalError(); | 1026 return Response::InternalError(); |
1027 } | 1027 } |
1028 } | 1028 } |
1029 | 1029 |
1030 std::unique_ptr<protocol::Value> protocolValue; | 1030 std::unique_ptr<protocol::Value> protocolValue; |
1031 Response response = toProtocolValue(debuggerContext, objects, &protocolValue); | 1031 Response response = toProtocolValue(debuggerContext, objects, &protocolValue); |
1032 if (!response.isSuccess()) return response; | 1032 if (!response.isSuccess()) return response; |
1033 protocol::ErrorSupport errorSupport; | 1033 protocol::ErrorSupport errorSupport; |
1034 *result = Array<CallFrame>::parse(protocolValue.get(), &errorSupport); | 1034 *result = Array<CallFrame>::fromValue(protocolValue.get(), &errorSupport); |
1035 if (!*result) return Response::Error(errorSupport.errors()); | 1035 if (!*result) return Response::Error(errorSupport.errors()); |
1036 TranslateWasmStackTraceLocations(result->get(), m_debugger->wasmTranslation(), | 1036 TranslateWasmStackTraceLocations(result->get(), m_debugger->wasmTranslation(), |
1037 m_session->contextGroupId()); | 1037 m_session->contextGroupId()); |
1038 return Response::OK(); | 1038 return Response::OK(); |
1039 } | 1039 } |
1040 | 1040 |
1041 std::unique_ptr<StackTrace> V8DebuggerAgentImpl::currentAsyncStackTrace() { | 1041 std::unique_ptr<StackTrace> V8DebuggerAgentImpl::currentAsyncStackTrace() { |
1042 if (m_pausedContext.IsEmpty()) return nullptr; | 1042 if (m_pausedContext.IsEmpty()) return nullptr; |
1043 V8StackTraceImpl* stackTrace = m_debugger->currentAsyncCallChain(); | 1043 V8StackTraceImpl* stackTrace = m_debugger->currentAsyncCallChain(); |
1044 return stackTrace ? stackTrace->buildInspectorObjectForTail(m_debugger) | 1044 return stackTrace ? stackTrace->buildInspectorObjectForTail(m_debugger) |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1157 injectedScript); | 1157 injectedScript); |
1158 if (injectedScript) { | 1158 if (injectedScript) { |
1159 m_breakReason = | 1159 m_breakReason = |
1160 isPromiseRejection | 1160 isPromiseRejection |
1161 ? protocol::Debugger::Paused::ReasonEnum::PromiseRejection | 1161 ? protocol::Debugger::Paused::ReasonEnum::PromiseRejection |
1162 : protocol::Debugger::Paused::ReasonEnum::Exception; | 1162 : protocol::Debugger::Paused::ReasonEnum::Exception; |
1163 std::unique_ptr<protocol::Runtime::RemoteObject> obj; | 1163 std::unique_ptr<protocol::Runtime::RemoteObject> obj; |
1164 injectedScript->wrapObject(exception, kBacktraceObjectGroup, false, false, | 1164 injectedScript->wrapObject(exception, kBacktraceObjectGroup, false, false, |
1165 &obj); | 1165 &obj); |
1166 if (obj) { | 1166 if (obj) { |
1167 m_breakAuxData = obj->serialize(); | 1167 m_breakAuxData = obj->toValue(); |
1168 m_breakAuxData->setBoolean("uncaught", isUncaught); | 1168 m_breakAuxData->setBoolean("uncaught", isUncaught); |
1169 } else { | 1169 } else { |
1170 m_breakAuxData = nullptr; | 1170 m_breakAuxData = nullptr; |
1171 } | 1171 } |
1172 // m_breakAuxData might be null after this. | 1172 // m_breakAuxData might be null after this. |
1173 } | 1173 } |
1174 } | 1174 } |
1175 | 1175 |
1176 std::unique_ptr<Array<String16>> hitBreakpointIds = Array<String16>::create(); | 1176 std::unique_ptr<Array<String16>> hitBreakpointIds = Array<String16>::create(); |
1177 | 1177 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 | 1266 |
1267 void V8DebuggerAgentImpl::reset() { | 1267 void V8DebuggerAgentImpl::reset() { |
1268 if (!enabled()) return; | 1268 if (!enabled()) return; |
1269 m_scheduledDebuggerStep = NoStep; | 1269 m_scheduledDebuggerStep = NoStep; |
1270 m_scripts.clear(); | 1270 m_scripts.clear(); |
1271 m_blackboxedPositions.clear(); | 1271 m_blackboxedPositions.clear(); |
1272 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1272 m_breakpointIdToDebuggerBreakpointIds.clear(); |
1273 } | 1273 } |
1274 | 1274 |
1275 } // namespace v8_inspector | 1275 } // namespace v8_inspector |
OLD | NEW |