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

Unified Diff: src/debug/debug.cc

Issue 2710953004: [inspector] added restrictToFunction flag for getPossibleBreakpoints (Closed)
Patch Set: Created 3 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
Index: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index a08744a161db36747a9770da53c60b5d289f94a6..e8c6b5eb8d8a23cba5564aa1180324509a491aaa 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -1342,7 +1342,25 @@ void FindBreakablePositions(Handle<DebugInfo> debug_info, int start_position,
} // namespace
bool Debug::GetPossibleBreakpoints(Handle<Script> script, int start_position,
- int end_position, std::set<int>* positions) {
+ int end_position,
+ bool ignore_nested_functions,
+ std::set<int>* positions) {
+ if (ignore_nested_functions) {
+ Handle<Object> result =
+ FindSharedFunctionInfoInScript(script, start_position);
+ if (result->IsUndefined(isolate_)) return false;
+
+ // Make sure the function has set up the debug info.
+ Handle<SharedFunctionInfo> shared =
+ Handle<SharedFunctionInfo>::cast(result);
+ if (!EnsureDebugInfo(shared)) return false;
+
+ Handle<DebugInfo> debug_info(shared->GetDebugInfo());
+ FindBreakablePositions(debug_info, start_position, end_position,
+ BREAK_POSITION_ALIGNED, positions);
+ return true;
+ }
+
while (true) {
HandleScope scope(isolate_);
List<Handle<SharedFunctionInfo>> candidates;
« no previous file with comments | « src/debug/debug.h ('k') | src/debug/debug-interface.h » ('j') | src/inspector/js_protocol.json » ('J')

Powered by Google App Engine
This is Rietveld 408576698