diff --git a/tooling/agent/debugger_impl.cpp b/tooling/agent/debugger_impl.cpp index 654bfab21662c65149d86319bd82a83e3b0a889a..bcf3c62c51f941bde1256d01c74df3949d72fc5c 100644 --- a/tooling/agent/debugger_impl.cpp +++ b/tooling/agent/debugger_impl.cpp @@ -950,7 +950,7 @@ bool DebuggerImpl::GenerateCallFrame(CallFrame *callFrame, std::vector> scopeChain; scopeChain.emplace_back(GetLocalScopeChain(frameHandler, &thisObj)); if (jsPandaFile != nullptr && !jsPandaFile->IsBundlePack()) { - scopeChain.emplace_back(GetModuleScopeChain()); + scopeChain.emplace_back(GetModuleScopeChain(frameHandler)); } scopeChain.emplace_back(GetGlobalScopeChain()); @@ -1014,7 +1014,7 @@ std::unique_ptr DebuggerImpl::GetLocalScopeChain(const FrameHandler *fram return localScope; } -std::unique_ptr DebuggerImpl::GetModuleScopeChain() +std::unique_ptr DebuggerImpl::GetModuleScopeChain(const FrameHandler *frameHandler) { auto moduleScope = std::make_unique(); @@ -1028,6 +1028,7 @@ std::unique_ptr DebuggerImpl::GetModuleScopeChain() runtime_->properties_[runtime_->curObjectId_++] = Global(vm_, moduleObj); JSThread *thread = vm_->GetJSThread(); DebuggerApi::GetModuleVariables(vm_, moduleObj, thread); + DebuggerApi::GetLexicalVariables(vm_, moduleObj, frameHandler); return moduleScope; } diff --git a/tooling/agent/debugger_impl.h b/tooling/agent/debugger_impl.h index 87b66c5439db0bdc6ec8c57c15c87e992e3b3226..6b3fc929edcb6b007971d4263bb3590d90650730 100644 --- a/tooling/agent/debugger_impl.h +++ b/tooling/agent/debugger_impl.h @@ -146,7 +146,7 @@ private: void SaveCallFrameHandler(const FrameHandler *frameHandler); std::unique_ptr GetLocalScopeChain(const FrameHandler *frameHandler, std::unique_ptr *thisObj); - std::unique_ptr GetModuleScopeChain(); + std::unique_ptr GetModuleScopeChain(const FrameHandler *frameHandler); std::unique_ptr GetGlobalScopeChain(); void GetLocalVariables(const FrameHandler *frameHandler, panda_file::File::EntityId methodId, const JSPandaFile *jsPandaFile, Local &thisVal, Local &localObj);