15#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
16#include "llvm/DebugInfo/CodeView/SymbolDeserializer.h"
17#include "llvm/DebugInfo/CodeView/TypeDeserializer.h"
18#include "llvm/DebugInfo/PDB/Native/DbiStream.h"
19#include "llvm/DebugInfo/PDB/Native/TpiStream.h"
37 llvm::ArrayRef<LocalVariableAddrGap> gaps) {
45 while (!gaps.empty()) {
46 const LocalVariableAddrGap &gap = gaps.front();
48 result.
Append(start, gap_start - start);
49 start = gap_start + gap.Range;
50 gaps = gaps.drop_front();
53 result.
Append(start, end - start);
58struct MemberLocations {
59 std::map<uint64_t, MemberValLocation> offset_to_location;
61 bool is_dwarf =
false;
63 MemberLocations() =
default;
64 MemberLocations(
const DWARFExpression &expr) : expr(expr), is_dwarf(true) {}
66 insert(offset, member_loc);
70 offset_to_location[offset] = member_loc;
75 bool operator()(
const MemberLocations &,
const MemberLocations &)
const {
83 MemberLocations::Comparator>
86void AddMemberLocationRanges(RangeMap &location_map, uint64_t offset,
89 RangeMap new_location_map;
91 RangeMap::Entry *entry) {
92 RangeMap::Entry overlap_region = {base, end - base, entry->data};
93 overlap_region.data.insert(offset, member_loc);
94 new_location_map.Append(overlap_region);
97 for (
const auto &range : ranges) {
100 uint32_t base_idx = location_map.FindEntryIndexThatContainsOrFollows(base);
101 while (
auto *entry = location_map.GetMutableEntryAtIndex(base_idx)) {
102 if (base >= end || entry->base >= end)
104 if (entry->data.is_dwarf)
105 base = entry->GetRangeEnd();
108 if (base > entry->base) {
110 new_location_map.Append({end, entry_end - end, entry->data});
111 add_overlap_region(base, end < entry_end ? end : entry_end, entry);
112 entry->SetRangeEnd(base);
113 }
else if (base < entry->base) {
114 new_location_map.Append(
115 {base, entry->base - base, {offset, member_loc}});
116 if (entry_end == end)
117 entry->data.insert(offset, member_loc);
119 add_overlap_region(entry->base, end, entry);
120 entry->ShrinkFront(end - entry->base);
123 if (end < entry_end) {
124 new_location_map.Append({end, entry_end, entry->data});
125 entry->SetRangeEnd(end);
127 entry->data.insert(offset, member_loc);
135 new_location_map.Append({base, end - base, {offset, member_loc}});
137 for (
const auto &entry : new_location_map)
138 location_map.Append(entry);
139 if (!new_location_map.IsEmpty())
147 RangeMap new_location_map;
148 for (
const auto &range : ranges) {
151 uint32_t base_idx = location_map.FindEntryIndexThatContains(base);
152 uint32_t end_idx = location_map.FindEntryIndexThatContains(end - 1);
154 if (base_idx == end_idx && base_idx !=
UINT32_MAX) {
155 auto *entry = location_map.GetMutableEntryAtIndex(base_idx);
156 if (base > entry->base) {
157 new_location_map.Append({entry->base, base - entry->base, entry->data});
158 entry->ShrinkFront(base - entry->base);
160 if (end == entry->GetRangeEnd())
163 entry->ShrinkFront(end - base);
164 new_location_map.Append({base, end - base, expr});
168 base_idx = location_map.FindEntryIndexThatContainsOrFollows(base);
169 if (
auto *entry = location_map.GetMutableEntryAtIndex(base_idx)) {
170 if (entry->Contains(base) && entry->base != base) {
171 entry->SetRangeEnd(base);
175 end_idx = location_map.FindEntryIndexThatContainsOrFollows(end - 1);
176 if (
auto *entry = location_map.GetMutableEntryAtIndex(end_idx)) {
177 if (entry->Contains(end - 1)) {
178 if (entry->GetRangeEnd() == end)
181 entry->ShrinkFront(end - entry->base);
186 end_idx = location_map.GetSize();
188 location_map.Erase(base_idx, end_idx);
189 new_location_map.Append({base, end - base, expr});
192 for (
const auto &entry : new_location_map)
193 location_map.Append(entry);
199 assert(
IsTagRecord(type) &&
"type is not a tag record!");
200 switch (type.kind()) {
205 llvm::cantFail(TypeDeserializer::deserializeAs<ClassRecord>(type, cr));
210 llvm::cantFail(TypeDeserializer::deserializeAs<UnionRecord>(type, ur));
215 llvm::cantFail(TypeDeserializer::deserializeAs<EnumRecord>(type, er));
219 llvm_unreachable(
"Unreachable!");
224 : cvclass(std::move(c)),
225 m_kind(cvclass.Kind == TypeRecordKind::Struct ? Struct : Class) {}
227 : cvunion(std::move(u)), m_kind(
Union) {}
234 return PDB_SymType::CompilandDetails;
236 return PDB_SymType::CompilandEnv;
239 return PDB_SymType::Thunk;
241 return PDB_SymType::CoffGroup;
243 return PDB_SymType::Export;
247 return PDB_SymType::Function;
249 return PDB_SymType::PublicSymbol;
251 return PDB_SymType::InlineSite;
263 return PDB_SymType::Data;
265 return PDB_SymType::Block;
267 return PDB_SymType::Label;
269 return PDB_SymType::CallSite;
270 case S_HEAPALLOCSITE:
271 return PDB_SymType::HeapAllocationSite;
273 return PDB_SymType::Callee;
275 return PDB_SymType::Caller;
277 lldbassert(
false &&
"Invalid symbol record kind!");
279 return PDB_SymType::None;
285 return PDB_SymType::ArrayType;
287 return PDB_SymType::FunctionSig;
289 return PDB_SymType::BaseClass;
291 return PDB_SymType::BaseInterface;
296 return PDB_SymType::UDT;
298 return PDB_SymType::PointerType;
300 return PDB_SymType::Enum;
302 return PDB_SymType::FunctionSig;
304 return PDB_SymType::BuiltinType;
306 lldbassert(
false &&
"Invalid type record kind!");
308 return PDB_SymType::None;
312 switch (sym.kind()) {
318 case S_LPROC32_DPC_ID:
325 case S_HEAPALLOCSITE:
339 switch (sym.kind()) {
345 case S_LPROC32_DPC_ID:
357 RecordT record(
static_cast<SymbolRecordKind
>(sym.kind()));
358 cantFail(SymbolDeserializer::deserializeAs<RecordT>(sym, record));
362template <
typename RecordT>
364 RecordT record = createRecord<RecordT>(sym);
365 return {record.Segment, record.CodeOffset};
370 TrampolineSym record = createRecord<TrampolineSym>(sym);
371 return {record.ThunkSection, record.ThunkOffset};
375 Thunk32Sym record = createRecord<Thunk32Sym>(sym);
376 return {record.Segment, record.Offset};
381 CoffGroupSym record = createRecord<CoffGroupSym>(sym);
382 return {record.Segment, record.Offset};
386 DataSym record = createRecord<DataSym>(sym);
387 return {record.Segment, record.DataOffset};
392 ThreadLocalDataSym record = createRecord<ThreadLocalDataSym>(sym);
393 return {record.Segment, record.DataOffset};
397 switch (sym.kind()) {
403 case S_LPROC32_DPC_ID:
404 return ::GetSegmentAndOffset<ProcSym>(sym);
406 return ::GetSegmentAndOffset<Thunk32Sym>(sym);
409 return ::GetSegmentAndOffset<TrampolineSym>(sym);
412 return ::GetSegmentAndOffset<CoffGroupSym>(sym);
415 return ::GetSegmentAndOffset<BlockSym>(sym);
418 return ::GetSegmentAndOffset<LabelSym>(sym);
421 return ::GetSegmentAndOffset<CallSiteInfoSym>(sym);
423 case S_HEAPALLOCSITE:
424 return ::GetSegmentAndOffset<HeapAllocationSiteSym>(sym);
430 return ::GetSegmentAndOffset<DataSym>(sym);
434 return ::GetSegmentAndOffset<ThreadLocalDataSym>(sym);
437 lldbassert(
false &&
"Record does not have a segment/offset!");
442template <
typename RecordT>
444 RecordT record = createRecord<RecordT>(sym);
445 return {record.Segment, record.CodeOffset, record.CodeSize};
451 TrampolineSym record = createRecord<TrampolineSym>(sym);
452 return {record.ThunkSection, record.ThunkOffset, record.Size};
457 Thunk32Sym record = createRecord<Thunk32Sym>(sym);
464 CoffGroupSym record = createRecord<CoffGroupSym>(sym);
470 switch (sym.kind()) {
476 case S_LPROC32_DPC_ID:
477 return ::GetSegmentOffsetAndLength<ProcSym>(sym);
479 return ::GetSegmentOffsetAndLength<Thunk32Sym>(sym);
482 return ::GetSegmentOffsetAndLength<TrampolineSym>(sym);
485 return ::GetSegmentOffsetAndLength<CoffGroupSym>(sym);
488 return ::GetSegmentOffsetAndLength<BlockSym>(sym);
491 lldbassert(
false &&
"Record does not have a segment/offset/length triple!");
500 switch (cvt.kind()) {
504 llvm::cantFail(TypeDeserializer::deserializeAs<ClassRecord>(cvt, cr));
505 return cr.isForwardRef();
507 llvm::cantFail(TypeDeserializer::deserializeAs<UnionRecord>(cvt, ur));
508 return ur.isForwardRef();
510 llvm::cantFail(TypeDeserializer::deserializeAs<EnumRecord>(cvt, er));
511 return er.isForwardRef();
518 switch (cvt.kind()) {
530 switch (cvt.kind()) {
542 if (
id.is_ipi ||
id.index.isSimple())
548 if (
id.is_ipi ||
id.index.isSimple())
556 case MemberAccess::Private:
558 case MemberAccess::Protected:
560 case MemberAccess::Public:
562 case MemberAccess::None:
565 llvm_unreachable(
"unreachable");
569 switch (cvt.kind()) {
574 cantFail(TypeDeserializer::deserializeAs<ClassRecord>(cvt, cr));
579 cantFail(TypeDeserializer::deserializeAs<UnionRecord>(cvt, ur));
584 cantFail(TypeDeserializer::deserializeAs<EnumRecord>(cvt, er));
588 llvm_unreachable(
"Unreachable!");
595 llvm::cantFail(TypeDeserializer::deserializeAs<ModifierRecord>(modifier, mr));
596 return mr.ModifiedType;
606 if (sym.kind() == S_REGREL32) {
607 RegRelativeSym reg(SymbolRecordKind::RegRelativeSym);
608 cantFail(SymbolDeserializer::deserializeAs<RegRelativeSym>(sym, reg));
609 result.
type = reg.Type;
610 result.
name = reg.Name;
614 if (sym.kind() == S_REGISTER) {
615 RegisterSym reg(SymbolRecordKind::RegisterSym);
616 cantFail(SymbolDeserializer::deserializeAs<RegisterSym>(sym, reg));
617 result.
type = reg.Index;
618 result.
name = reg.Name;
622 if (sym.kind() == S_LOCAL) {
623 LocalSym local(SymbolRecordKind::LocalSym);
624 cantFail(SymbolDeserializer::deserializeAs<LocalSym>(sym, local));
625 result.
type = local.Type;
626 result.
name = local.Name;
628 ((local.Flags & LocalSymFlags::IsParameter) != LocalSymFlags::None);
632 if (sym.kind() == S_GDATA32 || sym.kind() == S_LDATA32) {
633 DataSym data(SymbolRecordKind::DataSym);
634 cantFail(SymbolDeserializer::deserializeAs<DataSym>(sym, data));
635 result.
type = data.Type;
636 result.
name = data.Name;
640 if (sym.kind() == S_GTHREAD32 || sym.kind() == S_LTHREAD32) {
641 ThreadLocalDataSym data(SymbolRecordKind::ThreadLocalDataSym);
642 cantFail(SymbolDeserializer::deserializeAs<ThreadLocalDataSym>(sym, data));
643 result.
type = data.Type;
644 result.
name = data.Name;
648 if (sym.kind() == S_CONSTANT) {
649 ConstantSym constant(SymbolRecordKind::ConstantSym);
650 cantFail(SymbolDeserializer::deserializeAs<ConstantSym>(sym, constant));
651 result.
type = constant.Type;
652 result.
name = constant.Name;
656 lldbassert(
false &&
"Invalid variable record kind!");
660static llvm::FixedStreamArray<FrameData>::Iterator
662 const DebugFrameDataSubsectionRef &fpo_data,
668 const RangeListEntry &range = ranges.
GetEntryRef(0);
670 auto it = fpo_data.begin();
673 for (; it != fpo_data.end(); ++it) {
674 RangeListEntry fd_range(load_addr + it->RvaStart, it->CodeSize);
676 if (fd_range.Contains(range)) {
683 for (; it != fpo_data.end(); ++it) {
684 RangeListEntry fd_range(load_addr + it->RvaStart, it->CodeSize);
686 if (!fd_range.Contains(range)) {
697 llvm::StringRef &out_program) {
698 const DebugFrameDataSubsectionRef &new_fpo_data =
699 index.
dbi().getNewFpoRecords();
703 if (frame_data_it == new_fpo_data.end())
706 auto strings = index.
pdb().getStringTable();
708 consumeError(strings.takeError());
711 out_program = cantFail(strings->getStringForID(frame_data_it->FrameFunc));
719 if (frame_proc_cvs.kind() != S_FRAMEPROC)
720 return RegisterId::NONE;
722 FrameProcSym frame_proc(SymbolRecordKind::FrameProcSym);
723 cantFail(SymbolDeserializer::deserializeAs<FrameProcSym>(frame_proc_cvs,
730 return is_parameter ? frame_proc.getParamFramePtrReg(cpu_type)
731 : frame_proc.getLocalFramePtrReg(cpu_type);
742 if (sym.kind() == S_REGREL32) {
743 RegRelativeSym reg(SymbolRecordKind::RegRelativeSym);
744 cantFail(SymbolDeserializer::deserializeAs<RegRelativeSym>(sym, reg));
751 if (sym.kind() == S_REGISTER) {
752 RegisterSym reg(SymbolRecordKind::RegisterSym);
753 cantFail(SymbolDeserializer::deserializeAs<RegisterSym>(sym, reg));
760 if (sym.kind() == S_LOCAL) {
761 LocalSym local(SymbolRecordKind::LocalSym);
762 if (llvm::Error
error =
763 SymbolDeserializer::deserializeAs<LocalSym>(sym, local)) {
764 llvm::consumeError(std::move(
error));
769 var_id.
offset + sym.RecordData.size());
770 CVSymbol loc_specifier_cvs;
772 RegisterId base_reg = RegisterId::NONE;
775 std::map<uint64_t, size_t> offset_to_size;
779 RangeMap location_map;
783 bool finished =
false;
786 switch (loc_specifier_cvs.kind()) {
787 case S_DEFRANGE_FRAMEPOINTER_REL: {
788 DefRangeFramePointerRelSym loc(
789 SymbolRecordKind::DefRangeFramePointerRelSym);
790 if (llvm::Error
error =
791 SymbolDeserializer::deserializeAs<DefRangeFramePointerRelSym>(
792 loc_specifier_cvs, loc)) {
793 llvm::consumeError(std::move(
error));
798 if (base_reg == RegisterId::NONE) {
802 lldbassert(func_block_cvs.kind() == S_GPROC32 ||
803 func_block_cvs.kind() == S_LPROC32);
806 func_block_cvs.length());
809 if (base_reg == RegisterId::NONE)
813 if (base_reg == RegisterId::VFRAME) {
814 llvm::StringRef program;
823 AddDwarfRange(location_map, expr, raw_ranges);
826 case S_DEFRANGE_REGISTER: {
827 DefRangeRegisterSym loc(SymbolRecordKind::DefRangeRegisterSym);
828 if (llvm::Error
error =
829 SymbolDeserializer::deserializeAs<DefRangeRegisterSym>(
830 loc_specifier_cvs, loc)) {
831 llvm::consumeError(std::move(
error));
834 RegisterId reg_id = (RegisterId)(uint16_t)loc.Hdr.Register;
839 AddDwarfRange(location_map, expr, raw_ranges);
842 case S_DEFRANGE_REGISTER_REL: {
843 DefRangeRegisterRelSym loc(SymbolRecordKind::DefRangeRegisterRelSym);
844 if (llvm::Error
error =
845 SymbolDeserializer::deserializeAs<DefRangeRegisterRelSym>(
846 loc_specifier_cvs, loc)) {
847 llvm::consumeError(std::move(
error));
852 RegisterId reg_id = (RegisterId)(uint16_t)loc.Hdr.Register;
854 if (reg_id == RegisterId::VFRAME) {
855 llvm::StringRef program;
858 program, loc.Hdr.BasePointerOffset, module);
867 if (!loc.hasSpilledUDTMember())
868 AddDwarfRange(location_map, expr, raw_ranges);
871 case S_DEFRANGE_SUBFIELD_REGISTER: {
872 DefRangeSubfieldRegisterSym loc(
873 SymbolRecordKind::DefRangeSubfieldRegisterSym);
874 if (llvm::Error
error =
875 SymbolDeserializer::deserializeAs<DefRangeSubfieldRegisterSym>(
876 loc_specifier_cvs, loc)) {
877 llvm::consumeError(std::move(
error));
886 offset_to_size[loc.Hdr.OffsetInParent] =
reg_size;
887 AddMemberLocationRanges(location_map, loc.Hdr.OffsetInParent,
888 {loc.Hdr.Register, 0, true}, ranges);
894 case S_DEFRANGE_SUBFIELD:
895 case S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE:
902 loc_specifier_id.
modi,
903 loc_specifier_id.
offset + loc_specifier_cvs.RecordData.size());
905 for (
const auto &entry : location_map) {
907 entry.data.is_dwarf ? entry.data.expr
909 entry.data.offset_to_location,
910 offset_to_size, type_size, module);
917 llvm_unreachable(
"Symbol is not a local variable!");
924 case SimpleTypeKind::Boolean128:
925 case SimpleTypeKind::Boolean16:
926 case SimpleTypeKind::Boolean32:
927 case SimpleTypeKind::Boolean64:
928 case SimpleTypeKind::Boolean8:
930 case SimpleTypeKind::Byte:
931 case SimpleTypeKind::UnsignedCharacter:
933 case SimpleTypeKind::NarrowCharacter:
935 case SimpleTypeKind::SignedCharacter:
936 case SimpleTypeKind::SByte:
938 case SimpleTypeKind::Character16:
940 case SimpleTypeKind::Character32:
942 case SimpleTypeKind::Character8:
944 case SimpleTypeKind::Complex80:
946 case SimpleTypeKind::Complex64:
948 case SimpleTypeKind::Complex32:
950 case SimpleTypeKind::Float128:
951 case SimpleTypeKind::Float80:
953 case SimpleTypeKind::Float64:
955 case SimpleTypeKind::Float32:
957 case SimpleTypeKind::Float16:
959 case SimpleTypeKind::Int128:
961 case SimpleTypeKind::Int64:
962 case SimpleTypeKind::Int64Quad:
964 case SimpleTypeKind::Int32:
966 case SimpleTypeKind::Int16:
967 case SimpleTypeKind::Int16Short:
969 case SimpleTypeKind::UInt128:
971 case SimpleTypeKind::UInt64:
972 case SimpleTypeKind::UInt64Quad:
974 case SimpleTypeKind::HResult:
975 case SimpleTypeKind::UInt32:
977 case SimpleTypeKind::UInt16:
978 case SimpleTypeKind::UInt16Short:
980 case SimpleTypeKind::Int32Long:
982 case SimpleTypeKind::UInt32Long:
984 case SimpleTypeKind::Void:
986 case SimpleTypeKind::WideCharacter:
995 case SimpleTypeKind::Boolean128:
996 case SimpleTypeKind::Int128:
997 case SimpleTypeKind::UInt128:
998 case SimpleTypeKind::Float128:
1000 case SimpleTypeKind::Complex80:
1001 case SimpleTypeKind::Float80:
1003 case SimpleTypeKind::Boolean64:
1004 case SimpleTypeKind::Complex64:
1005 case SimpleTypeKind::UInt64:
1006 case SimpleTypeKind::UInt64Quad:
1007 case SimpleTypeKind::Float64:
1008 case SimpleTypeKind::Int64:
1009 case SimpleTypeKind::Int64Quad:
1011 case SimpleTypeKind::Boolean32:
1012 case SimpleTypeKind::Character32:
1013 case SimpleTypeKind::Complex32:
1014 case SimpleTypeKind::Float32:
1015 case SimpleTypeKind::Int32:
1016 case SimpleTypeKind::Int32Long:
1017 case SimpleTypeKind::UInt32Long:
1018 case SimpleTypeKind::HResult:
1019 case SimpleTypeKind::UInt32:
1021 case SimpleTypeKind::Boolean16:
1022 case SimpleTypeKind::Character16:
1023 case SimpleTypeKind::Float16:
1024 case SimpleTypeKind::Int16:
1025 case SimpleTypeKind::Int16Short:
1026 case SimpleTypeKind::UInt16:
1027 case SimpleTypeKind::UInt16Short:
1028 case SimpleTypeKind::WideCharacter:
1030 case SimpleTypeKind::Boolean8:
1031 case SimpleTypeKind::Byte:
1032 case SimpleTypeKind::UnsignedCharacter:
1033 case SimpleTypeKind::NarrowCharacter:
1034 case SimpleTypeKind::SignedCharacter:
1035 case SimpleTypeKind::SByte:
1036 case SimpleTypeKind::Character8:
1038 case SimpleTypeKind::Void:
1046 if (
id.index.isSimple())
1049 CVType cvt = tpi.getType(
id.index);
1060 return llvm::cantFail(tpi.findFullDeclForForwardRef(
id.index));
1065 llvm::cantFail(TypeDeserializer::deserializeAs<RecordType>(cvt, record));
1066 return record.getSize();
1070 llvm::pdb::TpiStream &tpi) {
1071 if (
id.index.isSimple()) {
1072 switch (
id.index.getSimpleMode()) {
1073 case SimpleTypeMode::Direct:
1075 case SimpleTypeMode::NearPointer32:
1076 case SimpleTypeMode::FarPointer32:
1078 case SimpleTypeMode::NearPointer64:
1080 case SimpleTypeMode::NearPointer128:
1088 TypeIndex index =
id.index;
1090 index = llvm::cantFail(tpi.findFullDeclForForwardRef(index));
1092 CVType cvt = tpi.getType(index);
1093 switch (cvt.kind()) {
1098 llvm::cantFail(TypeDeserializer::deserializeAs<EnumRecord>(cvt, record));
1102 return GetSizeOfTypeInternal<PointerRecord>(cvt);
1104 return GetSizeOfTypeInternal<ArrayRecord>(cvt);
1108 return GetSizeOfTypeInternal<ClassRecord>(cvt);
1110 return GetSizeOfTypeInternal<UnionRecord>(cvt);
1112 BitFieldRecord record;
1113 llvm::cantFail(TypeDeserializer::deserializeAs<BitFieldRecord>(cvt, record));
static const size_t reg_size
static llvm::raw_ostream & error(Stream &strm)
SegmentOffsetLength GetSegmentOffsetAndLength< CoffGroupSym >(const CVSymbol &sym)
static llvm::FixedStreamArray< FrameData >::Iterator GetCorrespondingFrameData(lldb::addr_t load_addr, const DebugFrameDataSubsectionRef &fpo_data, const Variable::RangeList &ranges)
SegmentOffset GetSegmentAndOffset< TrampolineSym >(const CVSymbol &sym)
SegmentOffset GetSegmentAndOffset< CoffGroupSym >(const CVSymbol &sym)
SegmentOffset GetSegmentAndOffset< Thunk32Sym >(const CVSymbol &sym)
SegmentOffset GetSegmentAndOffset< DataSym >(const CVSymbol &sym)
static size_t GetSizeOfTypeInternal(CVType cvt)
SegmentOffsetLength GetSegmentOffsetAndLength< TrampolineSym >(const CVSymbol &sym)
RecordT createRecord(const CVSymbol &sym)
SegmentOffset GetSegmentAndOffset< ThreadLocalDataSym >(const CVSymbol &sym)
static bool GetFrameDataProgram(PdbIndex &index, const Variable::RangeList &ranges, llvm::StringRef &out_program)
SegmentOffsetLength GetSegmentOffsetAndLength< Thunk32Sym >(const CVSymbol &sym)
static Variable::RangeList MakeRangeList(const PdbIndex &index, const LocalVariableAddrRange &range, llvm::ArrayRef< LocalVariableAddrGap > gaps)
static RegisterId GetBaseFrameRegister(PdbIndex &index, PdbCompilandSymId frame_proc_id, bool is_parameter)
static llvm::StringRef DropScope(llvm::StringRef name)
A class that describes a single lexical block.
"lldb/Expression/DWARFExpressionList.h" Encapsulates a range map from file address range to a single ...
bool AddExpression(lldb::addr_t base, lldb::addr_t end, DWARFExpression expr)
"lldb/Expression/DWARFExpression.h" Encapsulates a DWARF location expression and interprets it.
bool IsValid() const
Return true if the location expression contains data.
Entry & GetEntryRef(size_t i)
void Append(const Entry &entry)
Range< lldb::addr_t, lldb::addr_t > Entry
const CompilandIndexItem * GetCompiland(uint16_t modi) const
PdbIndex - Lazy access to the important parts of a PDB file.
CompileUnitIndex & compilands()
llvm::pdb::DbiStream & dbi()
llvm::codeview::CVSymbol ReadSymbolRecord(PdbCompilandSymId cu_sym) const
lldb::addr_t GetLoadAddress() const
llvm::pdb::PDBFile & pdb()
lldb::addr_t MakeVirtualAddress(uint16_t segment, uint32_t offset) const
llvm::pdb::TpiStream & tpi()
PdbCompilandSymId asCompilandSym() const
#define LLDB_INVALID_ADDRESS
bool SymbolHasAddress(const llvm::codeview::CVSymbol &sym)
llvm::StringRef DropNameScope(llvm::StringRef name)
DWARFExpression MakeRegRelLocationExpression(llvm::codeview::RegisterId reg, int32_t offset, lldb::ModuleSP module)
llvm::pdb::PDB_SymType CVTypeToPDBType(llvm::codeview::TypeLeafKind kind)
size_t GetTypeSizeForSimpleKind(llvm::codeview::SimpleTypeKind kind)
DWARFExpression MakeVFrameRelLocationExpression(llvm::StringRef fpo_program, int32_t offset, lldb::ModuleSP module)
SegmentOffset GetSegmentAndOffset(const llvm::codeview::CVSymbol &sym)
lldb::BasicType GetCompilerTypeForSimpleKind(llvm::codeview::SimpleTypeKind kind)
VariableInfo GetVariableNameInfo(llvm::codeview::CVSymbol symbol)
SegmentOffsetLength GetSegmentOffsetAndLength(const llvm::codeview::CVSymbol &sym)
bool IsTagRecord(llvm::codeview::CVType cvt)
llvm::codeview::TypeIndex LookThroughModifierRecord(llvm::codeview::CVType modifier)
DWARFExpression MakeEnregisteredLocationExpressionForComposite(const std::map< uint64_t, MemberValLocation > &offset_to_location, std::map< uint64_t, size_t > &offset_to_size, size_t total_size, lldb::ModuleSP module)
VariableInfo GetVariableLocationInfo(PdbIndex &index, PdbCompilandSymId var_id, Block &func_block, lldb::ModuleSP module)
bool IsForwardRefUdt(llvm::codeview::CVType cvt)
lldb::AccessType TranslateMemberAccess(llvm::codeview::MemberAccess access)
llvm::codeview::TypeIndex GetFieldListIndex(llvm::codeview::CVType cvt)
DWARFExpression MakeEnregisteredLocationExpression(llvm::codeview::RegisterId reg, lldb::ModuleSP module)
llvm::pdb::PDB_SymType CVSymToPDBSym(llvm::codeview::SymbolKind kind)
size_t GetSizeOfType(PdbTypeSymId id, llvm::pdb::TpiStream &tpi)
uint32_t GetRegisterSize(llvm::codeview::RegisterId register_id)
PdbTypeSymId GetBestPossibleDecl(PdbTypeSymId id, llvm::pdb::TpiStream &tpi)
bool IsClassStructUnion(llvm::codeview::CVType cvt)
bool SymbolIsCode(const llvm::codeview::CVSymbol &sym)
A class that represents a running process on the host machine.
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
@ eBasicTypeUnsignedShort
@ eBasicTypeUnsignedInt128
@ eBasicTypeLongDoubleComplex
@ eBasicTypeUnsignedLongLong
@ eBasicTypeDoubleComplex
std::shared_ptr< lldb_private::Module > ModuleSP
lldb::user_id_t GetID() const
Get accessor for the user ID.
static CVTagRecord create(llvm::codeview::CVType type)
CVTagRecord(llvm::codeview::ClassRecord &&c)
std::optional< llvm::codeview::Compile3Sym > m_compile_opts
DWARFExpressionList location
llvm::codeview::TypeIndex type