Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
Show All 24 Lines | |||||
#include "lldb/Symbol/ClangUtil.h" | #include "lldb/Symbol/ClangUtil.h" | ||||
#include "lldb/Symbol/CompileUnit.h" | #include "lldb/Symbol/CompileUnit.h" | ||||
#include "lldb/Symbol/LineTable.h" | #include "lldb/Symbol/LineTable.h" | ||||
#include "lldb/Symbol/ObjectFile.h" | #include "lldb/Symbol/ObjectFile.h" | ||||
#include "lldb/Symbol/SymbolContext.h" | #include "lldb/Symbol/SymbolContext.h" | ||||
#include "lldb/Symbol/SymbolVendor.h" | #include "lldb/Symbol/SymbolVendor.h" | ||||
#include "lldb/Symbol/Variable.h" | #include "lldb/Symbol/Variable.h" | ||||
#include "lldb/Symbol/VariableList.h" | #include "lldb/Symbol/VariableList.h" | ||||
#include "lldb/Utility/Log.h" | |||||
#include "llvm/DebugInfo/CodeView/CVRecord.h" | #include "llvm/DebugInfo/CodeView/CVRecord.h" | ||||
#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h" | #include "llvm/DebugInfo/CodeView/CVTypeVisitor.h" | ||||
#include "llvm/DebugInfo/CodeView/DebugLinesSubsection.h" | #include "llvm/DebugInfo/CodeView/DebugLinesSubsection.h" | ||||
#include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h" | #include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h" | ||||
#include "llvm/DebugInfo/CodeView/RecordName.h" | #include "llvm/DebugInfo/CodeView/RecordName.h" | ||||
#include "llvm/DebugInfo/CodeView/SymbolDeserializer.h" | #include "llvm/DebugInfo/CodeView/SymbolDeserializer.h" | ||||
#include "llvm/DebugInfo/CodeView/SymbolRecordHelpers.h" | #include "llvm/DebugInfo/CodeView/SymbolRecordHelpers.h" | ||||
▲ Show 20 Lines • Show All 275 Lines • ▼ Show 20 Lines | uint32_t SymbolFileNativePDB::CalculateAbilities() { | ||||
return abilities; | return abilities; | ||||
} | } | ||||
void SymbolFileNativePDB::InitializeObject() { | void SymbolFileNativePDB::InitializeObject() { | ||||
m_obj_load_address = m_obj_file->GetBaseAddress().GetFileAddress(); | m_obj_load_address = m_obj_file->GetBaseAddress().GetFileAddress(); | ||||
m_index->SetLoadAddress(m_obj_load_address); | m_index->SetLoadAddress(m_obj_load_address); | ||||
m_index->ParseSectionContribs(); | m_index->ParseSectionContribs(); | ||||
TypeSystem *ts = m_obj_file->GetModule()->GetTypeSystemForLanguage( | auto ts_or_err = m_obj_file->GetModule()->GetTypeSystemForLanguage( | ||||
lldb::eLanguageTypeC_plus_plus); | lldb::eLanguageTypeC_plus_plus); | ||||
if (ts) | if (auto err = ts_or_err.takeError()) { | ||||
ts->SetSymbolFile(this); | LLDB_LOG_ERROR(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_SYMBOLS), | ||||
std::move(err), "Failed to initialize"); | |||||
m_ast = llvm::make_unique<PdbAstBuilder>(*m_obj_file, *m_index); | } else { | ||||
ts_or_err->SetSymbolFile(this); | |||||
auto *clang = llvm::cast_or_null<ClangASTContext>(&ts_or_err.get()); | |||||
lldbassert(clang); | |||||
m_ast = llvm::make_unique<PdbAstBuilder>(*m_obj_file, *m_index, *clang); | |||||
} | |||||
} | } | ||||
uint32_t SymbolFileNativePDB::CalculateNumCompileUnits() { | uint32_t SymbolFileNativePDB::CalculateNumCompileUnits() { | ||||
const DbiModuleList &modules = m_index->dbi().modules(); | const DbiModuleList &modules = m_index->dbi().modules(); | ||||
uint32_t count = modules.getModuleCount(); | uint32_t count = modules.getModuleCount(); | ||||
if (count == 0) | if (count == 0) | ||||
return count; | return count; | ||||
▲ Show 20 Lines • Show All 1,230 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
CompilerDeclContext | CompilerDeclContext | ||||
SymbolFileNativePDB::FindNamespace(ConstString name, | SymbolFileNativePDB::FindNamespace(ConstString name, | ||||
const CompilerDeclContext *parent_decl_ctx) { | const CompilerDeclContext *parent_decl_ctx) { | ||||
return {}; | return {}; | ||||
} | } | ||||
TypeSystem * | llvm::Expected<TypeSystem &> | ||||
SymbolFileNativePDB::GetTypeSystemForLanguage(lldb::LanguageType language) { | SymbolFileNativePDB::GetTypeSystemForLanguage(lldb::LanguageType language) { | ||||
auto type_system = | auto type_system_or_err = | ||||
m_obj_file->GetModule()->GetTypeSystemForLanguage(language); | m_obj_file->GetModule()->GetTypeSystemForLanguage(language); | ||||
if (type_system) | if (type_system_or_err) { | ||||
type_system->SetSymbolFile(this); | type_system_or_err->SetSymbolFile(this); | ||||
return type_system; | } | ||||
return type_system_or_err; | |||||
} | } | ||||
ConstString SymbolFileNativePDB::GetPluginName() { | ConstString SymbolFileNativePDB::GetPluginName() { | ||||
static ConstString g_name("pdb"); | static ConstString g_name("pdb"); | ||||
return g_name; | return g_name; | ||||
} | } | ||||
uint32_t SymbolFileNativePDB::GetPluginVersion() { return 1; } | uint32_t SymbolFileNativePDB::GetPluginVersion() { return 1; } |