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; |