Lines Matching defs:IO

84     IO &IO, MachOYAML::FileHeader &FileHdr) {
85 IO.mapRequired("magic", FileHdr.magic);
86 IO.mapRequired("cputype", FileHdr.cputype);
87 IO.mapRequired("cpusubtype", FileHdr.cpusubtype);
88 IO.mapRequired("filetype", FileHdr.filetype);
89 IO.mapRequired("ncmds", FileHdr.ncmds);
90 IO.mapRequired("sizeofcmds", FileHdr.sizeofcmds);
91 IO.mapRequired("flags", FileHdr.flags);
94 IO.mapRequired("reserved", FileHdr.reserved);
97 void MappingTraits<MachOYAML::Object>::mapping(IO &IO,
101 if (!IO.getContext()) {
102 IO.setContext(&Object);
104 IO.mapTag("!mach-o", true);
105 IO.mapOptional("IsLittleEndian", Object.IsLittleEndian,
109 IO.mapRequired("FileHeader", Object.Header);
112 IO.mapOptional("LoadCommands", Object.LoadCommands);
114 if (Object.RawLinkEditSegment || !IO.outputting())
115 IO.mapOptional("__LINKEDIT", Object.RawLinkEditSegment);
116 if(!Object.LinkEdit.isEmpty() || !IO.outputting())
117 IO.mapOptional("LinkEditData", Object.LinkEdit);
119 if(!Object.DWARF.isEmpty() || !IO.outputting())
120 IO.mapOptional("DWARF", Object.DWARF);
122 if (IO.getContext() == &Object)
123 IO.setContext(nullptr);
127 IO &IO, MachOYAML::FatHeader &FatHeader) {
128 IO.mapRequired("magic", FatHeader.magic);
129 IO.mapRequired("nfat_arch", FatHeader.nfat_arch);
132 void MappingTraits<MachOYAML::FatArch>::mapping(IO &IO,
134 IO.mapRequired("cputype", FatArch.cputype);
135 IO.mapRequired("cpusubtype", FatArch.cpusubtype);
136 IO.mapRequired("offset", FatArch.offset);
137 IO.mapRequired("size", FatArch.size);
138 IO.mapRequired("align", FatArch.align);
139 IO.mapOptional("reserved", FatArch.reserved,
144 IO &IO, MachOYAML::UniversalBinary &UniversalBinary) {
145 if (!IO.getContext()) {
146 IO.setContext(&UniversalBinary);
147 IO.mapTag("!fat-mach-o", true);
149 IO.mapRequired("FatHeader", UniversalBinary.Header);
150 IO.mapRequired("FatArchs", UniversalBinary.FatArchs);
151 IO.mapRequired("Slices", UniversalBinary.Slices);
153 if (IO.getContext() == &UniversalBinary)
154 IO.setContext(nullptr);
158 IO &IO, MachOYAML::LinkEditData &LinkEditData) {
159 IO.mapOptional("RebaseOpcodes", LinkEditData.RebaseOpcodes);
160 IO.mapOptional("BindOpcodes", LinkEditData.BindOpcodes);
161 IO.mapOptional("WeakBindOpcodes", LinkEditData.WeakBindOpcodes);
162 IO.mapOptional("LazyBindOpcodes", LinkEditData.LazyBindOpcodes);
163 if (!LinkEditData.ExportTrie.Children.empty() || !IO.outputting())
164 IO.mapOptional("ExportTrie", LinkEditData.ExportTrie);
165 IO.mapOptional("NameList", LinkEditData.NameList);
166 IO.mapOptional("StringTable", LinkEditData.StringTable);
167 IO.mapOptional("IndirectSymbols", LinkEditData.IndirectSymbols);
168 IO.mapOptional("FunctionStarts", LinkEditData.FunctionStarts);
169 IO.mapOptional("ChainedFixups", LinkEditData.ChainedFixups);
170 IO.mapOptional("DataInCode", LinkEditData.DataInCode);
174 IO &IO, MachOYAML::RebaseOpcode &RebaseOpcode) {
175 IO.mapRequired("Opcode", RebaseOpcode.Opcode);
176 IO.mapRequired("Imm", RebaseOpcode.Imm);
177 IO.mapOptional("ExtraData", RebaseOpcode.ExtraData);
181 IO &IO, MachOYAML::BindOpcode &BindOpcode) {
182 IO.mapRequired("Opcode", BindOpcode.Opcode);
183 IO.mapRequired("Imm", BindOpcode.Imm);
184 IO.mapOptional("ULEBExtraData", BindOpcode.ULEBExtraData);
185 IO.mapOptional("SLEBExtraData", BindOpcode.SLEBExtraData);
186 IO.mapOptional("Symbol", BindOpcode.Symbol);
190 IO &IO, MachOYAML::ExportEntry &ExportEntry) {
191 IO.mapRequired("TerminalSize", ExportEntry.TerminalSize);
192 IO.mapOptional("NodeOffset", ExportEntry.NodeOffset);
193 IO.mapOptional("Name", ExportEntry.Name);
194 IO.mapOptional("Flags", ExportEntry.Flags);
195 IO.mapOptional("Address", ExportEntry.Address);
196 IO.mapOptional("Other", ExportEntry.Other);
197 IO.mapOptional("ImportName", ExportEntry.ImportName);
198 IO.mapOptional("Children", ExportEntry.Children);
202 IO &IO, MachOYAML::NListEntry &NListEntry) {
203 IO.mapRequired("n_strx", NListEntry.n_strx);
204 IO.mapRequired("n_type", NListEntry.n_type);
205 IO.mapRequired("n_sect", NListEntry.n_sect);
206 IO.mapRequired("n_desc", NListEntry.n_desc);
207 IO.mapRequired("n_value", NListEntry.n_value);
211 IO &IO, MachOYAML::DataInCodeEntry &DataInCodeEntry) {
212 IO.mapRequired("Offset", DataInCodeEntry.Offset);
213 IO.mapRequired("Length", DataInCodeEntry.Length);
214 IO.mapRequired("Kind", DataInCodeEntry.Kind);
218 void mapLoadCommandData(IO &IO, MachOYAML::LoadCommand &LoadCommand) {}
222 IO &IO, MachOYAML::LoadCommand &LoadCommand) {
223 IO.mapOptional("Sections", LoadCommand.Sections);
228 IO &IO, MachOYAML::LoadCommand &LoadCommand) {
229 IO.mapOptional("Sections", LoadCommand.Sections);
234 IO &IO, MachOYAML::LoadCommand &LoadCommand) {
235 IO.mapOptional("Content", LoadCommand.Content);
240 IO &IO, MachOYAML::LoadCommand &LoadCommand) {
241 IO.mapOptional("Content", LoadCommand.Content);
246 IO &IO, MachOYAML::LoadCommand &LoadCommand) {
247 IO.mapOptional("Content", LoadCommand.Content);
252 IO &IO, MachOYAML::LoadCommand &LoadCommand) {
253 IO.mapOptional("Content", LoadCommand.Content);
258 IO &IO, MachOYAML::LoadCommand &LoadCommand) {
259 IO.mapOptional("Content", LoadCommand.Content);
264 IO &IO, MachOYAML::LoadCommand &LoadCommand) {
265 IO.mapOptional("Content", LoadCommand.Content);
270 IO &IO, MachOYAML::LoadCommand &LoadCommand) {
271 IO.mapOptional("Content", LoadCommand.Content);
276 IO &IO, MachOYAML::LoadCommand &LoadCommand) {
277 IO.mapOptional("Tools", LoadCommand.Tools);
281 IO &IO, MachOYAML::LoadCommand &LoadCommand) {
284 IO.mapRequired("cmd", TempCmd);
286 IO.mapRequired("cmdsize", LoadCommand.Data.load_command_data.cmdsize);
290 MappingTraits<MachO::LCStruct>::mapping(IO, \
292 mapLoadCommandData<MachO::LCStruct>(IO, LoadCommand); \
298 IO.mapOptional("PayloadBytes", LoadCommand.PayloadBytes);
299 IO.mapOptional("ZeroPadBytes", LoadCommand.ZeroPadBytes, (uint64_t)0ull);
303 IO &IO, MachO::dyld_info_command &LoadCommand) {
304 IO.mapRequired("rebase_off", LoadCommand.rebase_off);
305 IO.mapRequired("rebase_size", LoadCommand.rebase_size);
306 IO.mapRequired("bind_off", LoadCommand.bind_off);
307 IO.mapRequired("bind_size", LoadCommand.bind_size);
308 IO.mapRequired("weak_bind_off", LoadCommand.weak_bind_off);
309 IO.mapRequired("weak_bind_size", LoadCommand.weak_bind_size);
310 IO.mapRequired("lazy_bind_off", LoadCommand.lazy_bind_off);
311 IO.mapRequired("lazy_bind_size", LoadCommand.lazy_bind_size);
312 IO.mapRequired("export_off", LoadCommand.export_off);
313 IO.mapRequired("export_size", LoadCommand.export_size);
317 IO &IO, MachOYAML::Relocation &Relocation) {
318 IO.mapRequired("address", Relocation.address);
319 IO.mapRequired("symbolnum", Relocation.symbolnum);
320 IO.mapRequired("pcrel", Relocation.is_pcrel);
321 IO.mapRequired("length", Relocation.length);
322 IO.mapRequired("extern", Relocation.is_extern);
323 IO.mapRequired("type", Relocation.type);
324 IO.mapRequired("scattered", Relocation.is_scattered);
325 IO.mapRequired("value", Relocation.value);
328 void MappingTraits<MachOYAML::Section>::mapping(IO &IO,
330 IO.mapRequired("sectname", Section.sectname);
331 IO.mapRequired("segname", Section.segname);
332 IO.mapRequired("addr", Section.addr);
333 IO.mapRequired("size", Section.size);
334 IO.mapRequired("offset", Section.offset);
335 IO.mapRequired("align", Section.align);
336 IO.mapRequired("reloff", Section.reloff);
337 IO.mapRequired("nreloc", Section.nreloc);
338 IO.mapRequired("flags", Section.flags);
339 IO.mapRequired("reserved1", Section.reserved1);
340 IO.mapRequired("reserved2", Section.reserved2);
341 IO.mapOptional("reserved3", Section.reserved3);
342 IO.mapOptional("content", Section.content);
343 IO.mapOptional("relocations", Section.relocations);
347 MappingTraits<MachOYAML::Section>::validate(IO &IO,
351 if (!IO.error() && Section.content &&
358 IO &IO, MachO::build_tool_version &tool) {
359 IO.mapRequired("tool", tool.tool);
360 IO.mapRequired("version", tool.version);
363 void MappingTraits<MachO::dylib>::mapping(IO &IO, MachO::dylib &DylibStruct) {
364 IO.mapRequired("name", DylibStruct.name);
365 IO.mapRequired("timestamp", DylibStruct.timestamp);
366 IO.mapRequired("current_version", DylibStruct.current_version);
367 IO.mapRequired("compatibility_version", DylibStruct.compatibility_version);
371 IO &IO, MachO::dylib_command &LoadCommand) {
372 IO.mapRequired("dylib", LoadCommand.dylib);
376 IO &IO, MachO::dylinker_command &LoadCommand) {
377 IO.mapRequired("name", LoadCommand.name);
381 IO &IO, MachO::dysymtab_command &LoadCommand) {
382 IO.mapRequired("ilocalsym", LoadCommand.ilocalsym);
383 IO.mapRequired("nlocalsym", LoadCommand.nlocalsym);
384 IO.mapRequired("iextdefsym", LoadCommand.iextdefsym);
385 IO.mapRequired("nextdefsym", LoadCommand.nextdefsym);
386 IO.mapRequired("iundefsym", LoadCommand.iundefsym);
387 IO.mapRequired("nundefsym", LoadCommand.nundefsym);
388 IO.mapRequired("tocoff", LoadCommand.tocoff);
389 IO.mapRequired("ntoc", LoadCommand.ntoc);
390 IO.mapRequired("modtaboff", LoadCommand.modtaboff);
391 IO.mapRequired("nmodtab", LoadCommand.nmodtab);
392 IO.mapRequired("extrefsymoff", LoadCommand.extrefsymoff);
393 IO.mapRequired("nextrefsyms", LoadCommand.nextrefsyms);
394 IO.mapRequired("indirectsymoff", LoadCommand.indirectsymoff);
395 IO.mapRequired("nindirectsyms", LoadCommand.nindirectsyms);
396 IO.mapRequired("extreloff", LoadCommand.extreloff);
397 IO.mapRequired("nextrel", LoadCommand.nextrel);
398 IO.mapRequired("locreloff", LoadCommand.locreloff);
399 IO.mapRequired("nlocrel", LoadCommand.nlocrel);
403 IO &IO, MachO::encryption_info_command &LoadCommand) {
404 IO.mapRequired("cryptoff", LoadCommand.cryptoff);
405 IO.mapRequired("cryptsize", LoadCommand.cryptsize);
406 IO.mapRequired("cryptid", LoadCommand.cryptid);
410 IO &IO, MachO::encryption_info_command_64 &LoadCommand) {
411 IO.mapRequired("cryptoff", LoadCommand.cryptoff);
412 IO.mapRequired("cryptsize", LoadCommand.cryptsize);
413 IO.mapRequired("cryptid", LoadCommand.cryptid);
414 IO.mapRequired("pad", LoadCommand.pad);
418 IO &IO, MachO::entry_point_command &LoadCommand) {
419 IO.mapRequired("entryoff", LoadCommand.entryoff);
420 IO.mapRequired("stacksize", LoadCommand.stacksize);
424 IO &IO, MachO::fvmfile_command &LoadCommand) {
425 IO.mapRequired("name", LoadCommand.name);
426 IO.mapRequired("header_addr", LoadCommand.header_addr);
429 void MappingTraits<MachO::fvmlib>::mapping(IO &IO, MachO::fvmlib &FVMLib) {
430 IO.mapRequired("name", FVMLib.name);
431 IO.mapRequired("minor_version", FVMLib.minor_version);
432 IO.mapRequired("header_addr", FVMLib.header_addr);
436 IO &IO, MachO::fvmlib_command &LoadCommand) {
437 IO.mapRequired("fvmlib", LoadCommand.fvmlib);
441 IO &IO, MachO::ident_command &LoadCommand) {}
444 IO &IO, MachO::linkedit_data_command &LoadCommand) {
445 IO.mapRequired("dataoff", LoadCommand.dataoff);
446 IO.mapRequired("datasize", LoadCommand.datasize);
450 IO &IO, MachO::linker_option_command &LoadCommand) {
451 IO.mapRequired("count", LoadCommand.count);
455 IO &IO, MachO::prebind_cksum_command &LoadCommand) {
456 IO.mapRequired("cksum", LoadCommand.cksum);
460 IO &IO, MachO::load_command &LoadCommand) {}
463 IO &IO, MachO::prebound_dylib_command &LoadCommand) {
464 IO.mapRequired("name", LoadCommand.name);
465 IO.mapRequired("nmodules", LoadCommand.nmodules);
466 IO.mapRequired("linked_modules", LoadCommand.linked_modules);
470 IO &IO, MachO::routines_command &LoadCommand) {
471 IO.mapRequired("init_address", LoadCommand.init_address);
472 IO.mapRequired("init_module", LoadCommand.init_module);
473 IO.mapRequired("reserved1", LoadCommand.reserved1);
474 IO.mapRequired("reserved2", LoadCommand.reserved2);
475 IO.mapRequired("reserved3", LoadCommand.reserved3);
476 IO.mapRequired("reserved4", LoadCommand.reserved4);
477 IO.mapRequired("reserved5", LoadCommand.reserved5);
478 IO.mapRequired("reserved6", LoadCommand.reserved6);
482 IO &IO, MachO::routines_command_64 &LoadCommand) {
483 IO.mapRequired("init_address", LoadCommand.init_address);
484 IO.mapRequired("init_module", LoadCommand.init_module);
485 IO.mapRequired("reserved1", LoadCommand.reserved1);
486 IO.mapRequired("reserved2", LoadCommand.reserved2);
487 IO.mapRequired("reserved3", LoadCommand.reserved3);
488 IO.mapRequired("reserved4", LoadCommand.reserved4);
489 IO.mapRequired("reserved5", LoadCommand.reserved5);
490 IO.mapRequired("reserved6", LoadCommand.reserved6);
494 IO &IO, MachO::rpath_command &LoadCommand) {
495 IO.mapRequired("path", LoadCommand.path);
498 void MappingTraits<MachO::section>::mapping(IO &IO, MachO::section &Section) {
499 IO.mapRequired("sectname", Section.sectname);
500 IO.mapRequired("segname", Section.segname);
501 IO.mapRequired("addr", Section.addr);
502 IO.mapRequired("size", Section.size);
503 IO.mapRequired("offset", Section.offset);
504 IO.mapRequired("align", Section.align);
505 IO.mapRequired("reloff", Section.reloff);
506 IO.mapRequired("nreloc", Section.nreloc);
507 IO.mapRequired("flags", Section.flags);
508 IO.mapRequired("reserved1", Section.reserved1);
509 IO.mapRequired("reserved2", Section.reserved2);
512 void MappingTraits<MachO::section_64>::mapping(IO &IO,
514 IO.mapRequired("sectname", Section.sectname);
515 IO.mapRequired("segname", Section.segname);
516 IO.mapRequired("addr", Section.addr);
517 IO.mapRequired("size", Section.size);
518 IO.mapRequired("offset", Section.offset);
519 IO.mapRequired("align", Section.align);
520 IO.mapRequired("reloff", Section.reloff);
521 IO.mapRequired("nreloc", Section.nreloc);
522 IO.mapRequired("flags", Section.flags);
523 IO.mapRequired("reserved1", Section.reserved1);
524 IO.mapRequired("reserved2", Section.reserved2);
525 IO.mapRequired("reserved3", Section.reserved3);
529 IO &IO, MachO::segment_command &LoadCommand) {
530 IO.mapRequired("segname", LoadCommand.segname);
531 IO.mapRequired("vmaddr", LoadCommand.vmaddr);
532 IO.mapRequired("vmsize", LoadCommand.vmsize);
533 IO.mapRequired("fileoff", LoadCommand.fileoff);
534 IO.mapRequired("filesize", LoadCommand.filesize);
535 IO.mapRequired("maxprot", LoadCommand.maxprot);
536 IO.mapRequired("initprot", LoadCommand.initprot);
537 IO.mapRequired("nsects", LoadCommand.nsects);
538 IO.mapRequired("flags", LoadCommand.flags);
542 IO &IO, MachO::segment_command_64 &LoadCommand) {
543 IO.mapRequired("segname", LoadCommand.segname);
544 IO.mapRequired("vmaddr", LoadCommand.vmaddr);
545 IO.mapRequired("vmsize", LoadCommand.vmsize);
546 IO.mapRequired("fileoff", LoadCommand.fileoff);
547 IO.mapRequired("filesize", LoadCommand.filesize);
548 IO.mapRequired("maxprot", LoadCommand.maxprot);
549 IO.mapRequired("initprot", LoadCommand.initprot);
550 IO.mapRequired("nsects", LoadCommand.nsects);
551 IO.mapRequired("flags", LoadCommand.flags);
555 IO &IO, MachO::source_version_command &LoadCommand) {
556 IO.mapRequired("version", LoadCommand.version);
560 IO &IO, MachO::sub_client_command &LoadCommand) {
561 IO.mapRequired("client", LoadCommand.client);
565 IO &IO, MachO::sub_framework_command &LoadCommand) {
566 IO.mapRequired("umbrella", LoadCommand.umbrella);
570 IO &IO, MachO::sub_library_command &LoadCommand) {
571 IO.mapRequired("sub_library", LoadCommand.sub_library);
575 IO &IO, MachO::sub_umbrella_command &LoadCommand) {
576 IO.mapRequired("sub_umbrella", LoadCommand.sub_umbrella);
580 IO &IO, MachO::symseg_command &LoadCommand) {
581 IO.mapRequired("offset", LoadCommand.offset);
582 IO.mapRequired("size", LoadCommand.size);
586 IO &IO, MachO::symtab_command &LoadCommand) {
587 IO.mapRequired("symoff", LoadCommand.symoff);
588 IO.mapRequired("nsyms", LoadCommand.nsyms);
589 IO.mapRequired("stroff", LoadCommand.stroff);
590 IO.mapRequired("strsize", LoadCommand.strsize);
594 IO &IO, MachO::thread_command &LoadCommand) {}
597 IO &IO, MachO::twolevel_hints_command &LoadCommand) {
598 IO.mapRequired("offset", LoadCommand.offset);
599 IO.mapRequired("nhints", LoadCommand.nhints);
603 IO &IO, MachO::uuid_command &LoadCommand) {
604 IO.mapRequired("uuid", LoadCommand.uuid);
608 IO &IO, MachO::version_min_command &LoadCommand) {
609 IO.mapRequired("version", LoadCommand.version);
610 IO.mapRequired("sdk", LoadCommand.sdk);
614 IO &IO, MachO::note_command &LoadCommand) {
615 IO.mapRequired("data_owner", LoadCommand.data_owner);
616 IO.mapRequired("offset", LoadCommand.offset);
617 IO.mapRequired("size", LoadCommand.size);
621 IO &IO, MachO::build_version_command &LoadCommand) {
622 IO.mapRequired("platform", LoadCommand.platform);
623 IO.mapRequired("minos", LoadCommand.minos);
624 IO.mapRequired("sdk", LoadCommand.sdk);
625 IO.mapRequired("ntools", LoadCommand.ntools);
629 IO &IO, MachO::fileset_entry_command &LoadCommand) {
630 IO.mapRequired("vmaddr", LoadCommand.vmaddr);
631 IO.mapRequired("fileoff", LoadCommand.fileoff);
632 IO.mapRequired("id", LoadCommand.entry_id.offset);
633 IO.mapOptional("reserved", LoadCommand.reserved);