Lines Matching +full:entry +full:- +full:address

1 //===- InstrumentationMap.cpp - XRay Instrumentation Map ------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
39 return I->second; in getFunctionId()
47 return I->second; in getFunctionAddr()
61 if ((!ObjFile.getBinary()->isELF() && !ObjFile.getBinary()->isMachO()) || in loadObj()
62 !(ObjFile.getBinary()->getArch() == Triple::x86_64 || in loadObj()
63 ObjFile.getBinary()->getArch() == Triple::loongarch64 || in loadObj()
64 ObjFile.getBinary()->getArch() == Triple::ppc64le || in loadObj()
65 ObjFile.getBinary()->getArch() == Triple::arm || in loadObj()
66 ObjFile.getBinary()->getArch() == Triple::aarch64)) in loadObj()
68 "File format not supported (only does ELF and Mach-O little endian " in loadObj()
69 "64-bit).", in loadObj()
73 const auto &Sections = ObjFile.getBinary()->sections(); in loadObj()
74 uint64_t Address = 0; in loadObj() local
78 Address = Section.getAddress(); in loadObj()
90 if (Error E = I->getContents().moveInto(Contents)) in loadObj()
94 if (ObjFile.getBinary()->isELF()) { in loadObj()
97 return ELFObj->getELFFile().getRelativeRelocationType(); in loadObj()
100 return ELFObj->getELFFile().getRelativeRelocationType(); in loadObj()
103 return ELFObj->getELFFile().getRelativeRelocationType(); in loadObj()
106 return ELFObj->getELFFile().getRelativeRelocationType(); in loadObj()
118 if (ObjFile.getBinary()->getArch() == Triple::arm) { in loadObj()
120 Expected<uint64_t> ValueOrErr = Reloc.getSymbol()->getValue(); in loadObj()
130 Expected<uint64_t> ValueOrErr = Reloc.getSymbol()->getValue(); in loadObj()
147 bool Is32Bit = ObjFile.getBinary()->makeTriple().isArch32Bit(); in loadObj()
150 if ((C - Contents.bytes_end()) % ELFSledEntrySize != 0) in loadObj()
153 "an XRay sled entry."), in loadObj()
156 auto RelocateOrElse = [&](uint64_t Offset, uint64_t Address) { in loadObj() argument
157 if (!Address) { in loadObj()
158 uint64_t A = I->getAddress() + C - Contents.bytes_begin() + Offset; in loadObj()
161 return R->second; in loadObj()
163 return Address; in loadObj()
174 auto &Entry = Sleds.back(); in loadObj() local
178 Entry.Address = RelocateOrElse(AddrOff, Extractor.getU32(&OffsetPtr)); in loadObj()
180 Entry.Address = RelocateOrElse(AddrOff, Extractor.getU64(&OffsetPtr)); in loadObj()
183 Entry.Function = RelocateOrElse(FuncOff, Extractor.getU32(&OffsetPtr)); in loadObj()
185 Entry.Function = RelocateOrElse(FuncOff, Extractor.getU64(&OffsetPtr)); in loadObj()
188 SledEntry::FunctionKinds::ENTRY, SledEntry::FunctionKinds::EXIT, in loadObj()
195 Entry.Kind = Kinds[Kind]; in loadObj()
196 Entry.AlwaysInstrument = Extractor.getU8(&OffsetPtr) != 0; in loadObj()
197 Entry.Version = Extractor.getU8(&OffsetPtr); in loadObj()
198 if (Entry.Version >= 2) { in loadObj()
199 Entry.Address += C - Contents.bytes_begin() + Address; in loadObj()
200 Entry.Function += C - Contents.bytes_begin() + WordSize + Address; in loadObj()
207 CurFn = Entry.Function; in loadObj()
208 FunctionAddresses[FuncId] = Entry.Function; in loadObj()
209 FunctionIds[Entry.Function] = FuncId; in loadObj()
211 if (Entry.Function != CurFn) { in loadObj()
213 CurFn = Entry.Function; in loadObj()
214 FunctionAddresses[FuncId] = Entry.Function; in loadObj()
215 FunctionIds[Entry.Function] = FuncId; in loadObj()
232 Twine("Failed memory-mapping file '") + Filename + "'.", EC); in loadYAML()
246 Sleds.push_back(SledEntry{Y.Address, Y.Function, Y.Kind, Y.AlwaysInstrument, in loadYAML()
256 // At this point we assume the file is an object file -- and if that doesn't in loadInstrumentationMap()
258 // FIXME: Extend to support non-ELF and non-x86_64 binaries. in loadInstrumentationMap()