5 #ifndef V8_DEBUG_DEBUG_SCOPES_H_ 6 #define V8_DEBUG_DEBUG_SCOPES_H_ 10 #include "src/debug/debug-frames.h" 11 #include "src/frames.h" 36 static const int kScopeDetailsTypeIndex = 0;
37 static const int kScopeDetailsObjectIndex = 1;
38 static const int kScopeDetailsNameIndex = 2;
39 static const int kScopeDetailsStartPositionIndex = 3;
40 static const int kScopeDetailsEndPositionIndex = 4;
41 static const int kScopeDetailsFunctionIndex = 5;
42 static const int kScopeDetailsSize = 6;
44 enum Option { DEFAULT, IGNORE_NESTED_SCOPES, COLLECT_NON_LOCALS };
47 Option options = DEFAULT);
56 bool Done()
const {
return context_.is_null(); }
65 ScopeType
Type()
const;
69 enum class Mode { STACK, ALL };
75 bool DeclaresLocals(Mode mode)
const;
89 bool HasPositionInfo();
98 bool InInnerScope()
const {
return !function_.is_null(); }
99 bool HasContext()
const;
101 DCHECK(HasContext());
115 Scope* start_scope_ =
nullptr;
116 Scope* current_scope_ =
nullptr;
117 bool seen_script_scope_ =
false;
120 return frame_inspector_->javascript_frame();
123 int GetSourcePosition();
125 void TryParseAndRetrieveScopes(ScopeIterator::Option option);
129 void UnwrapEvaluationContext();
131 typedef std::function<bool(Handle<String> name,
Handle<Object> value)>
148 void VisitScope(
const Visitor& visitor, Mode mode)
const;
149 void VisitLocalScope(
const Visitor& visitor, Mode mode)
const;
150 void VisitScriptScope(
const Visitor& visitor)
const;
151 void VisitModuleScope(
const Visitor& visitor)
const;
152 bool VisitLocals(
const Visitor& visitor, Mode mode)
const;
162 #endif // V8_DEBUG_DEBUG_SCOPES_H_