1 // Copyright 2017 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef V8_DEBUG_DEBUG_STACK_TRACE_ITERATOR_H_ 6 #define V8_DEBUG_DEBUG_STACK_TRACE_ITERATOR_H_ 7 8 #include "src/debug/debug-frames.h" 9 #include "src/debug/debug-interface.h" 10 #include "src/frames.h" 11 12 namespace v8 { 13 namespace internal { 14 15 class DebugStackTraceIterator final : public debug::StackTraceIterator { 16 public: 17 DebugStackTraceIterator(Isolate* isolate, int index); 18 ~DebugStackTraceIterator() override; 19 20 bool Done() const override; 21 void Advance() override; 22 23 int GetContextId() const override; 24 v8::MaybeLocal<v8::Value> GetReceiver() const override; 25 v8::Local<v8::Value> GetReturnValue() const override; 26 v8::Local<v8::String> GetFunctionDebugName() const override; 27 v8::Local<v8::debug::Script> GetScript() const override; 28 debug::Location GetSourceLocation() const override; 29 v8::Local<v8::Function> GetFunction() const override; 30 std::unique_ptr<v8::debug::ScopeIterator> GetScopeIterator() const override; 31 32 bool Restart() override; 33 v8::MaybeLocal<v8::Value> Evaluate(v8::Local<v8::String> source, 34 bool throw_on_side_effect) override; 35 36 private: 37 Isolate* isolate_; 38 StackTraceFrameIterator iterator_; 39 std::unique_ptr<FrameInspector> frame_inspector_; 40 int inlined_frame_index_; 41 bool is_top_frame_; 42 }; 43 } // namespace internal 44 } // namespace v8 45 46 #endif // V8_DEBUG_DEBUG_STACK_TRACE_ITERATOR_H_ 47