Fix release application can not support tuning

Issue:#I8MYXJ

Signed-off-by: yang-19970325 <yangyang585@huawei.com>
Change-Id: I2caf7685b8726c28bb526d7507490897870c75e2
This commit is contained in:
yang-19970325 2023-12-09 10:23:32 +08:00
parent bd7f43e2ac
commit a784a802fa
2 changed files with 9 additions and 6 deletions

View File

@ -78,6 +78,11 @@ bool DebuggerImpl::NotifyScriptParsed(ScriptId scriptId, const std::string &file
}
#endif
// The release application does not require scriptParsed
if (!vm_->GetJsDebuggerManager()->IsDebugApp()) {
return false;
}
const JSPandaFile *jsPandaFile = JSPandaFileManager::GetInstance()->FindJSPandaFile(fileName.c_str()).get();
if (jsPandaFile == nullptr) {
LOG_DEBUGGER(ERROR) << "NotifyScriptParsed: unknown file: " << fileName;

View File

@ -153,15 +153,13 @@ Dispatcher::Dispatcher(const EcmaVM *vm, ProtocolChannel *channel)
std::make_unique<TracingImpl::DispatcherImpl>(channel, std::move(tracing));
#endif
// debugger
auto runtime = std::make_unique<RuntimeImpl>(vm, channel);
// only debugApp need to initialize debugger
if (vm->GetJsDebuggerManager()->IsDebugApp()) {
auto debugger = std::make_unique<DebuggerImpl>(vm, channel, runtime.get());
dispatchers_["Debugger"] =
std::make_unique<DebuggerImpl::DispatcherImpl>(channel, std::move(debugger));
}
auto debugger = std::make_unique<DebuggerImpl>(vm, channel, runtime.get());
dispatchers_["Runtime"] =
std::make_unique<RuntimeImpl::DispatcherImpl>(channel, std::move(runtime));
dispatchers_["Debugger"] =
std::make_unique<DebuggerImpl::DispatcherImpl>(channel, std::move(debugger));
auto dom = std::make_unique<DomImpl>();
dispatchers_["DOM"] =