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

Side by Side Diff: src/debug/debug.cc

Issue 2742713003: [debugger] correctly annotate scripts with debug id. (Closed)
Patch Set: address comments Created 3 years, 9 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
« no previous file with comments | « src/compiler.cc ('k') | test/debugger/debug/debug-step.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2007 matching lines...) Expand 10 before | Expand all | Expand 10 after
2018 created_by_user = 2018 created_by_user =
2019 !it.done() && 2019 !it.done() &&
2020 !IsFrameBlackboxed(it.frame()); 2020 !IsFrameBlackboxed(it.frame());
2021 } 2021 }
2022 debug_delegate_->PromiseEventOccurred( 2022 debug_delegate_->PromiseEventOccurred(
2023 Utils::ToLocal(debug_scope.GetContext()), type, id, parent_id, 2023 Utils::ToLocal(debug_scope.GetContext()), type, id, parent_id,
2024 created_by_user); 2024 created_by_user);
2025 } 2025 }
2026 2026
2027 void Debug::ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script) { 2027 void Debug::ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script) {
2028 // Attach the correct debug id to the script. The debug id is used by the
2029 // inspector to filter scripts by native context.
2030 FixedArray* array = isolate_->native_context()->embedder_data();
2031 script->set_context_data(array->get(v8::Context::kDebugIdIndex));
2028 if (ignore_events()) return; 2032 if (ignore_events()) return;
2029 if (script->type() != i::Script::TYPE_NORMAL && 2033 if (script->type() != i::Script::TYPE_NORMAL &&
2030 script->type() != i::Script::TYPE_WASM) { 2034 script->type() != i::Script::TYPE_WASM) {
2031 return; 2035 return;
2032 } 2036 }
2033 if (!debug_delegate_) return; 2037 if (!debug_delegate_) return;
2034 SuppressDebug while_processing(this); 2038 SuppressDebug while_processing(this);
2035 DebugScope debug_scope(this); 2039 DebugScope debug_scope(this);
2036 if (debug_scope.failed()) return; 2040 if (debug_scope.failed()) return;
2037 HandleScope scope(isolate_); 2041 HandleScope scope(isolate_);
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
2451 isolate_->Throw(*isolate_->factory()->NewEvalError( 2455 isolate_->Throw(*isolate_->factory()->NewEvalError(
2452 MessageTemplate::kNoSideEffectDebugEvaluate)); 2456 MessageTemplate::kNoSideEffectDebugEvaluate));
2453 } 2457 }
2454 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_); 2458 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_);
2455 isolate_->debug()->UpdateHookOnFunctionCall(); 2459 isolate_->debug()->UpdateHookOnFunctionCall();
2456 isolate_->debug()->side_effect_check_failed_ = false; 2460 isolate_->debug()->side_effect_check_failed_ = false;
2457 } 2461 }
2458 2462
2459 } // namespace internal 2463 } // namespace internal
2460 } // namespace v8 2464 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | test/debugger/debug/debug-step.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698