Lines Matching +full:address +full:- +full:address +full:- +full:data

1 //===- InlineInfo.cpp -------------------------------------------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
64 /// Skip an InlineInfo object in the specified data at the specified offset.
71 /// \param Data The binary stream to read the data from.
73 /// \param Offset The byte offset within \a Data.
75 /// \param SkippedRanges If true, address ranges have already been skipped.
77 static bool skip(DataExtractor &Data, uint64_t &Offset, bool SkippedRanges) { in skip() argument
79 if (skipRanges(Data, Offset) == 0) in skip()
82 bool HasChildren = Data.getU8(&Offset) != 0; in skip()
83 Data.getU32(&Offset); // Skip Inline.Name. in skip()
84 Data.getULEB128(&Offset); // Skip Inline.CallFile. in skip()
85 Data.getULEB128(&Offset); // Skip Inline.CallLine. in skip()
87 while (skip(Data, Offset, false /* SkippedRanges */)) in skip()
97 /// InlineInfo object if the address falls within this object. This avoids
100 /// not contain the address we are looking up.
102 /// \param Data The binary stream to read the data from.
104 /// \param Offset The byte offset within \a Data.
106 /// \param BaseAddr The address that the relative address range offsets are
109 static bool lookup(const GsymReader &GR, DataExtractor &Data, uint64_t &Offset, in lookup() argument
113 decodeRanges(Inline.Ranges, Data, BaseAddr, Offset); in lookup()
116 // Check if the address is contained within the inline information, and if in lookup()
119 skip(Data, Offset, true /* SkippedRanges */); in lookup()
123 // The address range is contained within this InlineInfo, add the source in lookup()
124 // location for this InlineInfo and any children that contain the address. in lookup()
125 bool HasChildren = Data.getU8(&Offset) != 0; in lookup()
126 Inline.Name = Data.getU32(&Offset); in lookup()
127 Inline.CallFile = (uint32_t)Data.getULEB128(&Offset); in lookup()
128 Inline.CallLine = (uint32_t)Data.getULEB128(&Offset); in lookup()
130 // Child address ranges are encoded relative to the first address in the in lookup()
135 Done = lookup(GR, Data, Offset, ChildBaseAddr, Addr, SrcLocs, Err); in lookup()
146 if (CallFile->Dir || CallFile->Base) { in lookup()
150 SrcLoc.Dir = GR.getString(CallFile->Dir); in lookup()
151 SrcLoc.Base = GR.getString(CallFile->Base); in lookup()
154 SrcLocs.back().Offset = Addr - Inline.Ranges[0].start(); in lookup()
160 llvm::Error InlineInfo::lookup(const GsymReader &GR, DataExtractor &Data, in lookup() argument
166 ::lookup(GR, Data, Offset, BaseAddr, Addr, SrcLocs, Err); in lookup()
170 /// Decode an InlineInfo in Data at the specified offset.
175 /// \param Data The data extractor to decode from.
176 /// \param Offset The offset within \a Data to decode from.
177 /// \param BaseAddr The base address to use when decoding address ranges.
180 static llvm::Expected<InlineInfo> decode(DataExtractor &Data, uint64_t &Offset, in decode() argument
183 if (!Data.isValidOffset(Offset)) in decode()
185 "0x%8.8" PRIx64 ": missing InlineInfo address ranges data", Offset); in decode()
186 decodeRanges(Inline.Ranges, Data, BaseAddr, Offset); in decode()
189 if (!Data.isValidOffsetForDataOfSize(Offset, 1)) in decode()
193 bool HasChildren = Data.getU8(&Offset) != 0; in decode()
194 if (!Data.isValidOffsetForDataOfSize(Offset, 4)) in decode()
197 Inline.Name = Data.getU32(&Offset); in decode()
198 if (!Data.isValidOffset(Offset)) in decode()
201 Inline.CallFile = (uint32_t)Data.getULEB128(&Offset); in decode()
202 if (!Data.isValidOffset(Offset)) in decode()
205 Inline.CallLine = (uint32_t)Data.getULEB128(&Offset); in decode()
207 // Child address ranges are encoded relative to the first address in the in decode()
211 llvm::Expected<InlineInfo> Child = decode(Data, Offset, ChildBaseAddr); in decode()
223 llvm::Expected<InlineInfo> InlineInfo::decode(DataExtractor &Data, in decode() argument
226 return ::decode(Data, Offset, BaseAddr); in decode()
243 // Child address ranges are encoded as relative to the first in encode()
244 // address in the Ranges for this object. This keeps the offsets in encode()
248 // Make sure all child address ranges are contained in the parent address in encode()