Commit 5f8c0a13 authored by kozyatinskiy's avatar kozyatinskiy Committed by Commit bot

[inspector] added flag for injected-script-source debugging

With flag we can debug injected-script-source in inspector-test or from DevTools frontend as regular user code. We need this when working on new features or debugging issues, it's for internal purpose only and doesn't provide any benefits for end users.

Flag: --expose-inspector-scripts

BUG=none
R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2767873002
Cr-Commit-Position: refs/heads/master@{#44039}
parent 66ded52f
...@@ -9465,7 +9465,9 @@ MaybeLocal<UnboundScript> debug::CompileInspectorScript(Isolate* v8_isolate, ...@@ -9465,7 +9465,9 @@ MaybeLocal<UnboundScript> debug::CompileInspectorScript(Isolate* v8_isolate,
result = i::Compiler::GetSharedFunctionInfoForScript( result = i::Compiler::GetSharedFunctionInfoForScript(
str, i::Handle<i::Object>(), 0, 0, origin_options, str, i::Handle<i::Object>(), 0, 0, origin_options,
i::Handle<i::Object>(), isolate->native_context(), NULL, &script_data, i::Handle<i::Object>(), isolate->native_context(), NULL, &script_data,
ScriptCompiler::kNoCompileOptions, i::INSPECTOR_CODE); ScriptCompiler::kNoCompileOptions,
i::FLAG_expose_inspector_scripts ? i::NOT_NATIVES_CODE
: i::INSPECTOR_CODE);
has_pending_exception = result.is_null(); has_pending_exception = result.is_null();
RETURN_ON_FAILED_EXECUTION(UnboundScript); RETURN_ON_FAILED_EXECUTION(UnboundScript);
} }
......
...@@ -851,6 +851,10 @@ DEFINE_BOOL( ...@@ -851,6 +851,10 @@ DEFINE_BOOL(
"print debug messages for side-effect-free debug-evaluate for testing") "print debug messages for side-effect-free debug-evaluate for testing")
DEFINE_BOOL(hard_abort, true, "abort by crashing") DEFINE_BOOL(hard_abort, true, "abort by crashing")
// inspector
DEFINE_BOOL(expose_inspector_scripts, false,
"expose injected-script-source.js for debugging")
// execution.cc // execution.cc
DEFINE_INT(stack_size, V8_DEFAULT_STACK_SIZE_KB, DEFINE_INT(stack_size, V8_DEFAULT_STACK_SIZE_KB,
"default size of stack region v8 is allowed to use (in kBytes)") "default size of stack region v8 is allowed to use (in kBytes)")
......
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
Protocol.Debugger.onPaused(message => {
let url = InspectorTest._scriptMap.get(message.params.callFrames[0].location.scriptId).url;
if (url !== 'test.js') {
InspectorTest.log('InjectedSciptSource on stack.');
InspectorTest.completeTest();
}
Protocol.Debugger.stepInto();
});
InspectorTest.setupScriptMap();
Protocol.Debugger.enable();
Protocol.Debugger.pause();
Protocol.Runtime.evaluate({expression: 'console.log(42)//# sourceURL=test.js'})
.then(() => InspectorTest.log('InjectedSciptSource was not reached'))
.then(InspectorTest.completeTest);
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --expose-inspector-scripts
Protocol.Debugger.onPaused(message => {
let url = InspectorTest._scriptMap.get(message.params.callFrames[0].location.scriptId).url;
if (url !== 'test.js') {
InspectorTest.log('InjectedSciptSource on stack.');
InspectorTest.completeTest();
}
Protocol.Debugger.stepInto();
});
InspectorTest.setupScriptMap();
Protocol.Debugger.enable();
Protocol.Debugger.pause();
Protocol.Runtime.evaluate({expression: 'console.log(42)//# sourceURL=test.js'})
.then(() => InspectorTest.log('InjectedSciptSource was not reached'))
.then(InspectorTest.completeTest);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment