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

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

Issue 2742713003: [debugger] correctly annotate scripts with debug id. (Closed)
Patch Set: 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
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 2010 matching lines...) Expand 10 before | Expand all | Expand 10 after
2021 !it.done() && 2021 !it.done() &&
2022 it.frame()->function()->shared()->IsSubjectToDebugging() && 2022 it.frame()->function()->shared()->IsSubjectToDebugging() &&
2023 !IsFrameBlackboxed(it.frame()); 2023 !IsFrameBlackboxed(it.frame());
2024 } 2024 }
2025 debug_delegate_->PromiseEventOccurred( 2025 debug_delegate_->PromiseEventOccurred(
2026 Utils::ToLocal(debug_scope.GetContext()), type, id, parent_id, 2026 Utils::ToLocal(debug_scope.GetContext()), type, id, parent_id,
2027 created_by_user); 2027 created_by_user);
2028 } 2028 }
2029 2029
2030 void Debug::ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script) { 2030 void Debug::ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script) {
2031 // Attach the correct debug id to the script. The debug id is used by the
2032 // inspector to filter scripts by native context.
2033 FixedArray* array = isolate_->native_context()->embedder_data();
2034 script->set_context_data(array->get(v8::Context::kDebugIdIndex));
2031 if (ignore_events()) return; 2035 if (ignore_events()) return;
2032 if (script->type() != i::Script::TYPE_NORMAL && 2036 if (script->type() != i::Script::TYPE_NORMAL &&
2033 script->type() != i::Script::TYPE_WASM) { 2037 script->type() != i::Script::TYPE_WASM) {
2034 return; 2038 return;
2035 } 2039 }
2036 if (!debug_delegate_) return; 2040 if (!debug_delegate_) return;
2037 SuppressDebug while_processing(this); 2041 SuppressDebug while_processing(this);
2038 DebugScope debug_scope(this); 2042 DebugScope debug_scope(this);
2039 if (debug_scope.failed()) return; 2043 if (debug_scope.failed()) return;
2040 HandleScope scope(isolate_); 2044 HandleScope scope(isolate_);
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
2452 isolate_->Throw(*isolate_->factory()->NewEvalError( 2456 isolate_->Throw(*isolate_->factory()->NewEvalError(
2453 MessageTemplate::kNoSideEffectDebugEvaluate)); 2457 MessageTemplate::kNoSideEffectDebugEvaluate));
2454 } 2458 }
2455 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_); 2459 isolate_->set_needs_side_effect_check(old_needs_side_effect_check_);
2456 isolate_->debug()->UpdateHookOnFunctionCall(); 2460 isolate_->debug()->UpdateHookOnFunctionCall();
2457 isolate_->debug()->side_effect_check_failed_ = false; 2461 isolate_->debug()->side_effect_check_failed_ = false;
2458 } 2462 }
2459 2463
2460 } // namespace internal 2464 } // namespace internal
2461 } // namespace v8 2465 } // namespace v8
OLDNEW
« src/compiler.cc ('K') | « 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