Lines Matching defs:Info
58 cl::desc("Print line information from debug info if available"));
61 cl::desc("Use .dSYM file for debug info"));
106 llvm::InfoPlist("info-plist",
107 cl::desc("Print the info plist section as strings for "
122 cl::desc("Print the info for Mach-O objects in "
1197 // the file name and header info and then processes it according to the
1203 // info. And don't print it otherwise like in the case of printing the
1721 // The block of info used by the Symbolizer call backs.
1754 struct DisassembleInfo *info = (struct DisassembleInfo *)DisInfo;
1765 if (TagType != 1 || !info->verbose)
1768 unsigned int Arch = info->O->getArch();
1774 uint32_t sect_addr = info->S.getAddress();
1783 for (const RelocationRef &Reloc : info->S.relocations()) {
1788 RE = info->O->getRelocation(Rel);
1789 r_type = info->O->getAnyRelocationType(RE);
1790 r_scattered = info->O->isRelocationScattered(RE);
1792 r_value = info->O->getScatteredRelocationValue(RE);
1796 info->O->moveRelocationNext(RelNext);
1798 RENext = info->O->getRelocation(RelNext);
1799 if (info->O->isRelocationScattered(RENext))
1800 pair_r_value = info->O->getScatteredRelocationValue(RENext);
1805 info->O->getPlainRelocationExternal(RE);
1827 const char *add = GuessSymbolName(r_value, info->AddrMap);
1828 const char *sub = GuessSymbolName(pair_r_value, info->AddrMap);
1854 uint64_t sect_addr = info->S.getAddress();
1861 for (const RelocationRef &Reloc : info->S.relocations()) {
1866 RE = info->O->getRelocation(Rel);
1868 isExtern = info->O->getPlainRelocationExternal(RE);
1881 if (info->O->getAnyRelocationPCRel(RE))
1886 unsigned Type = info->O->getAnyRelocationType(RE);
1889 info->O->moveRelocationNext(RelNext);
1890 MachO::any_relocation_info RENext = info->O->getRelocation(RelNext);
1891 unsigned TypeNext = info->O->getAnyRelocationType(RENext);
1892 bool isExternNext = info->O->getPlainRelocationExternal(RENext);
1893 unsigned SymbolNum = info->O->getPlainRelocationSymbolNum(RENext);
1897 symbol_iterator RelocSymNext = info->O->getSymbolByIndex(SymbolNum);
1921 uint32_t sect_addr = info->S.getAddress();
1930 std::find_if(info->S.relocations().begin(), info->S.relocations().end(),
1937 if (Reloc == info->S.relocations().end())
1941 RE = info->O->getRelocation(Rel);
1942 r_length = info->O->getAnyRelocationLength(RE);
1943 r_scattered = info->O->isRelocationScattered(RE);
1945 r_value = info->O->getScatteredRelocationValue(RE);
1946 r_type = info->O->getScatteredRelocationType(RE);
1948 r_type = info->O->getAnyRelocationType(RE);
1949 isExtern = info->O->getPlainRelocationExternal(RE);
1960 info->O->moveRelocationNext(RelNext);
1962 RENext = info->O->getRelocation(RelNext);
1963 other_half = info->O->getAnyRelocationAddress(RENext) & 0xffff;
1964 if (info->O->isRelocationScattered(RENext))
1965 pair_r_value = info->O->getScatteredRelocationValue(RENext);
2016 const char *add = GuessSymbolName(r_value, info->AddrMap);
2017 const char *sub = GuessSymbolName(pair_r_value, info->AddrMap);
2041 const char *add = GuessSymbolName(value, info->AddrMap);
2054 uint64_t sect_addr = info->S.getAddress();
2057 std::find_if(info->S.relocations().begin(), info->S.relocations().end(),
2064 if (Reloc == info->S.relocations().end())
2068 MachO::any_relocation_info RE = info->O->getRelocation(Rel);
2069 uint32_t r_type = info->O->getAnyRelocationType(RE);
2072 info->O->moveRelocationNext(RelNext);
2073 MachO::any_relocation_info RENext = info->O->getRelocation(RelNext);
2075 value = info->O->getPlainRelocationSymbolNum(RENext);
2080 if (!info->O->getPlainRelocationExternal(RE))
2127 struct DisassembleInfo *info) {
2128 uint32_t LoadCommandCount = info->O->getHeader().ncmds;
2129 MachOObjectFile::LoadCommandInfo Load = info->O->getFirstLoadCommandInfo();
2132 MachO::segment_command_64 Seg = info->O->getSegment64LoadCommand(Load);
2134 MachO::section_64 Sec = info->O->getSection64(Load, J);
2141 StringRef MachOContents = info->O->getData();
2153 MachO::segment_command Seg = info->O->getSegmentLoadCommand(Load);
2155 MachO::section Sec = info->O->getSection(Load, J);
2162 StringRef MachOContents = info->O->getData();
2177 Load = info->O->getNextLoadCommandInfo(Load);
2187 struct DisassembleInfo *info) {
2188 uint32_t LoadCommandCount = info->O->getHeader().ncmds;
2189 MachOObjectFile::LoadCommandInfo Load = info->O->getFirstLoadCommandInfo();
2190 MachO::dysymtab_command Dysymtab = info->O->getDysymtabLoadCommand();
2191 MachO::symtab_command Symtab = info->O->getSymtabLoadCommand();
2194 MachO::segment_command_64 Seg = info->O->getSegment64LoadCommand(Load);
2196 MachO::section_64 Sec = info->O->getSection64(Load, J);
2215 info->O->getIndirectSymbolTableEntry(Dysymtab, index);
2217 info->O->getSymbolByIndex(indirect_symbol);
2228 MachO::segment_command Seg = info->O->getSegmentLoadCommand(Load);
2230 MachO::section Sec = info->O->getSection(Load, J);
2249 info->O->getIndirectSymbolTableEntry(Dysymtab, index);
2251 symbol_iterator Sym = info->O->getSymbolByIndex(indirect_symbol);
2265 Load = info->O->getNextLoadCommandInfo(Load);
2274 // into the method field of the info and any previous string is free'ed.
2275 // Then the class_name field in the info is set to nullptr. The method call
2279 static void method_reference(struct DisassembleInfo *info,
2282 unsigned int Arch = info->O->getArch();
2285 if (info->selector_name != nullptr) {
2286 if (info->method != nullptr)
2287 free(info->method);
2288 if (info->class_name != nullptr) {
2289 info->method = (char *)malloc(5 + strlen(info->class_name) +
2290 strlen(info->selector_name));
2291 if (info->method != nullptr) {
2292 strcpy(info->method, "+[");
2293 strcat(info->method, info->class_name);
2294 strcat(info->method, " ");
2295 strcat(info->method, info->selector_name);
2296 strcat(info->method, "]");
2297 *ReferenceName = info->method;
2301 info->method = (char *)malloc(9 + strlen(info->selector_name));
2302 if (info->method != nullptr) {
2304 strcpy(info->method, "-[%rdi ");
2306 strcpy(info->method, "-[x0 ");
2308 strcpy(info->method, "-[r? ");
2309 strcat(info->method, info->selector_name);
2310 strcat(info->method, "]");
2311 *ReferenceName = info->method;
2315 info->class_name = nullptr;
2318 if (info->selector_name != nullptr) {
2319 if (info->method != nullptr)
2320 free(info->method);
2321 info->method = (char *)malloc(17 + strlen(info->selector_name));
2322 if (info->method != nullptr) {
2324 strcpy(info->method, "-[[%rdi super] ");
2326 strcpy(info->method, "-[[x0 super] ");
2328 strcpy(info->method, "-[[r? super] ");
2329 strcat(info->method, info->selector_name);
2330 strcat(info->method, "]");
2331 *ReferenceName = info->method;
2334 info->class_name = nullptr;
2345 struct DisassembleInfo *info,
2352 uint32_t LoadCommandCount = info->O->getHeader().ncmds;
2353 MachOObjectFile::LoadCommandInfo Load = info->O->getFirstLoadCommandInfo();
2356 MachO::segment_command_64 Seg = info->O->getSegment64LoadCommand(Load);
2358 MachO::section_64 Sec = info->O->getSection64(Load, J);
2368 StringRef MachOContents = info->O->getData();
2375 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
2387 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
2402 Load = info->O->getNextLoadCommandInfo(Load);
2414 DisassembleInfo *info,
2419 for (unsigned SectIdx = 0; SectIdx != info->Sections->size(); SectIdx++) {
2420 uint64_t SectAddress = ((*(info->Sections))[SectIdx]).getAddress();
2421 uint64_t SectSize = ((*(info->Sections))[SectIdx]).getSize();
2424 ((*(info->Sections))[SectIdx]).getName(SectName);
2425 DataRefImpl Ref = ((*(info->Sections))[SectIdx]).getRawDataRefImpl();
2426 StringRef SegName = info->O->getSectionFinalSegmentName(Ref);
2431 S = (*(info->Sections))[SectIdx];
2435 ((*(info->Sections))[SectIdx]).getContents(SectContents);
2444 DisassembleInfo *info,
2446 return get_pointer_64(Address, offset, left, S, info, objc_only);
2453 // symbol is passed, look up that address in the info's AddrMap.
2455 get_symbol_64(uint32_t sect_offset, SectionRef S, DisassembleInfo *info,
2459 if (!info->verbose)
2473 RE = info->O->getRelocation(Rel);
2474 if (info->O->isRelocationScattered(RE))
2476 isExtern = info->O->getPlainRelocationExternal(RE);
2513 SymbolName = GuessSymbolName(ReferenceValue, info->AddrMap);
2519 DisassembleInfo *info,
2522 return get_symbol_64(sect_offset, S, info, n_value64, ReferenceValue);
2765 int32_t info;
2773 #define CLS_GETINFO(cls, infomask) ((cls)->info & (infomask))
3048 sys::swapByteOrder(objc_class.info);
3108 struct DisassembleInfo *info);
3117 struct DisassembleInfo *info) {
3126 info);
3130 const char *symbol_name = get_symbol_64(offset, S, info, n_value);
3142 r = get_pointer_64(pointer_value, offset, left, S, info);
3147 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3151 r = get_pointer_64(c.data, offset, left, S, info);
3156 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3160 const char *name = get_pointer_64(cro.name, offset, left, S, info);
3167 struct DisassembleInfo *info) {
3174 r = get_pointer_64(ReferenceValue, offset, left, S, info);
3178 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3183 offset + offsetof(struct cfstring64_t, characters), S, info, n_value);
3189 name = get_pointer_64(cfs_characters, offset, left, S, info);
3201 struct DisassembleInfo *info) {
3205 const char *r = get_pointer_64(ReferenceValue, offset, left, S, info);
3209 const char *symbol_name = get_symbol_64(offset, S, info, n_value);
3230 MachOObjectFile *O, struct DisassembleInfo *info,
3231 void (*func)(uint64_t, struct DisassembleInfo *info)) {
3259 const char *name = get_symbol_64(i, S, info, n_value, p);
3261 name = get_dyld_bind_info_symbolname(S.getAddress() + i, info);
3275 func(p, info);
3281 MachOObjectFile *O, struct DisassembleInfo *info,
3282 void (*func)(uint32_t, struct DisassembleInfo *info)) {
3311 const char *name = get_symbol_32(i, S, info, p);
3317 func(p, info);
3331 static void print_layout_map64(uint64_t p, struct DisassembleInfo *info) {
3338 layout_map = get_pointer_64(p, offset, left, S, info);
3342 static void print_layout_map32(uint32_t p, struct DisassembleInfo *info) {
3349 layout_map = get_pointer_32(p, offset, left, S, info);
3353 static void print_method_list64_t(uint64_t p, struct DisassembleInfo *info,
3363 r = get_pointer_64(p, offset, left, S, info);
3372 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3380 r = get_pointer_64(p, offset, left, S, info);
3389 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3394 info, n_value, m.name);
3396 if (info->verbose && sym_name != nullptr)
3404 name = get_pointer_64(m.name + n_value, xoffset, left, xS, info);
3411 info, n_value, m.types);
3413 if (info->verbose && sym_name != nullptr)
3421 name = get_pointer_64(m.types + n_value, xoffset, left, xS, info);
3427 name = get_symbol_64(offset + offsetof(struct method64_t, imp), S, info,
3429 if (info->verbose && name == nullptr) {
3446 static void print_method_list32_t(uint64_t p, struct DisassembleInfo *info,
3454 r = get_pointer_32(p, offset, left, S, info);
3463 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3471 r = get_pointer_32(p, offset, left, S, info);
3480 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3484 name = get_pointer_32(m.name, xoffset, left, xS, info);
3490 name = get_pointer_32(m.types, xoffset, left, xS, info);
3496 name = get_symbol_32(offset + offsetof(struct method32_t, imp), S, info,
3507 static bool print_method_list(uint32_t p, struct DisassembleInfo *info) {
3515 r = get_pointer_32(p, offset, left, S, info, true);
3527 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3542 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3547 if (info->verbose) {
3548 name = get_pointer_32(method.method_name, offset, xleft, S, info, true);
3558 if (info->verbose) {
3559 name = get_pointer_32(method.method_types, offset, xleft, S, info, true);
3569 if (info->verbose) {
3570 SymbolName = GuessSymbolName(method.method_imp, info->AddrMap);
3579 static void print_protocol_list64_t(uint64_t p, struct DisassembleInfo *info) {
3588 r = get_pointer_64(p, offset, left, S, info);
3597 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3604 r = get_pointer_64(p, offset, left, S, info);
3613 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3617 sym_name = get_symbol_64(offset, S, info, n_value, q);
3619 if (info->verbose && sym_name != nullptr)
3629 r = get_pointer_64(q + n_value, offset, left, S, info);
3638 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3645 info, n_value, pc.name);
3647 if (info->verbose && sym_name != nullptr)
3655 name = get_pointer_64(pc.name + n_value, xoffset, left, xS, info);
3665 S, info, n_value, pc.instanceMethods);
3667 if (info->verbose && sym_name != nullptr)
3677 print_method_list64_t(pc.instanceMethods + n_value, info, "\t");
3682 info, n_value, pc.classMethods);
3684 if (info->verbose && sym_name != nullptr)
3694 print_method_list64_t(pc.classMethods + n_value, info, "\t");
3708 static void print_protocol_list32_t(uint32_t p, struct DisassembleInfo *info) {
3717 r = get_pointer_32(p, offset, left, S, info);
3726 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3733 r = get_pointer_32(p, offset, left, S, info);
3742 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3746 r = get_pointer_32(q, offset, left, S, info);
3755 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3759 name = get_pointer_32(pc.name, xoffset, left, xS, info);
3768 print_method_list32_t(pc.instanceMethods, info, "\t");
3772 print_method_list32_t(pc.classMethods, info, "\t");
3798 struct DisassembleInfo *info) {
3806 r = get_pointer_32(p, offset, left, S, info, true);
3819 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3836 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3841 if (info->verbose) {
3842 name = get_pointer_32(md.name, offset, xleft, S, info, true);
3852 if (info->verbose) {
3853 name = get_pointer_32(md.types, offset, xleft, S, info, true);
3865 struct DisassembleInfo *info);
3868 struct DisassembleInfo *info) {
3874 r = get_pointer_32(p, offset, left, S, info, true);
3887 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3897 if (info->verbose) {
3898 name = get_pointer_32(protocol.protocol_name, offset, left, S, info, true);
3909 if (print_protocol_list(protocol.protocol_list, indent + 4, info))
3915 if (print_method_description_list(protocol.instance_methods, indent, info))
3921 if (print_method_description_list(protocol.class_methods, indent, info))
3928 struct DisassembleInfo *info) {
3935 r = get_pointer_32(p, offset, left, S, info, true);
3947 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3963 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
3968 if (print_protocol(l, indent, info))
3974 static void print_ivar_list64_t(uint64_t p, struct DisassembleInfo *info) {
3983 r = get_pointer_64(p, offset, left, S, info);
3992 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4000 r = get_pointer_64(p, offset, left, S, info);
4009 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4014 info, n_value, i.offset);
4016 if (info->verbose && sym_name != nullptr)
4024 ivar_offset_p = get_pointer_64(i.offset + n_value, xoffset, left, xS, info);
4027 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4034 sym_name = get_symbol_64(offset + offsetof(struct ivar64_t, name), S, info,
4037 if (info->verbose && sym_name != nullptr)
4045 name = get_pointer_64(i.name + n_value, xoffset, left, xS, info);
4051 sym_name = get_symbol_64(offset + offsetof(struct ivar64_t, type), S, info,
4053 name = get_pointer_64(i.type + n_value, xoffset, left, xS, info);
4055 if (info->verbose && sym_name != nullptr)
4075 static void print_ivar_list32_t(uint32_t p, struct DisassembleInfo *info) {
4084 r = get_pointer_32(p, offset, left, S, info);
4093 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4101 r = get_pointer_32(p, offset, left, S, info);
4110 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4114 ivar_offset_p = get_pointer_32(i.offset, xoffset, left, xS, info);
4117 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4124 name = get_pointer_32(i.name, xoffset, left, xS, info);
4130 name = get_pointer_32(i.type, xoffset, left, xS, info);
4144 struct DisassembleInfo *info) {
4153 r = get_pointer_64(p, offset, left, S, info);
4162 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4170 r = get_pointer_64(p, offset, left, S, info);
4179 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4184 info, n_value, op.name);
4186 if (info->verbose && sym_name != nullptr)
4194 name = get_pointer_64(op.name + n_value, xoffset, left, xS, info);
4202 info, n_value, op.attributes);
4204 if (info->verbose && sym_name != nullptr)
4212 name = get_pointer_64(op.attributes + n_value, xoffset, left, xS, info);
4223 struct DisassembleInfo *info) {
4231 r = get_pointer_32(p, offset, left, S, info);
4240 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4248 r = get_pointer_32(p, offset, left, S, info);
4257 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4261 name = get_pointer_32(op.name, xoffset, left, xS, info);
4267 name = get_pointer_32(op.attributes, xoffset, left, xS, info);
4277 static void print_class_ro64_t(uint64_t p, struct DisassembleInfo *info,
4286 r = get_pointer_64(p, offset, left, S, info);
4295 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4311 print_layout_map64(cro.ivarLayout, info);
4315 info, n_value, cro.name);
4317 if (info->verbose && sym_name != nullptr)
4325 name = get_pointer_64(cro.name + n_value, xoffset, left, xS, info);
4332 S, info, n_value, cro.baseMethods);
4334 if (info->verbose && sym_name != nullptr)
4344 print_method_list64_t(cro.baseMethods + n_value, info, "");
4349 info, n_value, cro.baseProtocols);
4351 if (info->verbose && sym_name != nullptr)
4361 print_protocol_list64_t(cro.baseProtocols + n_value, info);
4365 info, n_value, cro.ivars);
4367 if (info->verbose && sym_name != nullptr)
4377 print_ivar_list64_t(cro.ivars + n_value, info);
4382 info, n_value, cro.weakIvarLayout);
4384 if (info->verbose && sym_name != nullptr)
4393 print_layout_map64(cro.weakIvarLayout + n_value, info);
4398 info, n_value, cro.baseProperties);
4400 if (info->verbose && sym_name != nullptr)
4410 print_objc_property_list64(cro.baseProperties + n_value, info);
4415 static void print_class_ro32_t(uint32_t p, struct DisassembleInfo *info,
4423 r = get_pointer_32(p, offset, left, S, info);
4432 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4446 print_layout_map32(cro.ivarLayout, info);
4449 name = get_pointer_32(cro.name, xoffset, left, xS, info);
4458 print_method_list32_t(cro.baseMethods, info, "");
4463 print_protocol_list32_t(cro.baseProtocols, info);
4467 print_ivar_list32_t(cro.ivars, info);
4470 print_layout_map32(cro.weakIvarLayout, info);
4474 print_objc_property_list32(cro.baseProperties, info);
4478 static void print_class64_t(uint64_t p, struct DisassembleInfo *info) {
4486 r = get_pointer_64(p, offset, left, S, info);
4495 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4499 name = get_symbol_64(offset + offsetof(struct class64_t, isa), S, info,
4506 name = get_symbol_64(offset + offsetof(struct class64_t, superclass), S, info,
4513 name = get_symbol_64(offset + offsetof(struct class64_t, cache), S, info,
4520 info,
4526 name = get_symbol_64(offset + offsetof(struct class64_t, data), S, info,
4530 if (info->verbose && name != nullptr)
4545 print_class_ro64_t((c.data + n_value) & ~0x7, info, is_meta_class);
4549 print_class64_t(c.isa + isa_n_value, info);
4553 static void print_class32_t(uint32_t p, struct DisassembleInfo *info) {
4560 r = get_pointer_32(p, offset, left, S, info);
4569 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4574 get_symbol_32(offset + offsetof(struct class32_t, isa), S, info, c.isa);
4580 name = get_symbol_32(offset + offsetof(struct class32_t, superclass), S, info,
4587 name = get_symbol_32(offset + offsetof(struct class32_t, cache), S, info,
4594 name = get_symbol_32(offset + offsetof(struct class32_t, vtable), S, info,
4601 get_symbol_32(offset + offsetof(struct class32_t, data), S, info, c.data);
4610 print_class_ro32_t(c.data & ~0x3, info, is_meta_class);
4614 print_class32_t(c.isa, info);
4619 struct DisassembleInfo *info) {
4628 if (info->verbose && CLS_GETINFO(objc_class, CLS_META)) {
4629 name = get_pointer_32(objc_class->isa, offset, left, S, info, true);
4639 if (info->verbose) {
4640 name = get_pointer_32(objc_class->super_class, offset, left, S, info, true);
4649 if (info->verbose) {
4650 name = get_pointer_32(objc_class->name, offset, left, S, info, true);
4661 outs() << "\t\t info " << format("0x%08" PRIx32, objc_class->info);
4662 if (info->verbose) {
4673 p = get_pointer_32(objc_class->ivars, offset, left, S, info, true);
4684 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4695 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4699 if (info->verbose) {
4700 name = get_pointer_32(ivar.ivar_name, offset, xleft, S, info, true);
4709 if (info->verbose) {
4710 name = get_pointer_32(ivar.ivar_type, offset, xleft, S, info, true);
4726 if (print_method_list(objc_class->methodLists, info))
4733 if (print_protocol_list(objc_class->protocols, 16, info))
4738 struct DisassembleInfo *info) {
4745 if (info->verbose) {
4746 name = get_pointer_32(objc_category->category_name, offset, left, S, info,
4757 if (info->verbose) {
4759 get_pointer_32(objc_category->class_name, offset, left, S, info, true);
4769 if (print_method_list(objc_category->instance_methods, info))
4774 if (print_method_list(objc_category->class_methods, info))
4778 static void print_category64_t(uint64_t p, struct DisassembleInfo *info) {
4786 r = get_pointer_64(p, offset, left, S, info);
4795 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4800 info, n_value, c.name);
4802 if (info->verbose && sym_name != nullptr)
4810 name = get_pointer_64(c.name + n_value, xoffset, left, xS, info);
4816 sym_name = get_symbol_64(offset + offsetof(struct category64_t, cls), S, info,
4819 if (info->verbose && sym_name != nullptr)
4829 print_class64_t(c.cls + n_value, info);
4834 info, n_value, c.instanceMethods);
4836 if (info->verbose && sym_name != nullptr)
4846 print_method_list64_t(c.instanceMethods + n_value, info, "");
4850 S, info, n_value, c.classMethods);
4852 if (info->verbose && sym_name != nullptr)
4862 print_method_list64_t(c.classMethods + n_value, info, "");
4866 info, n_value, c.protocols);
4868 if (info->verbose && sym_name != nullptr)
4878 print_protocol_list64_t(c.protocols + n_value, info);
4883 S, info, n_value, c.instanceProperties);
4885 if (info->verbose && sym_name != nullptr)
4895 print_objc_property_list64(c.instanceProperties + n_value, info);
4898 static void print_category32_t(uint32_t p, struct DisassembleInfo *info) {
4905 r = get_pointer_32(p, offset, left, S, info);
4914 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4918 name = get_symbol_32(offset + offsetof(struct category32_t, name), S, info,
4926 print_class32_t(c.cls, info);
4930 print_method_list32_t(c.instanceMethods, info, "");
4934 print_method_list32_t(c.classMethods, info, "");
4937 print_protocol_list32_t(c.protocols, info);
4941 print_objc_property_list32(c.instanceProperties, info);
4944 static void print_message_refs64(SectionRef S, struct DisassembleInfo *info) {
4958 StringRef SegName = info->O->getSectionFinalSegmentName(Ref);
4963 r = get_pointer_64(p, offset, left, S, info);
4972 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
4976 name = get_symbol_64(offset + offsetof(struct message_ref64, imp), S, info,
4990 info, n_value, mr.sel);
4992 if (info->verbose && sym_name != nullptr)
5000 name = get_pointer_64(mr.sel + n_value, xoffset, left, xS, info);
5009 static void print_message_refs32(SectionRef S, struct DisassembleInfo *info) {
5021 StringRef SegName = info->O->getSectionFinalSegmentName(Ref);
5026 r = get_pointer_32(p, offset, left, S, info);
5035 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
5039 name = get_symbol_32(offset + offsetof(struct message_ref32, imp), S, info,
5046 name = get_pointer_32(mr.sel, xoffset, left, xS, info);
5055 static void print_image_info64(SectionRef S, struct DisassembleInfo *info) {
5064 StringRef SegName = info->O->getSectionFinalSegmentName(Ref);
5067 r = get_pointer_64(p, offset, left, S, info);
5076 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
5096 static void print_image_info32(SectionRef S, struct DisassembleInfo *info) {
5104 StringRef SegName = info->O->getSectionFinalSegmentName(Ref);
5107 r = get_pointer_32(p, offset, left, S, info);
5116 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
5136 static void print_image_info(SectionRef S, struct DisassembleInfo *info) {
5144 StringRef SegName = info->O->getSectionFinalSegmentName(Ref);
5147 r = get_pointer_32(p, offset, left, S, info);
5156 if (info->O->isLittleEndian() != sys::IsLittleEndianHost)
5183 struct DisassembleInfo info;
5184 // Set up the block of info used by the Symbolizer call backs.
5185 info.verbose = verbose;
5186 info.O = O;
5187 info.AddrMap = &AddrMap;
5188 info.Sections = &Sections;
5189 info.class_name = nullptr;
5190 info.selector_name = nullptr;
5191 info.method = nullptr;
5192 info.demangled_name = nullptr;
5193 info.bindtable = nullptr;
5194 info.adrp_addr = 0;
5195 info.adrp_inst = 0;
5199 info.S = CL;
5200 walk_pointer_list_64("class", CL, O, &info, print_class64_t);
5203 info.S = CL;
5204 walk_pointer_list_64("class", CL, O, &info, print_class64_t);
5209 info.S = CR;
5210 walk_pointer_list_64("class refs", CR, O, &info, nullptr);
5213 info.S = CR;
5214 walk_pointer_list_64("class refs", CR, O, &info, nullptr);
5219 info.S = SR;
5220 walk_pointer_list_64("super refs", SR, O, &info, nullptr);
5223 info.S = SR;
5224 walk_pointer_list_64("super refs", SR, O, &info, nullptr);
5229 info.S = CA;
5230 walk_pointer_list_64("category", CA, O, &info, print_category64_t);
5233 info.S = CA;
5234 walk_pointer_list_64("category", CA, O, &info, print_category64_t);
5239 info.S = PL;
5240 walk_pointer_list_64("protocol", PL, O, &info, nullptr);
5243 info.S = PL;
5244 walk_pointer_list_64("protocol", PL, O, &info, nullptr);
5249 info.S = MR;
5250 print_message_refs64(MR, &info);
5253 info.S = MR;
5254 print_message_refs64(MR, &info);
5259 info.S = II;
5260 print_image_info64(II, &info);
5263 info.S = II;
5264 print_image_info64(II, &info);
5267 if (info.bindtable != nullptr)
5268 delete info.bindtable;
5283 struct DisassembleInfo info;
5284 // Set up the block of info used by the Symbolizer call backs.
5285 info.verbose = verbose;
5286 info.O = O;
5287 info.AddrMap = &AddrMap;
5288 info.Sections = &Sections;
5289 info.class_name = nullptr;
5290 info.selector_name = nullptr;
5291 info.method = nullptr;
5292 info.demangled_name = nullptr;
5293 info.bindtable = nullptr;
5294 info.adrp_addr = 0;
5295 info.adrp_inst = 0;
5299 info.S = CL;
5300 walk_pointer_list_32("class", CL, O, &info, print_class32_t);
5303 info.S = CL;
5304 walk_pointer_list_32("class", CL, O, &info, print_class32_t);
5309 info.S = CR;
5310 walk_pointer_list_32("class refs", CR, O, &info, nullptr);
5313 info.S = CR;
5314 walk_pointer_list_32("class refs", CR, O, &info, nullptr);
5319 info.S = SR;
5320 walk_pointer_list_32("super refs", SR, O, &info, nullptr);
5323 info.S = SR;
5324 walk_pointer_list_32("super refs", SR, O, &info, nullptr);
5329 info.S = CA;
5330 walk_pointer_list_32("category", CA, O, &info, print_category32_t);
5333 info.S = CA;
5334 walk_pointer_list_32("category", CA, O, &info, print_category32_t);
5339 info.S = PL;
5340 walk_pointer_list_32("protocol", PL, O, &info, nullptr);
5343 info.S = PL;
5344 walk_pointer_list_32("protocol", PL, O, &info, nullptr);
5349 info.S = MR;
5350 print_message_refs32(MR, &info);
5353 info.S = MR;
5354 print_message_refs32(MR, &info);
5359 info.S = II;
5360 print_image_info32(II, &info);
5363 info.S = II;
5364 print_image_info32(II, &info);
5393 struct DisassembleInfo info;
5394 // Set up the block of info used by the Symbolizer call backs.
5395 info.verbose = verbose;
5396 info.O = O;
5397 info.AddrMap = &AddrMap;
5398 info.Sections = &Sections;
5399 info.class_name = nullptr;
5400 info.selector_name = nullptr;
5401 info.method = nullptr;
5402 info.demangled_name = nullptr;
5403 info.bindtable = nullptr;
5404 info.adrp_addr = 0;
5405 info.adrp_inst = 0;
5409 r = get_pointer_32(p, offset, left, S, &info, true);
5425 name = get_pointer_32(module.name, xoffset, left, xS, &info, true);
5433 r = get_pointer_32(module.symtab, xoffset, left, xS, &info, true);
5457 r = get_pointer_32(symtab.refs, xoffset, left, xS, &info, true);
5476 r = get_pointer_32(def, xoffset, left, xS, &info, true);
5489 info);
5496 r = get_pointer_32(objc_class.isa, xoffset, left, xS, &info, true);
5508 print_objc_class_t(&objc_class, &info);
5527 r = get_pointer_32(def, xoffset, left, xS, &info, true);
5541 print_objc_objc_category_t(&objc_category, &info);
5549 print_image_info(II, &info);
5566 struct DisassembleInfo info;
5567 // Set up the block of info used by the Symbolizer call backs.
5568 info.verbose = true;
5569 info.O = O;
5570 info.AddrMap = &AddrMap;
5571 info.Sections = &Sections;
5572 info.class_name = nullptr;
5573 info.selector_name = nullptr;
5574 info.method = nullptr;
5575 info.demangled_name = nullptr;
5576 info.bindtable = nullptr;
5577 info.adrp_addr = 0;
5578 info.adrp_inst = 0;
5595 if (print_protocol(paddr, 0, &info))
5641 struct DisassembleInfo *info) {
5643 uint64_t sect_addr = info->S.getAddress();
5650 for (const RelocationRef &Reloc : info->S.relocations()) {
5655 RE = info->O->getRelocation(Rel);
5656 if (info->O->isRelocationScattered(RE))
5658 isExtern = info->O->getPlainRelocationExternal(RE);
5670 if (info->O->getAnyRelocationPCRel(RE)) {
5671 unsigned Type = info->O->getAnyRelocationType(RE);
5681 uint64_t pointer_value = GuessPointerPointer(ReferenceValue, info, classref,
5687 const char *name = get_dyld_bind_info_symbolname(ReferenceValue, info);
5693 info->class_name = class_name + 2;
5702 get_objc2_64bit_class_name(pointer_value, ReferenceValue, info);
5704 info->class_name = name;
5712 const char *name = get_objc2_64bit_cfstring_name(ReferenceValue, info);
5717 pointer_value = get_objc2_64bit_selref(ReferenceValue, info);
5722 const char *name = GuessCstringPointer(ReferenceValue, info);
5726 info->selector_name = name;
5728 info->class_name = nullptr;
5730 info->selector_name = name;
5738 name = GuessIndirectSymbol(ReferenceValue, info);
5748 // the Symbolizer. It looks up the ReferenceValue using the info passed via the
5780 struct DisassembleInfo *info = (struct DisassembleInfo *)DisInfo;
5782 if (!info->verbose) {
5788 const char *SymbolName = GuessSymbolName(ReferenceValue, info->AddrMap);
5791 *ReferenceName = GuessIndirectSymbol(ReferenceValue, info);
5793 method_reference(info, ReferenceType, ReferenceName);
5799 if (info->demangled_name != nullptr)
5800 free(info->demangled_name);
5802 info->demangled_name =
5804 if (info->demangled_name != nullptr) {
5805 *ReferenceName = info->demangled_name;
5814 GuessLiteralPointer(ReferenceValue, ReferencePC, ReferenceType, info);
5816 method_reference(info, ReferenceType, ReferenceName);
5822 } else if (info->O->getArch() == Triple::aarch64 &&
5824 info->adrp_inst = ReferenceValue;
5825 info->adrp_addr = ReferencePC;
5836 } else if (info->O->getArch() == Triple::aarch64 &&
5838 ReferencePC - 4 == info->adrp_addr &&
5839 (info->adrp_inst & 0x9f000000) == 0x90000000 &&
5840 (info->adrp_inst & 0x1f) == ((ReferenceValue >> 5) & 0x1f)) {
5845 ((info->adrp_inst & 0x00ffffe0) >> 3) | ((info->adrp_inst >> 29) & 0x3);
5846 if (info->adrp_inst & 0x0200000)
5854 ReferenceValue = (info->adrp_addr & 0xfffffffffffff000LL) +
5858 GuessLiteralPointer(ReferenceValue, ReferencePC, ReferenceType, info);
5866 } else if (info->O->getArch() == Triple::aarch64 &&
5868 ReferencePC - 4 == info->adrp_addr &&
5869 (info->adrp_inst & 0x9f000000) == 0x90000000 &&
5870 (info->adrp_inst & 0x1f) == ((ReferenceValue >> 5) & 0x1f)) {
5875 ((info->adrp_inst & 0x00ffffe0) >> 3) | ((info->adrp_inst >> 29) & 0x3);
5876 if (info->adrp_inst & 0x0200000)
5882 ReferenceValue = (info->adrp_addr & 0xfffffffffffff000LL) +
5886 GuessLiteralPointer(ReferenceValue, ReferencePC, ReferenceType, info);
5892 else if (info->O->getArch() == Triple::aarch64 &&
5896 GuessLiteralPointer(ReferenceValue, ReferencePC, ReferenceType, info);
5902 if (info->demangled_name != nullptr)
5903 free(info->demangled_name);
5905 info->demangled_name =
5907 if (info->demangled_name != nullptr) {
5908 *ReferenceName = info->demangled_name;
6100 // Try to find debug info and set up the DIContext for it.
6179 // Set up the block of info used by the Symbolizer call backs.
6320 // Print debug info.
6323 // Print valid line info if it changed.
6837 // in the convenience lookup for unwind info and just take up resources.
8622 SectionInfo Info;
8623 if (error(Section.getName(Info.SectionName)))
8625 Info.Address = Section.getAddress();
8626 Info.Size = Section.getSize();
8627 Info.SegmentName =
8629 if (!Info.SegmentName.equals(CurSegName)) {
8631 CurSegName = Info.SegmentName;
8632 CurSegAddress = Info.Address;
8634 Info.SegmentIndex = CurSegIndex - 1;
8635 Info.OffsetInSegment = Info.Address - CurSegAddress;
8636 Info.SegmentStartAddress = CurSegAddress;
8637 Sections.push_back(Info);
8810 struct DisassembleInfo *info) {
8811 if (info->bindtable == nullptr) {
8812 info->bindtable = new (BindTable);
8813 SegInfo sectionTable(info->O);
8814 for (const llvm::object::MachOBindEntry &Entry : info->O->bindTable()) {
8822 info->bindtable->push_back(std::make_pair(Address, SymbolName));
8825 for (bind_table_iterator BI = info->bindtable->begin(),
8826 BE = info->bindtable->end();