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

Unified Diff: src/debug/debug.cc

Issue 2710953004: [inspector] added restrictToFunction flag for getPossibleBreakpoints (Closed)
Patch Set: addressed comments 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
« no previous file with comments | « src/debug/debug.h ('k') | src/debug/debug-interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index a08744a161db36747a9770da53c60b5d289f94a6..89ea025ea3ac869b148e78d7bffb6fadd93d861b 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -1342,7 +1342,24 @@ 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 restrict_to_function,
+ std::set<int>* positions) {
+ if (restrict_to_function) {
+ 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698