LLDB mainline
UdtRecordCompleter.cpp
Go to the documentation of this file.
2
3#include "PdbAstBuilder.h"
4#include "PdbIndex.h"
5#include "PdbSymUid.h"
6#include "PdbUtil.h"
7
12#include "SymbolFileNativePDB.h"
13#include "lldb/Core/Address.h"
14#include "lldb/Symbol/Type.h"
18#include "lldb/lldb-forward.h"
19
20#include "llvm/ADT/STLExtras.h"
21#include "llvm/DebugInfo/CodeView/SymbolDeserializer.h"
22#include "llvm/DebugInfo/CodeView/TypeDeserializer.h"
23#include "llvm/DebugInfo/CodeView/TypeIndex.h"
24#include "llvm/DebugInfo/PDB/Native/GlobalsStream.h"
25#include "llvm/DebugInfo/PDB/Native/TpiStream.h"
26#include "llvm/DebugInfo/PDB/PDBTypes.h"
27#include <optional>
28
29using namespace llvm::codeview;
30using namespace llvm::pdb;
31using namespace lldb;
32using namespace lldb_private;
33using namespace lldb_private::npdb;
34
35using Error = llvm::Error;
36
38 PdbTypeSymId id, CompilerType &derived_ct, clang::TagDecl &tag_decl,
39 PdbAstBuilder &ast_builder, PdbIndex &index,
40 llvm::DenseMap<clang::Decl *, DeclStatus> &decl_to_status,
41 llvm::DenseMap<lldb::opaque_compiler_type_t,
42 llvm::SmallSet<std::pair<llvm::StringRef, CompilerType>, 8>>
43 &cxx_record_map)
44 : m_cv_tag_record(CVTagRecord::create(index.tpi().getType(id.index))),
45 m_id(id), m_derived_ct(derived_ct), m_tag_decl(tag_decl),
46 m_ast_builder(ast_builder), m_index(index),
47 m_decl_to_status(decl_to_status), m_cxx_record_map(cxx_record_map) {
48 switch (m_cv_tag_record.kind()) {
49 case CVTagRecord::Enum:
50 break;
51 case CVTagRecord::Union:
52 m_layout.bit_size = m_cv_tag_record.asUnion().getSize() * 8;
53 m_record.record.kind = Member::Union;
54 break;
55 case CVTagRecord::Class:
56 case CVTagRecord::Struct:
57 m_layout.bit_size = m_cv_tag_record.asClass().getSize() * 8;
58 m_record.record.kind = Member::Struct;
59 break;
60 }
61}
62
64 llvm::codeview::TypeIndex ti, llvm::codeview::MemberAccess access,
65 std::optional<uint64_t> vtable_idx) {
66 PdbTypeSymId type_id(ti);
67 clang::QualType qt = m_ast_builder.GetOrCreateClangType(type_id);
68
69 CVType udt_cvt = m_index.tpi().getType(ti);
70
71 std::unique_ptr<clang::CXXBaseSpecifier> base_spec =
72 m_ast_builder.clang().CreateBaseClassSpecifier(
73 qt.getAsOpaquePtr(), TranslateMemberAccess(access),
74 vtable_idx.has_value(), udt_cvt.kind() == LF_CLASS);
75 if (!base_spec)
76 return {};
77
78 m_bases.push_back(
79 std::make_pair(vtable_idx.value_or(0), std::move(base_spec)));
80
81 return qt;
82}
83
84void UdtRecordCompleter::AddMethod(llvm::StringRef name, TypeIndex type_idx,
85 MemberAccess access, MethodOptions options,
86 MemberAttributes attrs) {
87 clang::QualType method_qt =
88 m_ast_builder.GetOrCreateClangType(PdbTypeSymId(type_idx));
89 if (method_qt.isNull())
90 return;
91 CompilerType method_ct = m_ast_builder.ToCompilerType(method_qt);
93 lldb::opaque_compiler_type_t derived_opaque_ty =
94 m_derived_ct.GetOpaqueQualType();
95 auto iter = m_cxx_record_map.find(derived_opaque_ty);
96 if (iter != m_cxx_record_map.end()) {
97 if (iter->getSecond().contains({name, method_ct})) {
98 return;
99 }
100 }
101
102 lldb::AccessType access_type = TranslateMemberAccess(access);
103 bool is_artificial = (options & MethodOptions::CompilerGenerated) ==
104 MethodOptions::CompilerGenerated;
105 m_ast_builder.clang().AddMethodToCXXRecordType(
106 derived_opaque_ty, name.data(), /*asm_label=*/{}, method_ct, access_type,
107 attrs.isVirtual(), attrs.isStatic(), false, false, false, is_artificial);
108
109 m_cxx_record_map[derived_opaque_ty].insert({name, method_ct});
110}
111
112Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
113 BaseClassRecord &base) {
114 clang::QualType base_qt =
115 AddBaseClassForTypeIndex(base.Type, base.getAccess());
116
117 if (base_qt.isNull())
118 return llvm::Error::success();
119 auto decl =
120 m_ast_builder.clang().GetAsCXXRecordDecl(base_qt.getAsOpaquePtr());
121 lldbassert(decl);
122
123 auto offset = clang::CharUnits::fromQuantity(base.getBaseOffset());
124 m_layout.base_offsets.insert(std::make_pair(decl, offset));
125
126 return llvm::Error::success();
127}
128
129Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
130 VirtualBaseClassRecord &base) {
131 AddBaseClassForTypeIndex(base.BaseType, base.getAccess(), base.VTableIndex);
132
133 return Error::success();
134}
135
136Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
137 ListContinuationRecord &cont) {
138 return Error::success();
139}
140
141Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
142 VFPtrRecord &vfptr) {
143 return Error::success();
144}
145
146Error UdtRecordCompleter::visitKnownMember(
147 CVMemberRecord &cvr, StaticDataMemberRecord &static_data_member) {
148 clang::QualType member_type =
149 m_ast_builder.GetOrCreateClangType(PdbTypeSymId(static_data_member.Type));
150 if (member_type.isNull())
151 return llvm::Error::success();
152
153 CompilerType member_ct = m_ast_builder.ToCompilerType(member_type);
154
155 lldb::AccessType access =
156 TranslateMemberAccess(static_data_member.getAccess());
158 m_derived_ct, static_data_member.Name, member_ct, access);
159
160 // Static constant members may be a const[expr] declaration.
161 // Query the symbol's value as the variable initializer if valid.
162 if (member_ct.IsConst() && member_ct.IsCompleteType()) {
163 // Reconstruct the full name for the static member. Use the names as given
164 // in the PDB. This ensures we match the compiler's style of names (e.g.
165 // "A<B<int> >::Foo" vs "A<B<int>>::Foo").
166 std::string qual_name =
167 (m_cv_tag_record.name() + "::" + static_data_member.Name).str();
168
169 auto results =
170 m_index.globals().findRecordsByName(qual_name, m_index.symrecords());
171
172 for (const auto &result : results) {
173 if (result.second.kind() == SymbolKind::S_CONSTANT) {
174 ConstantSym constant(SymbolRecordKind::ConstantSym);
175 cantFail(SymbolDeserializer::deserializeAs<ConstantSym>(result.second,
176 constant));
177
178 clang::QualType qual_type = decl->getType();
179 unsigned type_width = decl->getASTContext().getIntWidth(qual_type);
180 unsigned constant_width = constant.Value.getBitWidth();
181
182 if (qual_type->isIntegralOrEnumerationType()) {
183 if (type_width >= constant_width) {
185 decl, constant.Value.extOrTrunc(type_width));
186 } else {
188 "Class '{0}' has a member '{1}' of type '{2}' ({3} bits) "
189 "which resolves to a wider constant value ({4} bits). "
190 "Ignoring constant.",
191 m_derived_ct.GetTypeName(), static_data_member.Name,
192 member_ct.GetTypeName(), type_width, constant_width);
193 }
194 } else {
195 lldb::BasicType basic_type_enum = member_ct.GetBasicTypeEnumeration();
196 switch (basic_type_enum) {
200 if (type_width == constant_width) {
202 decl, basic_type_enum == lldb::eBasicTypeFloat
203 ? llvm::APFloat(constant.Value.bitsToFloat())
204 : llvm::APFloat(constant.Value.bitsToDouble()));
205 decl->setConstexpr(true);
206 } else {
207 LLDB_LOG(
209 "Class '{0}' has a member '{1}' of type '{2}' ({3} bits) "
210 "which resolves to a constant value of mismatched width "
211 "({4} bits). Ignoring constant.",
212 m_derived_ct.GetTypeName(), static_data_member.Name,
213 member_ct.GetTypeName(), type_width, constant_width);
214 }
215 break;
216 default:
217 break;
218 }
219 }
220 break;
221 }
222 }
223 }
224
225 // FIXME: Add a PdbSymUid namespace for field list members and update
226 // the m_uid_to_decl map with this decl.
227 return Error::success();
228}
229
230Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
231 NestedTypeRecord &nested) {
232 // Typedefs can only be added on structs.
233 if (m_record.record.kind != Member::Struct)
234 return Error::success();
235
236 clang::QualType qt =
237 m_ast_builder.GetOrCreateClangType(PdbTypeSymId(nested.Type, false));
238 if (qt.isNull())
239 return Error::success();
240 CompilerType ct = m_ast_builder.ToCompilerType(qt);
241
242 // There's no distinction between nested types and typedefs, so check if we
243 // encountered a nested type.
244 auto *pdb = static_cast<SymbolFileNativePDB *>(
245 m_ast_builder.clang().GetSymbolFile()->GetBackingSymbolFile());
246 std::optional<TypeIndex> parent = pdb->GetParentType(nested.Type);
247 if (parent && *parent == m_id.index && ct.GetTypeName(true) == nested.Name)
248 return Error::success();
249
250 clang::DeclContext *decl_ctx =
251 m_ast_builder.GetOrCreateClangDeclContextForUid(m_id);
252 if (!decl_ctx)
253 return Error::success();
254
255 std::string name = nested.Name.str();
256 ct.CreateTypedef(name.c_str(), m_ast_builder.ToCompilerDeclContext(decl_ctx),
257 0);
258 return Error::success();
259}
260
261Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
262 DataMemberRecord &data_member) {
263
264 uint64_t offset = data_member.FieldOffset * 8;
265 uint32_t bitfield_width = 0;
266
267 TypeIndex ti(data_member.Type);
268 if (!ti.isSimple()) {
269 CVType cvt = m_index.tpi().getType(ti);
270 if (cvt.kind() == LF_BITFIELD) {
271 BitFieldRecord bfr;
272 llvm::cantFail(TypeDeserializer::deserializeAs<BitFieldRecord>(cvt, bfr));
273 offset += bfr.BitOffset;
274 bitfield_width = bfr.BitSize;
275 ti = bfr.Type;
276 }
277 }
278
279 clang::QualType member_qt =
280 m_ast_builder.GetOrCreateClangType(PdbTypeSymId(ti));
281 if (member_qt.isNull())
282 return Error::success();
283 TypeSystemClang::RequireCompleteType(m_ast_builder.ToCompilerType(member_qt));
284 lldb::AccessType access = TranslateMemberAccess(data_member.getAccess());
285 size_t field_size =
286 bitfield_width ? bitfield_width : GetSizeOfType(ti, m_index.tpi()) * 8;
287 if (field_size == 0)
288 return Error::success();
289 m_record.CollectMember(data_member.Name, offset, field_size, member_qt, access,
290 bitfield_width);
291 return Error::success();
292}
293
294Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
295 OneMethodRecord &one_method) {
296 AddMethod(one_method.Name, one_method.Type, one_method.getAccess(),
297 one_method.getOptions(), one_method.Attrs);
298
299 return Error::success();
300}
301
302Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
303 OverloadedMethodRecord &overloaded) {
304 TypeIndex method_list_idx = overloaded.MethodList;
305
306 CVType method_list_type = m_index.tpi().getType(method_list_idx);
307 assert(method_list_type.kind() == LF_METHODLIST);
308
309 MethodOverloadListRecord method_list;
310 llvm::cantFail(TypeDeserializer::deserializeAs<MethodOverloadListRecord>(
311 method_list_type, method_list));
312
313 for (const OneMethodRecord &method : method_list.Methods)
314 AddMethod(overloaded.Name, method.Type, method.getAccess(),
315 method.getOptions(), method.Attrs);
316
317 return Error::success();
318}
319
320Error UdtRecordCompleter::visitKnownMember(CVMemberRecord &cvr,
321 EnumeratorRecord &enumerator) {
322 Declaration decl;
323 llvm::StringRef name = DropNameScope(enumerator.getName());
324
325 m_ast_builder.clang().AddEnumerationValueToEnumerationType(
326 m_derived_ct, decl, name.str().c_str(), enumerator.Value);
327 return Error::success();
328}
329
331 // Ensure the correct order for virtual bases.
332 llvm::stable_sort(m_bases, llvm::less_first());
333
334 std::vector<std::unique_ptr<clang::CXXBaseSpecifier>> bases;
335 bases.reserve(m_bases.size());
336 for (auto &ib : m_bases)
337 bases.push_back(std::move(ib.second));
338
340 // Make sure all base classes refer to complete types and not forward
341 // declarations. If we don't do this, clang will crash with an
342 // assertion in the call to clang_type.TransferBaseClasses()
343 for (const auto &base_class : bases) {
344 clang::TypeSourceInfo *type_source_info =
345 base_class->getTypeSourceInfo();
346 if (type_source_info) {
348 clang.GetType(type_source_info->getType()));
349 }
350 }
351
352 clang.TransferBaseClasses(m_derived_ct.GetOpaqueQualType(), std::move(bases));
353
354 clang.AddMethodOverridesForCXXRecordType(m_derived_ct.GetOpaqueQualType());
355 FinishRecord();
358
359 if (auto *record_decl = llvm::dyn_cast<clang::CXXRecordDecl>(&m_tag_decl)) {
360 m_ast_builder.GetClangASTImporter().SetRecordLayout(record_decl, m_layout);
361 }
362}
363
364uint64_t
366 uint64_t bit_offset, CompilerType parent_ct,
367 ClangASTImporter::LayoutInfo &parent_layout,
368 clang::DeclContext *parent_decl_ctx) {
370 clang.GetSymbolFile()->GetBackingSymbolFile());
371 clang::FieldDecl *field_decl = nullptr;
372 uint64_t bit_size = 0;
373 switch (field->kind) {
374 case Member::Field: {
376 parent_ct, field->name, m_ast_builder.ToCompilerType(field->qt),
377 field->access, field->bitfield_width);
378 bit_size = field->bit_size;
379 break;
380 };
381 case Member::Struct:
382 case Member::Union: {
383 clang::TagTypeKind kind = field->kind == Member::Struct
384 ? clang::TagTypeKind::Struct
385 : clang::TagTypeKind::Union;
386 ClangASTMetadata metadata;
387 metadata.SetUserID(pdb->anonymous_id);
388 metadata.SetIsDynamicCXXType(false);
389 CompilerType record_ct = clang.CreateRecordType(
390 parent_decl_ctx, OptionalClangModuleID(), lldb::eAccessPublic, "",
391 llvm::to_underlying(kind), lldb::eLanguageTypeC_plus_plus, metadata);
394 clang::DeclContext *decl_ctx = clang.GetDeclContextForType(record_ct);
395 for (const auto &member : field->fields) {
396 uint64_t member_offset = field->kind == Member::Struct
397 ? member->bit_offset - field->base_offset
398 : 0;
399 uint64_t member_bit_size = AddMember(clang, member.get(), member_offset,
400 record_ct, layout, decl_ctx);
401 if (field->kind == Member::Struct)
402 bit_size = std::max(bit_size, member_offset + member_bit_size);
403 else
404 bit_size = std::max(bit_size, member_bit_size);
405 }
406 layout.bit_size = bit_size;
408 clang::RecordDecl *record_decl = clang.GetAsRecordDecl(record_ct);
409 m_ast_builder.GetClangASTImporter().SetRecordLayout(record_decl, layout);
411 parent_ct, "", record_ct, lldb::eAccessPublic, 0);
412 // Mark this record decl as completed.
413 DeclStatus status;
414 status.resolved = true;
415 status.uid = pdb->anonymous_id--;
416 m_decl_to_status.insert({record_decl, status});
417 break;
418 };
419 }
420 // FIXME: Add a PdbSymUid namespace for field list members and update
421 // the m_uid_to_decl map with this decl.
422 parent_layout.field_offsets.insert({field_decl, bit_offset});
423 return bit_size;
424}
425
428 clang::DeclContext *decl_ctx =
429 m_ast_builder.GetOrCreateClangDeclContextForUid(m_id);
430 m_record.ConstructRecord();
431 // Maybe we should check the construsted record size with the size in pdb. If
432 // they mismatch, it might be pdb has fields info missing.
433 for (const auto &field : m_record.record.fields) {
434 AddMember(clang, field.get(), field->bit_offset, m_derived_ct, m_layout,
435 decl_ctx);
436 }
437}
438
440 llvm::StringRef name, uint64_t offset, uint64_t field_size,
441 clang::QualType qt, lldb::AccessType access, uint64_t bitfield_width) {
442 fields_map[offset].push_back(std::make_unique<Member>(
443 name, offset, field_size, qt, access, bitfield_width));
444 if (start_offset > offset)
445 start_offset = offset;
446}
447
449 // For anonymous unions in a struct, msvc generated pdb doesn't have the
450 // entity for that union. So, we need to construct anonymous union and struct
451 // based on field offsets. The final AST is likely not matching the exact
452 // original AST, but the memory layout is preseved.
453 // After we collecting all fields in visitKnownMember, we have all fields in
454 // increasing offset order in m_fields. Since we are iterating in increase
455 // offset order, if the current offset is equal to m_start_offset, we insert
456 // it as direct field of top level record. If the current offset is greater
457 // than m_start_offset, we should be able to find a field in end_offset_map
458 // whose end offset is less than or equal to current offset. (if not, it might
459 // be missing field info. We will ignore the field in this case. e.g. Field A
460 // starts at 0 with size 4 bytes, and Field B starts at 2 with size 4 bytes.
461 // Normally, there must be something which ends at/before 2.) Then we will
462 // append current field to the end of parent record. If parent is struct, we
463 // can just grow it. If parent is a field, it's a field inside an union. We
464 // convert it into an anonymous struct containing old field and new field.
465
466 // The end offset to a vector of field/struct that ends at the offset.
467 std::map<uint64_t, std::vector<Member *>> end_offset_map;
468 auto is_last_end_offset = [&](auto it) {
469 return it != end_offset_map.end() && ++it == end_offset_map.end();
470 };
471
472 for (auto &pair : fields_map) {
473 uint64_t offset = pair.first;
474 auto &fields = pair.second;
475 lldbassert(offset >= start_offset);
476 Member *parent = &record;
477 if (offset > start_offset) {
478 // Find the field with largest end offset that is <= offset. If it's less
479 // than offset, it indicates there are padding bytes between end offset
480 // and offset.
481 lldbassert(!end_offset_map.empty());
482 auto iter = end_offset_map.lower_bound(offset);
483 if (iter == end_offset_map.end())
484 --iter;
485 else if (iter->first > offset) {
486 if (iter == end_offset_map.begin())
487 continue;
488 --iter;
489 }
490 if (iter->second.empty())
491 continue;
492
493 // If the new fields come after the already added ones
494 // without overlap, go back to the root.
495 if (iter->first <= offset && is_last_end_offset(iter)) {
496 if (record.kind == Member::Struct) {
497 parent = &record;
498 } else {
499 assert(record.kind == Member::Union &&
500 "Current record must be a union");
501 assert(!record.fields.empty());
502 // For unions, append the field to the last struct
503 parent = record.fields.back().get();
504 }
505 } else {
506 parent = iter->second.back();
507 iter->second.pop_back();
508 }
509 }
510 // If it's a field, then the field is inside a union, so we can safely
511 // increase its size by converting it to a struct to hold multiple fields.
512 if (parent->kind == Member::Field)
513 parent->ConvertToStruct();
514
515 if (fields.size() == 1) {
516 uint64_t end_offset = offset + fields.back()->bit_size;
517 parent->fields.push_back(std::move(fields.back()));
518 if (parent->kind == Member::Struct) {
519 end_offset_map[end_offset].push_back(parent);
520 } else {
521 lldbassert(parent == &record &&
522 "If parent is union, it must be the top level record.");
523 end_offset_map[end_offset].push_back(parent->fields.back().get());
524 }
525 } else {
526 if (parent->kind == Member::Struct) {
527 parent->fields.push_back(std::make_unique<Member>(Member::Union));
528 parent = parent->fields.back().get();
529 parent->bit_offset = offset;
530 } else {
531 lldbassert(parent == &record &&
532 "If parent is union, it must be the top level record.");
533 }
534 for (auto &field : fields) {
535 int64_t bit_size = field->bit_size;
536 parent->fields.push_back(std::move(field));
537 end_offset_map[offset + bit_size].push_back(
538 parent->fields.back().get());
539 }
540 }
541 }
542}
#define lldbassert(x)
Definition LLDBAssert.h:16
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
Definition Log.h:369
llvm::Error Error
void SetUserID(lldb::user_id_t user_id)
void SetIsDynamicCXXType(std::optional< bool > b)
Generic representation of a type in a programming language.
lldb::BasicType GetBasicTypeEnumeration() const
ConstString GetTypeName(bool BaseOnly=false) const
CompilerType CreateTypedef(const char *name, const CompilerDeclContext &decl_ctx, uint32_t payload) const
Create a typedef to this type using "name" as the name of the typedef this type is valid and the type...
A TypeSystem implementation based on Clang.
static clang::FieldDecl * AddFieldToRecordType(const CompilerType &type, llvm::StringRef name, const CompilerType &field_type, lldb::AccessType access, uint32_t bitfield_bit_size)
static void SetFloatingInitializerForVariable(clang::VarDecl *var, const llvm::APFloat &init_value)
Initializes a variable with a floating point value.
static void SetIntegerInitializerForVariable(clang::VarDecl *var, const llvm::APInt &init_value)
Initializes a variable with an integer value.
static void BuildIndirectFields(const CompilerType &type)
static clang::CXXRecordDecl * GetAsCXXRecordDecl(lldb::opaque_compiler_type_t type)
static bool CompleteTagDeclarationDefinition(const CompilerType &type)
static bool StartTagDeclarationDefinition(const CompilerType &type)
static clang::VarDecl * AddVariableToRecordType(const CompilerType &type, llvm::StringRef name, const CompilerType &var_type, lldb::AccessType access)
static void RequireCompleteType(CompilerType type)
Complete a type from debug info, or mark it as forcefully completed if there is no definition of the ...
PdbIndex - Lazy access to the important parts of a PDB file.
Definition PdbIndex.h:47
llvm::DenseMap< lldb::opaque_compiler_type_t, llvm::SmallSet< std::pair< llvm::StringRef, CompilerType >, 8 > > & m_cxx_record_map
ClangASTImporter::LayoutInfo m_layout
llvm::DenseMap< clang::Decl *, DeclStatus > & m_decl_to_status
uint64_t AddMember(TypeSystemClang &clang, Member *field, uint64_t bit_offset, CompilerType parent_ct, ClangASTImporter::LayoutInfo &parent_layout, clang::DeclContext *decl_ctx)
clang::QualType AddBaseClassForTypeIndex(llvm::codeview::TypeIndex ti, llvm::codeview::MemberAccess access, std::optional< uint64_t > vtable_idx=std::optional< uint64_t >())
void AddMethod(llvm::StringRef name, llvm::codeview::TypeIndex type_idx, llvm::codeview::MemberAccess access, llvm::codeview::MethodOptions options, llvm::codeview::MemberAttributes attrs)
UdtRecordCompleter(PdbTypeSymId id, CompilerType &derived_ct, clang::TagDecl &tag_decl, PdbAstBuilder &ast_builder, PdbIndex &index, llvm::DenseMap< clang::Decl *, DeclStatus > &decl_to_status, llvm::DenseMap< lldb::opaque_compiler_type_t, llvm::SmallSet< std::pair< llvm::StringRef, CompilerType >, 8 > > &cxx_record_map)
llvm::StringRef DropNameScope(llvm::StringRef name)
Definition PdbUtil.cpp:599
lldb::AccessType TranslateMemberAccess(llvm::codeview::MemberAccess access)
size_t GetSizeOfType(PdbTypeSymId id, llvm::pdb::TpiStream &tpi)
Definition PdbUtil.cpp:1094
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition Log.h:332
void * opaque_compiler_type_t
Definition lldb-types.h:89
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
@ eBasicTypeLongDouble
@ eLanguageTypeC_plus_plus
ISO C++:1998.
llvm::DenseMap< const clang::FieldDecl *, uint64_t > field_offsets
enum lldb_private::npdb::UdtRecordCompleter::Member::Kind kind
void CollectMember(llvm::StringRef name, uint64_t offset, uint64_t field_size, clang::QualType qt, lldb::AccessType access, uint64_t bitfield_width)
std::map< uint64_t, llvm::SmallVector< MemberUP, 1 > > fields_map