LLVM: lib/DebugInfo/GSYM/GsymContext.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
10
13
14using namespace llvm;
16
20
22
26
28 LineInfo.FunctionName = Location.Name.str();
29 }
30
31 switch (Specifier.FLIKind) {
33
34
37 if (Location.Dir.empty()) {
38 if (Location.Base.empty())
40 else
41 LineInfo.FileName = Location.Base.str();
42 } else {
45 LineInfo.FileName = static_caststd::string\(Path);
46 }
47 break;
48
50 LineInfo.FileName = Location.Base.str();
51 break;
52
53 default:
54 return false;
55 }
56 LineInfo.Line = Location.Line;
57
58
59
60
61 return true;
62}
63
64std::optional
68 return {};
69
70 auto ResultOrErr = Reader->lookup(Address.Address);
71
72 if (!ResultOrErr) {
74 return {};
75 }
76
77 const auto &Result = *ResultOrErr;
78
80
81 if (Result.Locations.empty()) {
82
83
84
86 LineInfo.FunctionName = Result.FuncName.str();
88 LineInfo))
89 return {};
90
91 LineInfo.StartAddress = Result.FuncRange.start();
92
93 return LineInfo;
94}
95
96std::optional
98
99
100 return {};
101}
102
107 if (Size == 0)
109
112
113 if (auto FuncInfoOrErr = Reader->getFunctionInfo(Address.Address)) {
115 if (FuncInfoOrErr->OptLineTable) {
116 const gsym::LineTable < = *FuncInfoOrErr->OptLineTable;
119 for (const auto &LineEntry : LT) {
121
122
123
124 }
125 }
126 }
127 return Table;
128 } else {
131 }
132}
133
137 auto ResultOrErr = Reader->lookup(Address.Address);
138
139 if (!ResultOrErr)
140 return {};
141
142 const auto &Result = *ResultOrErr;
143
145
146 for (const auto &Location : Result.Locations) {
148
150 return {};
151
152
153
154 LineInfo.StartAddress = Result.FuncRange.start();
155
157 }
158
160}
161
162std::vector
164
165
166 return {};
167}
static bool fillLineInfoFromLocation(const SourceLocation &Location, DILineInfoSpecifier Specifier, DILineInfo &LineInfo)
Definition GsymContext.cpp:23
DIContext(DIContextKind K)
A format-neutral container for inlined code description.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
DILineInfoTable getLineInfoForAddressRange(object::SectionedAddress Address, uint64_t Size, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
Definition GsymContext.cpp:104
DIInliningInfo getInliningInfoForAddress(object::SectionedAddress Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
Definition GsymContext.cpp:135
std::optional< DILineInfo > getLineInfoForAddress(object::SectionedAddress Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
Definition GsymContext.cpp:65
void dump(raw_ostream &OS, DIDumpOptions DIDumpOpts) override
Definition GsymContext.cpp:21
std::vector< DILocal > getLocalsForAddress(object::SectionedAddress Address) override
Definition GsymContext.cpp:163
std::optional< DILineInfo > getLineInfoForDataAddress(object::SectionedAddress Address) override
Definition GsymContext.cpp:97
GsymContext(std::unique_ptr< GsymReader > Reader)
Definition GsymContext.cpp:18
LineTable class contains deserialized versions of line tables for each function's address ranges.
This class implements an extremely fast bulk output stream that can only output to a stream.
LLVM_ABI void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
This is an optimization pass for GlobalISel generic memory operations.
SmallVector< std::pair< uint64_t, DILineInfo >, 16 > DILineInfoTable
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
void consumeError(Error Err)
Consume a Error without doing anything.
Implement std::hash so that hash_code can be used in STL containers.
Container for dump options that control which debug information will be dumped.
Controls which fields of DILineInfo container should be filled with data.
A format-neutral container for source line information.
static constexpr const char *const BadString
std::optional< uint64_t > StartAddress
Inline information stores the name of the inline function along with an array of address ranges.
Line entries are used to encode the line tables in FunctionInfo objects.
uint64_t Addr
Start address of this line entry.
static const uint64_t UndefSection