| 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" |
| 11 #include "src/inspector/inspected-context.h" | 11 #include "src/inspector/inspected-context.h" |
| 12 #include "src/inspector/java-script-call-frame.h" | 12 #include "src/inspector/java-script-call-frame.h" |
| 13 #include "src/inspector/protocol/Protocol.h" | 13 #include "src/inspector/protocol/Protocol.h" |
| 14 #include "src/inspector/remote-object-id.h" | 14 #include "src/inspector/remote-object-id.h" |
| 15 #include "src/inspector/script-breakpoint.h" | 15 #include "src/inspector/script-breakpoint.h" |
| 16 #include "src/inspector/search-util.h" | 16 #include "src/inspector/search-util.h" |
| 17 #include "src/inspector/string-util.h" | 17 #include "src/inspector/string-util.h" |
| 18 #include "src/inspector/v8-debugger-script.h" | 18 #include "src/inspector/v8-debugger-script.h" |
| 19 #include "src/inspector/v8-debugger.h" | 19 #include "src/inspector/v8-debugger.h" |
| 20 #include "src/inspector/v8-inspector-impl.h" | 20 #include "src/inspector/v8-inspector-impl.h" |
| 21 #include "src/inspector/v8-inspector-session-impl.h" | 21 #include "src/inspector/v8-inspector-session-impl.h" |
| 22 #include "src/inspector/v8-regex.h" | 22 #include "src/inspector/v8-regex.h" |
| 23 #include "src/inspector/v8-runtime-agent-impl.h" | 23 #include "src/inspector/v8-runtime-agent-impl.h" |
| 24 #include "src/inspector/v8-stack-trace-impl.h" | 24 #include "src/inspector/v8-stack-trace-impl.h" |
| 25 #include "src/inspector/v8-value-copier.h" |
| 25 | 26 |
| 26 #include "include/v8-inspector.h" | 27 #include "include/v8-inspector.h" |
| 27 | 28 |
| 28 namespace v8_inspector { | 29 namespace v8_inspector { |
| 29 | 30 |
| 30 using protocol::Array; | 31 using protocol::Array; |
| 31 using protocol::Maybe; | 32 using protocol::Maybe; |
| 32 using protocol::Debugger::BreakpointId; | 33 using protocol::Debugger::BreakpointId; |
| 33 using protocol::Debugger::CallFrame; | 34 using protocol::Debugger::CallFrame; |
| 34 using protocol::Runtime::ExceptionDetails; | 35 using protocol::Runtime::ExceptionDetails; |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 if (!callFrames) return; | 554 if (!callFrames) return; |
| 554 *newCallFrames = std::move(callFrames); | 555 *newCallFrames = std::move(callFrames); |
| 555 *asyncStackTrace = currentAsyncStackTrace(); | 556 *asyncStackTrace = currentAsyncStackTrace(); |
| 556 } | 557 } |
| 557 | 558 |
| 558 void V8DebuggerAgentImpl::restartFrame( | 559 void V8DebuggerAgentImpl::restartFrame( |
| 559 ErrorString* errorString, const String16& callFrameId, | 560 ErrorString* errorString, const String16& callFrameId, |
| 560 std::unique_ptr<Array<CallFrame>>* newCallFrames, | 561 std::unique_ptr<Array<CallFrame>>* newCallFrames, |
| 561 Maybe<StackTrace>* asyncStackTrace) { | 562 Maybe<StackTrace>* asyncStackTrace) { |
| 562 if (!assertPaused(errorString)) return; | 563 if (!assertPaused(errorString)) return; |
| 563 InjectedScript::CallFrameScope scope( | 564 InjectedScript::CallFrameScope scope(m_inspector, m_session->contextGroupId(), |
| 564 errorString, m_inspector, m_session->contextGroupId(), callFrameId); | 565 callFrameId); |
| 565 if (!scope.initialize()) return; | 566 Response response = scope.initialize(); |
| 567 if (!response.isSuccess()) { |
| 568 *errorString = response.errorMessage(); |
| 569 return; |
| 570 } |
| 566 if (scope.frameOrdinal() >= m_pausedCallFrames.size()) { | 571 if (scope.frameOrdinal() >= m_pausedCallFrames.size()) { |
| 567 *errorString = "Could not find call frame with given id"; | 572 *errorString = "Could not find call frame with given id"; |
| 568 return; | 573 return; |
| 569 } | 574 } |
| 570 | 575 |
| 571 v8::Local<v8::Value> resultValue; | 576 v8::Local<v8::Value> resultValue; |
| 572 v8::Local<v8::Boolean> result; | 577 v8::Local<v8::Boolean> result; |
| 573 if (!m_pausedCallFrames[scope.frameOrdinal()]->restart().ToLocal( | 578 if (!m_pausedCallFrames[scope.frameOrdinal()]->restart().ToLocal( |
| 574 &resultValue) || | 579 &resultValue) || |
| 575 scope.tryCatch().HasCaught() || | 580 scope.tryCatch().HasCaught() || |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 } | 713 } |
| 709 | 714 |
| 710 void V8DebuggerAgentImpl::evaluateOnCallFrame( | 715 void V8DebuggerAgentImpl::evaluateOnCallFrame( |
| 711 ErrorString* errorString, const String16& callFrameId, | 716 ErrorString* errorString, const String16& callFrameId, |
| 712 const String16& expression, const Maybe<String16>& objectGroup, | 717 const String16& expression, const Maybe<String16>& objectGroup, |
| 713 const Maybe<bool>& includeCommandLineAPI, const Maybe<bool>& silent, | 718 const Maybe<bool>& includeCommandLineAPI, const Maybe<bool>& silent, |
| 714 const Maybe<bool>& returnByValue, const Maybe<bool>& generatePreview, | 719 const Maybe<bool>& returnByValue, const Maybe<bool>& generatePreview, |
| 715 std::unique_ptr<RemoteObject>* result, | 720 std::unique_ptr<RemoteObject>* result, |
| 716 Maybe<protocol::Runtime::ExceptionDetails>* exceptionDetails) { | 721 Maybe<protocol::Runtime::ExceptionDetails>* exceptionDetails) { |
| 717 if (!assertPaused(errorString)) return; | 722 if (!assertPaused(errorString)) return; |
| 718 InjectedScript::CallFrameScope scope( | 723 InjectedScript::CallFrameScope scope(m_inspector, m_session->contextGroupId(), |
| 719 errorString, m_inspector, m_session->contextGroupId(), callFrameId); | 724 callFrameId); |
| 720 if (!scope.initialize()) return; | 725 Response response = scope.initialize(); |
| 726 if (!response.isSuccess()) { |
| 727 *errorString = response.errorMessage(); |
| 728 return; |
| 729 } |
| 721 if (scope.frameOrdinal() >= m_pausedCallFrames.size()) { | 730 if (scope.frameOrdinal() >= m_pausedCallFrames.size()) { |
| 722 *errorString = "Could not find call frame with given id"; | 731 *errorString = "Could not find call frame with given id"; |
| 723 return; | 732 return; |
| 724 } | 733 } |
| 725 | 734 |
| 726 if (includeCommandLineAPI.fromMaybe(false) && !scope.installCommandLineAPI()) | 735 if (includeCommandLineAPI.fromMaybe(false)) scope.installCommandLineAPI(); |
| 727 return; | |
| 728 if (silent.fromMaybe(false)) scope.ignoreExceptionsAndMuteConsole(); | 736 if (silent.fromMaybe(false)) scope.ignoreExceptionsAndMuteConsole(); |
| 729 | 737 |
| 730 v8::MaybeLocal<v8::Value> maybeResultValue = | 738 v8::MaybeLocal<v8::Value> maybeResultValue = |
| 731 m_pausedCallFrames[scope.frameOrdinal()]->evaluate( | 739 m_pausedCallFrames[scope.frameOrdinal()]->evaluate( |
| 732 toV8String(m_isolate, expression)); | 740 toV8String(m_isolate, expression)); |
| 733 | 741 |
| 734 // Re-initialize after running client's code, as it could have destroyed | 742 // Re-initialize after running client's code, as it could have destroyed |
| 735 // context or session. | 743 // context or session. |
| 736 if (!scope.initialize()) return; | 744 response = scope.initialize(); |
| 737 scope.injectedScript()->wrapEvaluateResult( | 745 if (!response.isSuccess()) { |
| 738 errorString, maybeResultValue, scope.tryCatch(), | 746 *errorString = response.errorMessage(); |
| 739 objectGroup.fromMaybe(""), returnByValue.fromMaybe(false), | 747 return; |
| 740 generatePreview.fromMaybe(false), result, exceptionDetails); | 748 } |
| 749 response = scope.injectedScript()->wrapEvaluateResult( |
| 750 maybeResultValue, scope.tryCatch(), objectGroup.fromMaybe(""), |
| 751 returnByValue.fromMaybe(false), generatePreview.fromMaybe(false), result, |
| 752 exceptionDetails); |
| 753 if (!response.isSuccess()) *errorString = response.errorMessage(); |
| 741 } | 754 } |
| 742 | 755 |
| 743 void V8DebuggerAgentImpl::setVariableValue( | 756 void V8DebuggerAgentImpl::setVariableValue( |
| 744 ErrorString* errorString, int scopeNumber, const String16& variableName, | 757 ErrorString* errorString, int scopeNumber, const String16& variableName, |
| 745 std::unique_ptr<protocol::Runtime::CallArgument> newValueArgument, | 758 std::unique_ptr<protocol::Runtime::CallArgument> newValueArgument, |
| 746 const String16& callFrameId) { | 759 const String16& callFrameId) { |
| 747 if (!checkEnabled(errorString)) return; | 760 if (!checkEnabled(errorString)) return; |
| 748 if (!assertPaused(errorString)) return; | 761 if (!assertPaused(errorString)) return; |
| 749 InjectedScript::CallFrameScope scope( | 762 InjectedScript::CallFrameScope scope(m_inspector, m_session->contextGroupId(), |
| 750 errorString, m_inspector, m_session->contextGroupId(), callFrameId); | 763 callFrameId); |
| 751 if (!scope.initialize()) return; | 764 Response response = scope.initialize(); |
| 752 | 765 if (!response.isSuccess()) { |
| 766 *errorString = response.errorMessage(); |
| 767 return; |
| 768 } |
| 753 v8::Local<v8::Value> newValue; | 769 v8::Local<v8::Value> newValue; |
| 754 if (!scope.injectedScript() | 770 response = scope.injectedScript()->resolveCallArgument(newValueArgument.get(), |
| 755 ->resolveCallArgument(errorString, newValueArgument.get()) | 771 &newValue); |
| 756 .ToLocal(&newValue)) | 772 if (!response.isSuccess()) { |
| 773 *errorString = response.errorMessage(); |
| 757 return; | 774 return; |
| 775 } |
| 758 | 776 |
| 759 if (scope.frameOrdinal() >= m_pausedCallFrames.size()) { | 777 if (scope.frameOrdinal() >= m_pausedCallFrames.size()) { |
| 760 *errorString = "Could not find call frame with given id"; | 778 *errorString = "Could not find call frame with given id"; |
| 761 return; | 779 return; |
| 762 } | 780 } |
| 763 v8::MaybeLocal<v8::Value> result = | 781 v8::MaybeLocal<v8::Value> result = |
| 764 m_pausedCallFrames[scope.frameOrdinal()]->setVariableValue( | 782 m_pausedCallFrames[scope.frameOrdinal()]->setVariableValue( |
| 765 scopeNumber, toV8String(m_isolate, variableName), newValue); | 783 scopeNumber, toV8String(m_isolate, variableName), newValue); |
| 766 if (scope.tryCatch().HasCaught() || result.IsEmpty()) { | 784 if (scope.tryCatch().HasCaught() || result.IsEmpty()) { |
| 767 *errorString = "Internal error"; | 785 *errorString = "Internal error"; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 else if (m_scheduledDebuggerStep == StepOut) | 918 else if (m_scheduledDebuggerStep == StepOut) |
| 901 m_skipNextDebuggerStepOut = true; | 919 m_skipNextDebuggerStepOut = true; |
| 902 } | 920 } |
| 903 } | 921 } |
| 904 } | 922 } |
| 905 | 923 |
| 906 std::unique_ptr<Array<CallFrame>> V8DebuggerAgentImpl::currentCallFrames( | 924 std::unique_ptr<Array<CallFrame>> V8DebuggerAgentImpl::currentCallFrames( |
| 907 ErrorString* errorString) { | 925 ErrorString* errorString) { |
| 908 if (m_pausedContext.IsEmpty() || !m_pausedCallFrames.size()) | 926 if (m_pausedContext.IsEmpty() || !m_pausedCallFrames.size()) |
| 909 return Array<CallFrame>::create(); | 927 return Array<CallFrame>::create(); |
| 910 ErrorString ignored; | |
| 911 v8::HandleScope handles(m_isolate); | 928 v8::HandleScope handles(m_isolate); |
| 912 v8::Local<v8::Context> debuggerContext = | 929 v8::Local<v8::Context> debuggerContext = |
| 913 v8::DebugInterface::GetDebugContext(m_isolate); | 930 v8::DebugInterface::GetDebugContext(m_isolate); |
| 914 v8::Context::Scope contextScope(debuggerContext); | 931 v8::Context::Scope contextScope(debuggerContext); |
| 915 | 932 |
| 916 v8::Local<v8::Array> objects = v8::Array::New(m_isolate); | 933 v8::Local<v8::Array> objects = v8::Array::New(m_isolate); |
| 917 | 934 |
| 918 for (size_t frameOrdinal = 0; frameOrdinal < m_pausedCallFrames.size(); | 935 for (size_t frameOrdinal = 0; frameOrdinal < m_pausedCallFrames.size(); |
| 919 ++frameOrdinal) { | 936 ++frameOrdinal) { |
| 920 const std::unique_ptr<JavaScriptCallFrame>& currentCallFrame = | 937 const std::unique_ptr<JavaScriptCallFrame>& currentCallFrame = |
| 921 m_pausedCallFrames[frameOrdinal]; | 938 m_pausedCallFrames[frameOrdinal]; |
| 922 | 939 |
| 923 v8::Local<v8::Object> details = currentCallFrame->details(); | 940 v8::Local<v8::Object> details = currentCallFrame->details(); |
| 924 if (hasInternalError(errorString, details.IsEmpty())) | 941 if (hasInternalError(errorString, details.IsEmpty())) |
| 925 return Array<CallFrame>::create(); | 942 return Array<CallFrame>::create(); |
| 926 | 943 |
| 927 int contextId = currentCallFrame->contextId(); | 944 int contextId = currentCallFrame->contextId(); |
| 928 InjectedScript* injectedScript = | 945 |
| 929 contextId ? m_session->findInjectedScript(&ignored, contextId) | 946 InjectedScript* injectedScript = nullptr; |
| 930 : nullptr; | 947 if (contextId) m_session->findInjectedScript(contextId, injectedScript); |
| 931 | 948 |
| 932 String16 callFrameId = | 949 String16 callFrameId = |
| 933 RemoteCallFrameId::serialize(contextId, static_cast<int>(frameOrdinal)); | 950 RemoteCallFrameId::serialize(contextId, static_cast<int>(frameOrdinal)); |
| 934 if (hasInternalError( | 951 if (hasInternalError( |
| 935 errorString, | 952 errorString, |
| 936 !details | 953 !details |
| 937 ->Set(debuggerContext, | 954 ->Set(debuggerContext, |
| 938 toV8StringInternalized(m_isolate, "callFrameId"), | 955 toV8StringInternalized(m_isolate, "callFrameId"), |
| 939 toV8String(m_isolate, callFrameId)) | 956 toV8String(m_isolate, callFrameId)) |
| 940 .FromMaybe(false))) | 957 .FromMaybe(false))) |
| 941 return Array<CallFrame>::create(); | 958 return Array<CallFrame>::create(); |
| 942 | 959 |
| 943 if (injectedScript) { | 960 if (injectedScript) { |
| 944 v8::Local<v8::Value> scopeChain; | 961 v8::Local<v8::Value> scopeChain; |
| 945 if (hasInternalError( | 962 if (hasInternalError( |
| 946 errorString, | 963 errorString, |
| 947 !details->Get(debuggerContext, | 964 !details->Get(debuggerContext, |
| 948 toV8StringInternalized(m_isolate, "scopeChain")) | 965 toV8StringInternalized(m_isolate, "scopeChain")) |
| 949 .ToLocal(&scopeChain) || | 966 .ToLocal(&scopeChain) || |
| 950 !scopeChain->IsArray())) | 967 !scopeChain->IsArray())) |
| 951 return Array<CallFrame>::create(); | 968 return Array<CallFrame>::create(); |
| 952 v8::Local<v8::Array> scopeChainArray = scopeChain.As<v8::Array>(); | 969 v8::Local<v8::Array> scopeChainArray = scopeChain.As<v8::Array>(); |
| 953 if (!injectedScript->wrapPropertyInArray( | 970 Response response = injectedScript->wrapPropertyInArray( |
| 954 errorString, scopeChainArray, | 971 scopeChainArray, toV8StringInternalized(m_isolate, "object"), |
| 955 toV8StringInternalized(m_isolate, "object"), | 972 backtraceObjectGroup); |
| 956 backtraceObjectGroup)) | 973 if (!response.isSuccess()) { |
| 974 *errorString = response.errorMessage(); |
| 957 return Array<CallFrame>::create(); | 975 return Array<CallFrame>::create(); |
| 958 if (!injectedScript->wrapObjectProperty( | 976 } |
| 959 errorString, details, toV8StringInternalized(m_isolate, "this"), | 977 response = injectedScript->wrapObjectProperty( |
| 960 backtraceObjectGroup)) | 978 details, toV8StringInternalized(m_isolate, "this"), |
| 979 backtraceObjectGroup); |
| 980 if (!response.isSuccess()) { |
| 981 *errorString = response.errorMessage(); |
| 961 return Array<CallFrame>::create(); | 982 return Array<CallFrame>::create(); |
| 983 } |
| 962 if (details | 984 if (details |
| 963 ->Has(debuggerContext, | 985 ->Has(debuggerContext, |
| 964 toV8StringInternalized(m_isolate, "returnValue")) | 986 toV8StringInternalized(m_isolate, "returnValue")) |
| 965 .FromMaybe(false)) { | 987 .FromMaybe(false)) { |
| 966 if (!injectedScript->wrapObjectProperty( | 988 response = injectedScript->wrapObjectProperty( |
| 967 errorString, details, | 989 details, toV8StringInternalized(m_isolate, "returnValue"), |
| 968 toV8StringInternalized(m_isolate, "returnValue"), | 990 backtraceObjectGroup); |
| 969 backtraceObjectGroup)) | 991 if (!response.isSuccess()) { |
| 992 *errorString = response.errorMessage(); |
| 970 return Array<CallFrame>::create(); | 993 return Array<CallFrame>::create(); |
| 994 } |
| 971 } | 995 } |
| 972 } else { | 996 } else { |
| 973 if (hasInternalError(errorString, !details | 997 if (hasInternalError(errorString, !details |
| 974 ->Set(debuggerContext, | 998 ->Set(debuggerContext, |
| 975 toV8StringInternalized( | 999 toV8StringInternalized( |
| 976 m_isolate, "scopeChain"), | 1000 m_isolate, "scopeChain"), |
| 977 v8::Array::New(m_isolate, 0)) | 1001 v8::Array::New(m_isolate, 0)) |
| 978 .FromMaybe(false))) | 1002 .FromMaybe(false))) |
| 979 return Array<CallFrame>::create(); | 1003 return Array<CallFrame>::create(); |
| 980 v8::Local<v8::Object> remoteObject = v8::Object::New(m_isolate); | 1004 v8::Local<v8::Object> remoteObject = v8::Object::New(m_isolate); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1003 } | 1027 } |
| 1004 | 1028 |
| 1005 if (hasInternalError( | 1029 if (hasInternalError( |
| 1006 errorString, | 1030 errorString, |
| 1007 !objects | 1031 !objects |
| 1008 ->Set(debuggerContext, static_cast<int>(frameOrdinal), details) | 1032 ->Set(debuggerContext, static_cast<int>(frameOrdinal), details) |
| 1009 .FromMaybe(false))) | 1033 .FromMaybe(false))) |
| 1010 return Array<CallFrame>::create(); | 1034 return Array<CallFrame>::create(); |
| 1011 } | 1035 } |
| 1012 | 1036 |
| 1013 std::unique_ptr<protocol::Value> protocolValue = | 1037 std::unique_ptr<protocol::Value> protocolValue; |
| 1014 toProtocolValue(errorString, debuggerContext, objects); | 1038 Response response = toProtocolValue(debuggerContext, objects, &protocolValue); |
| 1015 if (!protocolValue) return Array<CallFrame>::create(); | 1039 if (!response.isSuccess()) return Array<CallFrame>::create(); |
| 1016 protocol::ErrorSupport errorSupport; | 1040 protocol::ErrorSupport errorSupport; |
| 1017 std::unique_ptr<Array<CallFrame>> callFrames = | 1041 std::unique_ptr<Array<CallFrame>> callFrames = |
| 1018 Array<CallFrame>::parse(protocolValue.get(), &errorSupport); | 1042 Array<CallFrame>::parse(protocolValue.get(), &errorSupport); |
| 1019 if (hasInternalError(errorString, !callFrames)) | 1043 if (hasInternalError(errorString, !callFrames)) |
| 1020 return Array<CallFrame>::create(); | 1044 return Array<CallFrame>::create(); |
| 1021 return callFrames; | 1045 return callFrames; |
| 1022 } | 1046 } |
| 1023 | 1047 |
| 1024 std::unique_ptr<StackTrace> V8DebuggerAgentImpl::currentAsyncStackTrace() { | 1048 std::unique_ptr<StackTrace> V8DebuggerAgentImpl::currentAsyncStackTrace() { |
| 1025 if (m_pausedContext.IsEmpty()) return nullptr; | 1049 if (m_pausedContext.IsEmpty()) return nullptr; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 // Skip pauses inside V8 internal scripts and on syntax errors. | 1144 // Skip pauses inside V8 internal scripts and on syntax errors. |
| 1121 if (!topCallFrame) return RequestContinue; | 1145 if (!topCallFrame) return RequestContinue; |
| 1122 | 1146 |
| 1123 DCHECK(m_pausedContext.IsEmpty()); | 1147 DCHECK(m_pausedContext.IsEmpty()); |
| 1124 JavaScriptCallFrames frames = m_debugger->currentCallFrames(); | 1148 JavaScriptCallFrames frames = m_debugger->currentCallFrames(); |
| 1125 m_pausedCallFrames.swap(frames); | 1149 m_pausedCallFrames.swap(frames); |
| 1126 m_pausedContext.Reset(m_isolate, context); | 1150 m_pausedContext.Reset(m_isolate, context); |
| 1127 v8::HandleScope handles(m_isolate); | 1151 v8::HandleScope handles(m_isolate); |
| 1128 | 1152 |
| 1129 if (!exception.IsEmpty()) { | 1153 if (!exception.IsEmpty()) { |
| 1130 ErrorString ignored; | 1154 InjectedScript* injectedScript = nullptr; |
| 1131 InjectedScript* injectedScript = | 1155 m_session->findInjectedScript(V8Debugger::contextId(context), |
| 1132 m_session->findInjectedScript(&ignored, V8Debugger::contextId(context)); | 1156 injectedScript); |
| 1133 if (injectedScript) { | 1157 if (injectedScript) { |
| 1134 m_breakReason = | 1158 m_breakReason = |
| 1135 isPromiseRejection | 1159 isPromiseRejection |
| 1136 ? protocol::Debugger::Paused::ReasonEnum::PromiseRejection | 1160 ? protocol::Debugger::Paused::ReasonEnum::PromiseRejection |
| 1137 : protocol::Debugger::Paused::ReasonEnum::Exception; | 1161 : protocol::Debugger::Paused::ReasonEnum::Exception; |
| 1138 ErrorString errorString; | 1162 std::unique_ptr<protocol::Runtime::RemoteObject> obj; |
| 1139 auto obj = injectedScript->wrapObject(&errorString, exception, | 1163 injectedScript->wrapObject(exception, backtraceObjectGroup, false, false, |
| 1140 backtraceObjectGroup); | 1164 &obj); |
| 1141 m_breakAuxData = obj ? obj->serialize() : nullptr; | 1165 m_breakAuxData = obj ? obj->serialize() : nullptr; |
| 1142 // m_breakAuxData might be null after this. | 1166 // m_breakAuxData might be null after this. |
| 1143 } | 1167 } |
| 1144 } | 1168 } |
| 1145 | 1169 |
| 1146 std::unique_ptr<Array<String16>> hitBreakpointIds = Array<String16>::create(); | 1170 std::unique_ptr<Array<String16>> hitBreakpointIds = Array<String16>::create(); |
| 1147 | 1171 |
| 1148 for (const auto& point : hitBreakpoints) { | 1172 for (const auto& point : hitBreakpoints) { |
| 1149 DebugServerBreakpointToBreakpointIdAndSourceMap::iterator | 1173 DebugServerBreakpointToBreakpointIdAndSourceMap::iterator |
| 1150 breakpointIterator = m_serverBreakpoints.find(point); | 1174 breakpointIterator = m_serverBreakpoints.find(point); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1242 | 1266 |
| 1243 void V8DebuggerAgentImpl::reset() { | 1267 void V8DebuggerAgentImpl::reset() { |
| 1244 if (!enabled()) return; | 1268 if (!enabled()) return; |
| 1245 m_scheduledDebuggerStep = NoStep; | 1269 m_scheduledDebuggerStep = NoStep; |
| 1246 m_scripts.clear(); | 1270 m_scripts.clear(); |
| 1247 m_blackboxedPositions.clear(); | 1271 m_blackboxedPositions.clear(); |
| 1248 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1272 m_breakpointIdToDebuggerBreakpointIds.clear(); |
| 1249 } | 1273 } |
| 1250 | 1274 |
| 1251 } // namespace v8_inspector | 1275 } // namespace v8_inspector |
| OLD | NEW |