diff options
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.cpp')
| -rw-r--r-- | lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.cpp b/lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.cpp index 1634372bb905..d019415cb67a 100644 --- a/lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/wasm-DYLD/DynamicLoaderWasmDYLD.cpp @@ -14,6 +14,7 @@ #include "lldb/Core/Section.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/LLDBLog.h" #include "lldb/Utility/Log.h" using namespace lldb; @@ -51,7 +52,7 @@ DynamicLoader *DynamicLoaderWasmDYLD::CreateInstance(Process *process, } void DynamicLoaderWasmDYLD::DidAttach() { - Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER)); + Log *log = GetLog(LLDBLog::DynamicLoader); LLDB_LOGF(log, "DynamicLoaderWasmDYLD::%s()", __FUNCTION__); // Ask the process for the list of loaded WebAssembly modules. @@ -63,3 +64,19 @@ ThreadPlanSP DynamicLoaderWasmDYLD::GetStepThroughTrampolinePlan(Thread &thread, bool stop) { return ThreadPlanSP(); } + +lldb::ModuleSP DynamicLoaderWasmDYLD::LoadModuleAtAddress( + const lldb_private::FileSpec &file, lldb::addr_t link_map_addr, + lldb::addr_t base_addr, bool base_addr_is_offset) { + if (ModuleSP module_sp = DynamicLoader::LoadModuleAtAddress( + file, link_map_addr, base_addr, base_addr_is_offset)) + return module_sp; + + if (ModuleSP module_sp = m_process->ReadModuleFromMemory(file, base_addr)) { + UpdateLoadedSections(module_sp, link_map_addr, base_addr, false); + m_process->GetTarget().GetImages().AppendIfNeeded(module_sp); + return module_sp; + } + + return nullptr; +} |
