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 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 v8::debug::GetDebugContext(m_isolate); | 937 v8::debug::GetDebugContext(m_isolate); |
938 v8::Context::Scope contextScope(debuggerContext); | 938 v8::Context::Scope contextScope(debuggerContext); |
939 | 939 |
940 v8::Local<v8::Array> objects = v8::Array::New(m_isolate); | 940 v8::Local<v8::Array> objects = v8::Array::New(m_isolate); |
941 | 941 |
942 for (size_t frameOrdinal = 0; frameOrdinal < m_pausedCallFrames.size(); | 942 for (size_t frameOrdinal = 0; frameOrdinal < m_pausedCallFrames.size(); |
943 ++frameOrdinal) { | 943 ++frameOrdinal) { |
944 const std::unique_ptr<JavaScriptCallFrame>& currentCallFrame = | 944 const std::unique_ptr<JavaScriptCallFrame>& currentCallFrame = |
945 m_pausedCallFrames[frameOrdinal]; | 945 m_pausedCallFrames[frameOrdinal]; |
946 | 946 |
947 v8::Local<v8::Object> details; | 947 v8::Local<v8::Object> details = currentCallFrame->details(); |
948 if (!currentCallFrame->details().ToLocal(&details)) | 948 if (details.IsEmpty()) return Response::InternalError(); |
949 return Response::InternalError(); | |
950 | 949 |
951 int contextId = currentCallFrame->contextId(); | 950 int contextId = currentCallFrame->contextId(); |
952 | 951 |
953 InjectedScript* injectedScript = nullptr; | 952 InjectedScript* injectedScript = nullptr; |
954 if (contextId) m_session->findInjectedScript(contextId, injectedScript); | 953 if (contextId) m_session->findInjectedScript(contextId, injectedScript); |
955 | 954 |
956 String16 callFrameId = | 955 String16 callFrameId = |
957 RemoteCallFrameId::serialize(contextId, static_cast<int>(frameOrdinal)); | 956 RemoteCallFrameId::serialize(contextId, static_cast<int>(frameOrdinal)); |
958 if (!details | 957 if (!details |
959 ->Set(debuggerContext, | 958 ->Set(debuggerContext, |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1268 | 1267 |
1269 void V8DebuggerAgentImpl::reset() { | 1268 void V8DebuggerAgentImpl::reset() { |
1270 if (!enabled()) return; | 1269 if (!enabled()) return; |
1271 m_scheduledDebuggerStep = NoStep; | 1270 m_scheduledDebuggerStep = NoStep; |
1272 m_scripts.clear(); | 1271 m_scripts.clear(); |
1273 m_blackboxedPositions.clear(); | 1272 m_blackboxedPositions.clear(); |
1274 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1273 m_breakpointIdToDebuggerBreakpointIds.clear(); |
1275 } | 1274 } |
1276 | 1275 |
1277 } // namespace v8_inspector | 1276 } // namespace v8_inspector |
OLD | NEW |