diff options
Diffstat (limited to 'deps/v8/src/inspector/v8-stack-trace-impl.cc')
-rw-r--r-- | deps/v8/src/inspector/v8-stack-trace-impl.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/deps/v8/src/inspector/v8-stack-trace-impl.cc b/deps/v8/src/inspector/v8-stack-trace-impl.cc index c46de4465d..0b3c0839d3 100644 --- a/deps/v8/src/inspector/v8-stack-trace-impl.cc +++ b/deps/v8/src/inspector/v8-stack-trace-impl.cc @@ -1,4 +1,5 @@ // Copyright 2016 the V8 project authors. All rights reserved. +// // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,6 +11,8 @@ #include "src/inspector/v8-stack-trace-impl.h" #include <algorithm> +#include <memory> +#include <vector> #include "../../third_party/inspector_protocol/crdtp/json.h" #include "src/debug/debug-interface.h" @@ -313,6 +316,21 @@ StringView V8StackTraceImpl::topFunctionName() const { return toStringView(m_frames[0]->functionName()); } +std::vector<V8StackFrame> V8StackTraceImpl::frames() const { + std::vector<V8StackFrame> ret; + ret.reserve(m_frames.size()); + + for (const auto& frame : m_frames) { + if (frame) { + ret.emplace_back(V8StackFrame{ + toStringView(frame->sourceURL()), toStringView(frame->functionName()), + frame->lineNumber() + 1, frame->columnNumber() + 1}); + } + } + + return ret; +} + std::unique_ptr<protocol::Runtime::StackTrace> V8StackTraceImpl::buildInspectorObjectImpl(V8Debugger* debugger) const { return buildInspectorObjectImpl(debugger, m_maxAsyncDepth); |