Lines Matching refs:DRI

35   DataRefImpl DRI;
36 DRI.d.a = DRI.d.b = 0;
37 moveToNextSection(DRI);
39 while (DRI.d.a < LoadCommandCount) {
40 Sections.push_back(DRI);
41 DRI.d.b++;
42 moveToNextSection(DRI);
58 void MachOObjectFile::moveToNextSymbol(DataRefImpl &DRI) const {
60 while (DRI.d.a < LoadCommandCount) {
61 LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
65 if (DRI.d.b < SymtabLoadCmd->NumSymbolTableEntries)
69 DRI.d.a++;
70 DRI.d.b = 0;
74 void MachOObjectFile::getSymbolTableEntry(DataRefImpl DRI,
77 LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
80 if (RegisteredStringTable != DRI.d.a) {
82 RegisteredStringTable = DRI.d.a;
85 MachOObj->ReadSymbolTableEntry(SymtabLoadCmd->SymbolTableOffset, DRI.d.b,
89 void MachOObjectFile::getSymbol64TableEntry(DataRefImpl DRI,
92 LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
95 if (RegisteredStringTable != DRI.d.a) {
97 RegisteredStringTable = DRI.d.a;
100 MachOObj->ReadSymbol64TableEntry(SymtabLoadCmd->SymbolTableOffset, DRI.d.b,
105 error_code MachOObjectFile::getSymbolNext(DataRefImpl DRI,
107 DRI.d.b++;
108 moveToNextSymbol(DRI);
109 Result = SymbolRef(DRI, this);
113 error_code MachOObjectFile::getSymbolName(DataRefImpl DRI,
117 getSymbol64TableEntry(DRI, Entry);
121 getSymbolTableEntry(DRI, Entry);
127 error_code MachOObjectFile::getSymbolOffset(DataRefImpl DRI,
133 getSymbol64TableEntry(DRI, Entry);
138 getSymbolTableEntry(DRI, Entry);
148 error_code MachOObjectFile::getSymbolAddress(DataRefImpl DRI,
152 getSymbol64TableEntry(DRI, Entry);
156 getSymbolTableEntry(DRI, Entry);
162 error_code MachOObjectFile::getSymbolSize(DataRefImpl DRI,
168 error_code MachOObjectFile::getSymbolNMTypeChar(DataRefImpl DRI,
173 getSymbol64TableEntry(DRI, Entry);
178 getSymbolTableEntry(DRI, Entry);
203 error_code MachOObjectFile::isSymbolInternal(DataRefImpl DRI,
207 getSymbol64TableEntry(DRI, Entry);
211 getSymbolTableEntry(DRI, Entry);
262 // DRI.d.a = segment number; DRI.d.b = symbol index.
263 DataRefImpl DRI;
264 DRI.d.a = DRI.d.b = 0;
265 moveToNextSymbol(DRI);
266 return symbol_iterator(SymbolRef(DRI, this));
270 DataRefImpl DRI;
271 DRI.d.a = MachOObj->getHeader().NumLoadCommands;
272 DRI.d.b = 0;
273 return symbol_iterator(SymbolRef(DRI, this));
279 void MachOObjectFile::moveToNextSection(DataRefImpl &DRI) const {
281 while (DRI.d.a < LoadCommandCount) {
282 LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
286 if (DRI.d.b < SegmentLoadCmd->NumSections)
291 if (DRI.d.b < Segment64LoadCmd->NumSections)
295 DRI.d.a++;
296 DRI.d.b = 0;
300 error_code MachOObjectFile::getSectionNext(DataRefImpl DRI,
302 DRI.d.b++;
303 moveToNextSection(DRI);
304 Result = SectionRef(DRI, this);
309 MachOObjectFile::getSection(DataRefImpl DRI,
312 LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
314 MachOObj->ReadSection(LCI, DRI.d.b, Res);
325 MachOObjectFile::getSection64(DataRefImpl DRI,
328 LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
330 MachOObj->ReadSection64(LCI, DRI.d.b, Res);
333 static bool is64BitLoadCommand(const MachOObject *MachOObj, DataRefImpl DRI) {
334 LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
341 error_code MachOObjectFile::getSectionName(DataRefImpl DRI,
345 if (is64BitLoadCommand(MachOObj, DRI)) {
347 LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
350 MachOObj->ReadSection64(LCI, DRI.d.b, Sect);
357 LoadCommandInfo LCI = MachOObj->getLoadCommandInfo(DRI.d.a);
360 MachOObj->ReadSection(LCI, DRI.d.b, Sect);
370 error_code MachOObjectFile::getSectionAddress(DataRefImpl DRI,
372 if (is64BitLoadCommand(MachOObj, DRI)) {
374 getSection64(DRI, Sect);
378 getSection(DRI, Sect);
384 error_code MachOObjectFile::getSectionSize(DataRefImpl DRI,
386 if (is64BitLoadCommand(MachOObj, DRI)) {
388 getSection64(DRI, Sect);
392 getSection(DRI, Sect);
398 error_code MachOObjectFile::getSectionContents(DataRefImpl DRI,
400 if (is64BitLoadCommand(MachOObj, DRI)) {
402 getSection64(DRI, Sect);
406 getSection(DRI, Sect);
412 error_code MachOObjectFile::getSectionAlignment(DataRefImpl DRI,
414 if (is64BitLoadCommand(MachOObj, DRI)) {
416 getSection64(DRI, Sect);
420 getSection(DRI, Sect);
426 error_code MachOObjectFile::isSectionText(DataRefImpl DRI,
428 if (is64BitLoadCommand(MachOObj, DRI)) {
430 getSection64(DRI, Sect);
434 getSection(DRI, Sect);
440 error_code MachOObjectFile::isSectionData(DataRefImpl DRI,
447 error_code MachOObjectFile::isSectionBSS(DataRefImpl DRI,
508 DataRefImpl DRI;
509 DRI.d.a = DRI.d.b = 0;
510 moveToNextSection(DRI);
511 return section_iterator(SectionRef(DRI, this));
515 DataRefImpl DRI;
516 DRI.d.a = MachOObj->getHeader().NumLoadCommands;
517 DRI.d.b = 0;
518 return section_iterator(SectionRef(DRI, this));