| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Crashpad Authors. All rights reserved. | |
| 2 // | |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 // you may not use this file except in compliance with the License. | |
| 5 // You may obtain a copy of the License at | |
| 6 // | |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 // | |
| 9 // Unless required by applicable law or agreed to in writing, software | |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 // See the License for the specific language governing permissions and | |
| 13 // limitations under the License. | |
| 14 | |
| 15 // This file corresponds to the system’s <mach-o/loader.h>. | |
| 16 // | |
| 17 // This file is intended to be included multiple times in the same translation | |
| 18 // unit, so #include guards are intentionally absent. | |
| 19 // | |
| 20 // This file is included by util/mac/process_types.h and | |
| 21 // util/mac/process_types.cc to produce process type struct definitions and | |
| 22 // accessors. | |
| 23 | |
| 24 PROCESS_TYPE_STRUCT_BEGIN(mach_header) // 64-bit: mach_header_64 | |
| 25 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, magic) | |
| 26 | |
| 27 // cputype is really cpu_type_t, a typedef for integer_t, itself a typedef for | |
| 28 // int. It is currently reasonable to assume that int is int32_t. | |
| 29 PROCESS_TYPE_STRUCT_MEMBER(int32_t, cputype) | |
| 30 | |
| 31 // cpusubtype is really cpu_subtype_t, a typedef for integer_t, itself a | |
| 32 // typedef for int. It is currently reasonable to assume that int is int32_t. | |
| 33 PROCESS_TYPE_STRUCT_MEMBER(int32_t, cpusubtype) | |
| 34 | |
| 35 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, filetype) | |
| 36 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, ncmds) | |
| 37 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, sizeofcmds) | |
| 38 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, flags) | |
| 39 PROCESS_TYPE_STRUCT_MEMBER(Reserved64Only, reserved) | |
| 40 PROCESS_TYPE_STRUCT_END(mach_header) | |
| 41 | |
| 42 PROCESS_TYPE_STRUCT_BEGIN(load_command) | |
| 43 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, cmd) | |
| 44 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, cmdsize) | |
| 45 PROCESS_TYPE_STRUCT_END(load_command) | |
| 46 | |
| 47 PROCESS_TYPE_STRUCT_BEGIN(segment_command) // 64-bit: segment_command_64 | |
| 48 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, cmd) | |
| 49 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, cmdsize) | |
| 50 | |
| 51 // This string is not necessarily NUL-terminated. | |
| 52 PROCESS_TYPE_STRUCT_MEMBER(char, segname, [16]) | |
| 53 | |
| 54 PROCESS_TYPE_STRUCT_MEMBER(ULong, vmaddr) | |
| 55 PROCESS_TYPE_STRUCT_MEMBER(ULong, vmsize) | |
| 56 PROCESS_TYPE_STRUCT_MEMBER(ULong, fileoff) | |
| 57 PROCESS_TYPE_STRUCT_MEMBER(ULong, filesize) | |
| 58 PROCESS_TYPE_STRUCT_MEMBER(vm_prot_t, maxprot) | |
| 59 PROCESS_TYPE_STRUCT_MEMBER(vm_prot_t, initprot) | |
| 60 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, nsects) | |
| 61 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, flags) | |
| 62 PROCESS_TYPE_STRUCT_END(segment_command) | |
| 63 | |
| 64 PROCESS_TYPE_STRUCT_BEGIN(dylib_command) | |
| 65 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, cmd) | |
| 66 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, cmdsize) | |
| 67 | |
| 68 // The following come from the dylib struct member of dylib_command. | |
| 69 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, dylib_name) // lc_str | |
| 70 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, dylib_timestamp) | |
| 71 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, dylib_current_version) | |
| 72 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, dylib_compatibility_version) | |
| 73 PROCESS_TYPE_STRUCT_END(dylib_command) | |
| 74 | |
| 75 PROCESS_TYPE_STRUCT_BEGIN(dylinker_command) | |
| 76 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, cmd) | |
| 77 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, cmdsize) | |
| 78 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, name) // lc_str | |
| 79 PROCESS_TYPE_STRUCT_END(dylinker_command) | |
| 80 | |
| 81 PROCESS_TYPE_STRUCT_BEGIN(symtab_command) | |
| 82 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, cmd) | |
| 83 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, cmdsize) | |
| 84 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, symoff) | |
| 85 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, nsyms) | |
| 86 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, stroff) | |
| 87 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, strsize) | |
| 88 PROCESS_TYPE_STRUCT_END(symtab_command) | |
| 89 | |
| 90 PROCESS_TYPE_STRUCT_BEGIN(dysymtab_command) | |
| 91 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, cmd) | |
| 92 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, cmdsize) | |
| 93 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, ilocalsym) | |
| 94 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, nlocalsym) | |
| 95 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, iextdefsym) | |
| 96 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, nextdefsym) | |
| 97 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, iundefsym) | |
| 98 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, nundefsym) | |
| 99 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, tocoff) | |
| 100 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, ntoc) | |
| 101 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, modtaboff) | |
| 102 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, nmodtab) | |
| 103 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, extrefsymoff) | |
| 104 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, nextrefsyms) | |
| 105 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, indirectsymoff) | |
| 106 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, nindirectsyms) | |
| 107 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, extreloff) | |
| 108 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, nextrel) | |
| 109 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, locreloff) | |
| 110 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, nlocrel) | |
| 111 PROCESS_TYPE_STRUCT_END(dysymtab_command) | |
| 112 | |
| 113 PROCESS_TYPE_STRUCT_BEGIN(uuid_command) | |
| 114 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, cmd) | |
| 115 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, cmdsize) | |
| 116 PROCESS_TYPE_STRUCT_MEMBER(uint8_t, uuid, [16]) | |
| 117 PROCESS_TYPE_STRUCT_END(uuid_command) | |
| 118 | |
| 119 PROCESS_TYPE_STRUCT_BEGIN(source_version_command) | |
| 120 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, cmd) | |
| 121 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, cmdsize) | |
| 122 PROCESS_TYPE_STRUCT_MEMBER(uint64_t, version) | |
| 123 PROCESS_TYPE_STRUCT_END(source_version_command) | |
| 124 | |
| 125 PROCESS_TYPE_STRUCT_BEGIN(section) // 64-bit: section_64 | |
| 126 // These strings are not necessarily NUL-terminated. | |
| 127 PROCESS_TYPE_STRUCT_MEMBER(char, sectname, [16]) | |
| 128 PROCESS_TYPE_STRUCT_MEMBER(char, segname, [16]) | |
| 129 | |
| 130 PROCESS_TYPE_STRUCT_MEMBER(ULong, addr) | |
| 131 PROCESS_TYPE_STRUCT_MEMBER(ULong, size) | |
| 132 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, offset) | |
| 133 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, align) | |
| 134 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, reloff) | |
| 135 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, nreloc) | |
| 136 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, flags) | |
| 137 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, reserved1) | |
| 138 PROCESS_TYPE_STRUCT_MEMBER(uint32_t, reserved2) | |
| 139 PROCESS_TYPE_STRUCT_MEMBER(Reserved64Only, reserved3) | |
| 140 PROCESS_TYPE_STRUCT_END(section) | |
| OLD | NEW |