Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Unified Diff: src/debug/debug-scopes.h

Issue 1653083002: Devtools: expose scopes source location to debugger (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast/scopes.cc ('k') | src/debug/debug-scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug-scopes.h
diff --git a/src/debug/debug-scopes.h b/src/debug/debug-scopes.h
index fbdf632687320ba0c47c3ce7d982a8623aad1f86..80e19810e742f897731e9f80394304e6afba0207 100644
--- a/src/debug/debug-scopes.h
+++ b/src/debug/debug-scopes.h
@@ -31,7 +31,10 @@ class ScopeIterator {
static const int kScopeDetailsTypeIndex = 0;
static const int kScopeDetailsObjectIndex = 1;
static const int kScopeDetailsNameIndex = 2;
- static const int kScopeDetailsSize = 3;
+ static const int kScopeDetailsStartPositionIndex = 3;
+ static const int kScopeDetailsEndPositionIndex = 4;
+ static const int kScopeDetailsFunctionIndex = 5;
+ static const int kScopeDetailsSize = 6;
enum Option { DEFAULT, IGNORE_NESTED_SCOPES, COLLECT_NON_LOCALS };
@@ -83,10 +86,18 @@ class ScopeIterator {
#endif
private:
+ struct ExtendedScopeInfo {
+ ExtendedScopeInfo(Handle<ScopeInfo> info, int start, int end)
+ : scope_info(info), start_position(start), end_position(end) {}
+ Handle<ScopeInfo> scope_info;
+ int start_position;
+ int end_position;
+ };
+
Isolate* isolate_;
FrameInspector* const frame_inspector_;
Handle<Context> context_;
- List<Handle<ScopeInfo> > nested_scope_chain_;
+ List<ExtendedScopeInfo> nested_scope_chain_;
HashMap* non_locals_;
bool seen_script_scope_;
bool failed_;
@@ -140,6 +151,13 @@ class ScopeIterator {
Handle<JSObject> scope_object,
KeyCollectionType type);
+ // Get the chain of nested scopes within this scope for the source statement
+ // position. The scopes will be added to the list from the outermost scope to
+ // the innermost scope. Only nested block, catch or with scopes are tracked
+ // and will be returned, but no inner function scopes.
+ void GetNestedScopeChain(Isolate* isolate, Scope* scope,
+ int statement_position);
+
DISALLOW_IMPLICIT_CONSTRUCTORS(ScopeIterator);
};
« no previous file with comments | « src/ast/scopes.cc ('k') | src/debug/debug-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698