summaryrefslogtreecommitdiff
path: root/deps/v8/src/debug/debug-stack-trace-iterator.h
blob: 174e400e1fb02e3dc615e30809c74d36cbcdd0ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2017 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.

#ifndef V8_DEBUG_DEBUG_STACK_TRACE_ITERATOR_H_
#define V8_DEBUG_DEBUG_STACK_TRACE_ITERATOR_H_

#include "src/debug/debug-frames.h"
#include "src/debug/debug-interface.h"
#include "src/frames.h"

namespace v8 {
namespace internal {

class DebugStackTraceIterator final : public debug::StackTraceIterator {
 public:
  DebugStackTraceIterator(Isolate* isolate, int index);
  ~DebugStackTraceIterator() override;

  bool Done() const override;
  void Advance() override;

  int GetContextId() const override;
  v8::Local<v8::Value> GetReceiver() const override;
  v8::Local<v8::Value> GetReturnValue() const override;
  v8::Local<v8::String> GetFunctionName() const override;
  v8::Local<v8::debug::Script> GetScript() const override;
  debug::Location GetSourceLocation() const override;
  v8::Local<v8::Function> GetFunction() const override;
  std::unique_ptr<v8::debug::ScopeIterator> GetScopeIterator() const override;

  bool Restart() override;
  v8::MaybeLocal<v8::Value> Evaluate(v8::Local<v8::String> source,
                                     bool throw_on_side_effect) override;

 private:
  Isolate* isolate_;
  StackTraceFrameIterator iterator_;
  std::unique_ptr<FrameInspector> frame_inspector_;
  int inlined_frame_index_;
  bool is_top_frame_;
};
}  // namespace internal
}  // namespace v8

#endif  // V8_DEBUG_DEBUG_STACK_TRACE_ITERATOR_H_