diff --git a/lldb/source/Plugins/Platform/HOS/PlatformHOS.cpp b/lldb/source/Plugins/Platform/HOS/PlatformHOS.cpp index c279f93682109eeffd3104fb7fa8d3995e1d83ba..3483223ec25086180890e6d14b510ac76f1c8fc4 100644 --- a/lldb/source/Plugins/Platform/HOS/PlatformHOS.cpp +++ b/lldb/source/Plugins/Platform/HOS/PlatformHOS.cpp @@ -36,9 +36,13 @@ LLDB_PLUGIN_DEFINE(PlatformHOS) using PrefixMap = std::pair; -static constexpr std::array PATH_PREFIX_MAP {{ +static constexpr std::array PATH_PREFIX_MAP {{ { "/data", "/data/ohos_data" }, - { "/vendor", "/vendor/ohos/vendor" }, + { "/vendor/aosp/system/lib64/libqdMetaData.system.so", "/system/system_ext/lib64/libqdMetaData.system.so"}, + { "/vendor/aosp/system/lib64/libgralloc.system.qti.so", "/system/system_ext/lib64/libgralloc.system.qti.so"}, + { "/vendor/aosp/vendor/lib64", "/vendor/lib64" }, + { "/vendor/aosp/system/lib64", "/system/lib64" }, + { "/vendor/lib64", "/system/ohos/vendor/lib64" }, { "/system", "/system/ohos/system" }, }}; @@ -132,6 +136,17 @@ PlatformHOS::PlatformHOS(bool is_host) PlatformHOS::~PlatformHOS() {} +ConstString PlatformHOS::GetPluginName() { + if (GetContainer()) { + Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); + static ConstString g_remote_name("remote-hos-inner"); + LLDB_LOGF(log, "PlatformHOS::GetPluginName g_remote_name(%s)", g_remote_name.GetCString()); + return g_remote_name; + } + + return GetPluginNameStatic(IsHost()); +} + ConstString PlatformHOS::GetPluginNameStatic(bool is_host) { Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); if (log) { diff --git a/lldb/source/Plugins/Platform/HOS/PlatformHOS.h b/lldb/source/Plugins/Platform/HOS/PlatformHOS.h index d7ce912e61665883b8abb7cb3de3d9b5e14bf21d..4df6d018252d642ca676314ee9c11a071a2dd354 100644 --- a/lldb/source/Plugins/Platform/HOS/PlatformHOS.h +++ b/lldb/source/Plugins/Platform/HOS/PlatformHOS.h @@ -36,7 +36,7 @@ public: static const char *GetPluginDescriptionStatic(bool is_host); - ConstString GetPluginName() override { return GetPluginNameStatic(IsHost()); } + ConstString GetPluginName() override; uint32_t GetPluginVersion() override { return 1; } diff --git a/lldb/source/Target/ModuleCache.cpp b/lldb/source/Target/ModuleCache.cpp index 2fb6b308b0e5d5b3101104d8241426709b0c694e..765da16e2d07f40b3b97d92a0c7d635eeef5bd87 100644 --- a/lldb/source/Target/ModuleCache.cpp +++ b/lldb/source/Target/ModuleCache.cpp @@ -134,6 +134,15 @@ Status CreateHostSysRootModuleLink(const FileSpec &root_dir_spec, platform_module_spec.GetPath().c_str()); if (FileSystem::Instance().Exists(sysroot_module_path_spec)) { + if (FileSystem::Instance().Exists(local_module_spec)) { + UUID sysroot_module_sp_uuid = (std::make_shared(ModuleSpec(sysroot_module_path_spec)))->GetUUID(); + UUID module_spec_uuid = (std::make_shared(ModuleSpec(local_module_spec)))->GetUUID(); + if (sysroot_module_sp_uuid.IsValid() && (sysroot_module_sp_uuid == module_spec_uuid)) { + delete_existing = false; + } + LLDB_LOGF(log, "CreateHostSysRootModuleLink delete_existing(%i)", delete_existing); + } + if (!delete_existing) return Status();