From 31ef836d222aaa8786d4ac2c36e09e4fd9e02929 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Tue, 3 Dec 2024 17:49:11 -0500 Subject: Replace bad auto symbol for Itanium RTTI --- plugins/rtti/itanium.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'plugins/rtti/itanium.cpp') diff --git a/plugins/rtti/itanium.cpp b/plugins/rtti/itanium.cpp index f7ad9a70..7ac75d94 100644 --- a/plugins/rtti/itanium.cpp +++ b/plugins/rtti/itanium.cpp @@ -247,17 +247,15 @@ std::optional ItaniumRTTIProcessor::ProcessRTTI(uint64_t objectAddr) return std::nullopt; auto typeInfo = TypeInfo(m_view, objectAddr); - auto className = DemangleNameGNU3(m_view, allowMangledClassNames, typeInfo.type_name); + auto className = DemangleNameItanium(m_view, allowMangledClassNames, typeInfo.type_name); if (!className.has_value()) return std::nullopt; auto classInfo = ClassInfo{className.value()}; - // TODO: className starts with 7, 9, 14 - // 7 == class_type - // 9 == si_class_type - // 14 == vmi_class_type - auto typeInfoName = fmt::format("_typeinfo_for_{}", classInfo.className); + auto typeInfoSymbol = m_view->GetSymbolByAddress(objectAddr); + if (typeInfoSymbol != nullptr) + m_view->UndefineAutoSymbol(typeInfoSymbol); m_view->DefineAutoSymbol(new Symbol{DataSymbol, typeInfoName, objectAddr}); if (typeInfoVariant == TIVSIClass) @@ -269,7 +267,7 @@ std::optional ItaniumRTTIProcessor::ProcessRTTI(uint64_t objectAddr) return std::nullopt; auto subTypeInfo = TypeInfo(m_view, siClassTypeInfo.base_type); // Demangle base class name and set - auto baseClassName = DemangleNameGNU3(m_view, allowMangledClassNames, subTypeInfo.type_name); + auto baseClassName = DemangleNameItanium(m_view, allowMangledClassNames, subTypeInfo.type_name); if (!baseClassName.has_value()) { m_logger->LogWarn("Skipping base class with mangled name %llx", siClassTypeInfo.base_type); -- cgit v1.3.1