]> git.saurik.com Git - apple/xnu.git/blob - osfmk/kdp/kdp_dyld.h
xnu-3789.60.24.tar.gz
[apple/xnu.git] / osfmk / kdp / kdp_dyld.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29 /*
30 * Data structure definitions copied from dyld so that we can read dyld's saved UUID information
31 * for each binary image not loaded from the shared cache during stackshots.
32 */
33
34 /* Re-use dyld format for kext load addresses */
35 #if __LP64__
36 typedef struct user64_dyld_uuid_info kernel_uuid_info;
37 #else
38 typedef struct user32_dyld_uuid_info kernel_uuid_info;
39 #endif
40
41 struct user32_dyld_image_info {
42 user32_addr_t imageLoadAddress; /* base address image is mapped int */
43 user32_addr_t imageFilePath; /* path dyld used to load the image */
44 user32_ulong_t imageFileModDate; /* time_t of image file */
45 };
46
47 struct user64_dyld_image_info {
48 user64_addr_t imageLoadAddress; /* base address image is mapped int */
49 user64_addr_t imageFilePath; /* path dyld used to load the image */
50 user64_ulong_t imageFileModDate; /* time_t of image file */
51 };
52
53 // FIXME: dyld is in C++, and some of the fields in dyld_all_image_infos are C++
54 // native booleans. There must be a better way...
55 typedef uint8_t dyld_bool;
56
57 struct user32_dyld_all_image_infos {
58 uint32_t version;
59 uint32_t infoArrayCount;
60 user32_addr_t infoArray;
61 user32_addr_t notification;
62 dyld_bool processDetachedFromSharedRegion;
63 dyld_bool libSystemInitialized;
64 user32_addr_t dyldImageLoadAddress;
65 user32_addr_t jitInfo;
66 user32_addr_t dyldVersion;
67 user32_addr_t errorMessage;
68 user32_addr_t terminationFlags;
69 user32_addr_t coreSymbolicationShmPage;
70 user32_addr_t systemOrderFlag;
71 user32_size_t uuidArrayCount; // dyld defines this as a uintptr_t despite it being a count
72 user32_addr_t uuidArray;
73 user32_addr_t dyldAllImageInfosAddress;
74
75 /* the following field is only in version 10 (Mac OS X 10.7, iOS 4.2) and later */
76 user32_addr_t initialImageCount;
77 /* the following field is only in version 11 (Mac OS X 10.7, iOS 4.2) and later */
78 user32_addr_t errorKind;
79 user32_addr_t errorClientOfDylibPath;
80 user32_addr_t errorTargetDylibPath;
81 user32_addr_t errorSymbol;
82 /* the following field is only in version 12 (Mac OS X 10.7, iOS 4.3) and later */
83 user32_addr_t sharedCacheSlide;
84 /* the following field is only in version 13 (Mac OS X 10.9, iOS 7.0) and later */
85 uint8_t sharedCacheUUID[16];
86 /* the following field is only in version 14 (Mac OS X 10.9, iOS 7.0) and later */
87 user32_addr_t reserved[16];
88 /* the following field is only in version 15 (Mac OS X 10.12, iOS 10.0) and later */
89 uint64_t timestamp;
90 };
91
92 struct user64_dyld_all_image_infos {
93 uint32_t version;
94 uint32_t infoArrayCount;
95 user64_addr_t infoArray;
96 user64_addr_t notification;
97 dyld_bool processDetachedFromSharedRegion;
98 dyld_bool libSystemInitialized;
99 user64_addr_t dyldImageLoadAddress;
100 user64_addr_t jitInfo;
101 user64_addr_t dyldVersion;
102 user64_addr_t errorMessage;
103 user64_addr_t terminationFlags;
104 user64_addr_t coreSymbolicationShmPage;
105 user64_addr_t systemOrderFlag;
106 user64_size_t uuidArrayCount; // dyld defines this as a uintptr_t despite it being a count
107 user64_addr_t uuidArray;
108 user64_addr_t dyldAllImageInfosAddress;
109
110 /* the following field is only in version 10 (Mac OS X 10.7, iOS 4.2) and later */
111 user64_addr_t initialImageCount;
112 /* the following field is only in version 11 (Mac OS X 10.7, iOS 4.2) and later */
113 user64_addr_t errorKind;
114 user64_addr_t errorClientOfDylibPath;
115 user64_addr_t errorTargetDylibPath;
116 user64_addr_t errorSymbol;
117 /* the following field is only in version 12 (Mac OS X 10.7, iOS 4.3) and later */
118 user64_addr_t sharedCacheSlide;
119 /* the following field is only in version 13 (Mac OS X 10.9, iOS 7.0) and later */
120 uint8_t sharedCacheUUID[16];
121 /* the following field is only in version 14 (Mac OS X 10.9, iOS 7.0) and later */
122 user64_addr_t reserved[16];
123 /* the following field is only in version 15 (Mac OS X 10.12, iOS 10.0) and later */
124 uint64_t timestamp;
125 };