summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp39
1 files changed, 35 insertions, 4 deletions
diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
index 7b7c237fdd2..d0082925a3c 100644
--- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
+++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
@@ -20,6 +20,7 @@
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Symbol/TypeMap.h"
+#include "lldb/Symbol/TypeList.h"
#include "lldb/Utility/RegularExpression.h"
#include "llvm/DebugInfo/PDB/GenericError.h"
@@ -318,8 +319,33 @@ SymbolFilePDB::ParseFunctionBlocks(const lldb_private::SymbolContext &sc) {
}
size_t SymbolFilePDB::ParseTypes(const lldb_private::SymbolContext &sc) {
- // TODO: Implement this
- return size_t();
+ lldbassert(sc.module_sp.get());
+ size_t num_added = 0;
+ auto results_up = m_session_up->getGlobalScope()->findAllChildren();
+ if (!results_up)
+ return 0;
+ while (auto symbol_up = results_up->getNext()) {
+ switch (symbol_up->getSymTag()) {
+ case PDB_SymType::Enum:
+ case PDB_SymType::UDT:
+ case PDB_SymType::Typedef:
+ break;
+ default:
+ continue;
+ }
+
+ auto type_uid = symbol_up->getSymIndexId();
+ if (m_types.find(type_uid) != m_types.end())
+ continue;
+
+ // This should cause the type to get cached and stored in the `m_types`
+ // lookup.
+ if (!ResolveTypeUID(symbol_up->getSymIndexId()))
+ continue;
+
+ ++num_added;
+ }
+ return num_added;
}
size_t
@@ -349,8 +375,11 @@ lldb_private::Type *SymbolFilePDB::ResolveTypeUID(lldb::user_id_t type_uid) {
return nullptr;
lldb::TypeSP result = pdb->CreateLLDBTypeFromPDBType(*pdb_type);
- if (result.get())
+ if (result.get()) {
m_types.insert(std::make_pair(type_uid, result));
+ auto type_list = GetTypeList();
+ type_list->Insert(result);
+ }
return result.get();
}
@@ -649,7 +678,9 @@ size_t SymbolFilePDB::FindTypes(
return 0;
}
-lldb_private::TypeList *SymbolFilePDB::GetTypeList() { return nullptr; }
+lldb_private::TypeList *SymbolFilePDB::GetTypeList() {
+ return m_obj_file->GetModule()->GetTypeList();
+}
size_t SymbolFilePDB::GetTypes(lldb_private::SymbolContextScope *sc_scope,
uint32_t type_mask,
OpenPOWER on IntegriCloud