From 615873aeea6b3046c77472cc2a0ad6f222784626 Mon Sep 17 00:00:00 2001 From: yang-19970325 Date: Mon, 5 Dec 2022 15:16:39 +0800 Subject: [PATCH] 1.add lexicalvariables to module scope 2.unify the vm naming in debugger_api.cpp and debugger_api.h Issue:#I64N7L Signed-off-by: yang-19970325 Change-Id: I7c4c85ef27da2d4b879def372d309d32967e432b --- tooling/agent/debugger_impl.cpp | 5 +++-- tooling/agent/debugger_impl.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tooling/agent/debugger_impl.cpp b/tooling/agent/debugger_impl.cpp index 654bfab2..bcf3c62c 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 87b66c54..6b3fc929 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); -- Gitee