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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/debug/debug.h" 5 #include "src/debug/debug.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 } else { 1335 } else {
1336 DCHECK(debug_info->HasDebugBytecodeArray()); 1336 DCHECK(debug_info->HasDebugBytecodeArray());
1337 BytecodeArrayBreakIterator it(debug_info); 1337 BytecodeArrayBreakIterator it(debug_info);
1338 GetBreakablePositions(&it, start_position, end_position, alignment, 1338 GetBreakablePositions(&it, start_position, end_position, alignment,
1339 positions); 1339 positions);
1340 } 1340 }
1341 } 1341 }
1342 } // namespace 1342 } // namespace
1343 1343
1344 bool Debug::GetPossibleBreakpoints(Handle<Script> script, int start_position, 1344 bool Debug::GetPossibleBreakpoints(Handle<Script> script, int start_position,
1345 int end_position, std::set<int>* positions) { 1345 int end_position,
1346 bool ignore_nested_functions,
1347 std::set<int>* positions) {
1348 if (ignore_nested_functions) {
1349 Handle<Object> result =
1350 FindSharedFunctionInfoInScript(script, start_position);
1351 if (result->IsUndefined(isolate_)) return false;
1352
1353 // Make sure the function has set up the debug info.
1354 Handle<SharedFunctionInfo> shared =
1355 Handle<SharedFunctionInfo>::cast(result);
1356 if (!EnsureDebugInfo(shared)) return false;
1357
1358 Handle<DebugInfo> debug_info(shared->GetDebugInfo());
1359 FindBreakablePositions(debug_info, start_position, end_position,
1360 BREAK_POSITION_ALIGNED, positions);
1361 return true;
1362 }
1363
1346 while (true) { 1364 while (true) {
1347 HandleScope scope(isolate_); 1365 HandleScope scope(isolate_);
1348 List<Handle<SharedFunctionInfo>> candidates; 1366 List<Handle<SharedFunctionInfo>> candidates;
1349 SharedFunctionInfo::ScriptIterator iterator(script); 1367 SharedFunctionInfo::ScriptIterator iterator(script);
1350 for (SharedFunctionInfo* info = iterator.Next(); info != nullptr; 1368 for (SharedFunctionInfo* info = iterator.Next(); info != nullptr;
1351 info = iterator.Next()) { 1369 info = iterator.Next()) {
1352 if (info->end_position() < start_position || 1370 if (info->end_position() < start_position ||
1353 info->start_position() >= end_position) { 1371 info->start_position() >= end_position) {
1354 continue; 1372 continue;
1355 } 1373 }
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
2408 isolate_->Throw(*isolate_->factory()->NewEvalError( 2426 isolate_->Throw(*isolate_->factory()->NewEvalError(
2409 MessageTemplate::kNoSideEffectDebugEvaluate)); 2427 MessageTemplate::kNoSideEffectDebugEvaluate));
2410 } 2428 }
2411 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_); 2429 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_);
2412 isolate_->debug()->UpdateHookOnFunctionCall(); 2430 isolate_->debug()->UpdateHookOnFunctionCall();
2413 isolate_->debug()->side_effect_check_failed_ = false; 2431 isolate_->debug()->side_effect_check_failed_ = false;
2414 } 2432 }
2415 2433
2416 } // namespace internal 2434 } // namespace internal
2417 } // namespace v8 2435 } // namespace v8
OLDNEW
« 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