]>
git.saurik.com Git - apple/dyld.git/blob - include/mach-o/dyld_gdb.h
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
27 * For Mac OS X 10.4 or later, use the interface in mach-o/dylib_images.h
29 #include <mach-o/dyld_images.h>
36 * Prior to Mac OS 10.4, this is the interface gdb used to discover the mach-o images loaded in a process
40 * gdb_dyld_version is the version of gdb interface that dyld is currently
41 * exporting. For the interface described in this header file gdb_dyld_version
42 * is 2. As the gdb/dyld interface changes this number will be incremented and
43 * comments will be added as to what are the are changes for the various
46 extern unsigned int gdb_dyld_version
;
49 * gdb_dyld_state_changed is the internal dyld routine called by dyld to notify
50 * gdb that the state of the data structures has changed. gdb is expected to
51 * put a break point on this routine and re-read the internal dyld data
52 * structures below when this break point is hit.
54 extern void gdb_dyld_state_changed(void);
57 * gdb looks directly at parts of two of dyld's internal data structures. The
58 * list of object file images and the list of library images. The parts of
59 * these structures that gdb looks at will not change unless the value of
60 * gdb_dyld_version changes. The size of these structures and the other fields
61 * that gdb does not look at may change.
63 * struct object_images {
64 * struct object_image images[NOBJECT_IMAGES];
65 * unsigned long nimages;
66 * struct object_images *next_images;
70 * struct library_images {
71 * struct library_image images[NLIBRARY_IMAGES];
72 * unsigned long nimages;
73 * struct library_images *next_images;
77 * Both the object_image structure and the library_image structure
78 * start with a structure containing the following fields:
81 * char *physical_name; physical image name (file name)
82 * unsigned long vmaddr_slide; the slide from the staticly linked address
83 * struct mach_header *mh; address of the mach header of the image
84 * unsigned long valid; TRUE if this is struct is valid
85 * char *name; image name for reporting errors
89 * In gdb_dyld_version 1 the first field was "name". In gdb_dyld_version 2 the
90 * first field was changed to "physical_name" and a new fifth field "name" was
91 * added. These two fields are set to the same values except in the case of
92 * zero-link. In zero-link the NSLinkModule() option
93 * NSLINKMODULE_OPTION_TRAILING_PHYS_NAME is used and then the physical_name is
94 * the file name of the module zero-link loaded that is part of the logical
98 /* object_images is the global object_images structure */
100 /* the number of gdb_object_image structures present per bucket */
101 extern unsigned int gdb_nobject_images
;
103 /* the size of each gdb_object_image structure */
104 extern unsigned int gdb_object_image_size
;
106 /* library_images is the global library_images structure */
108 /* the number of gdb_library_image structures present per bucket */
109 extern unsigned int gdb_nlibrary_images
;
111 /* the size of each gdb_library_image structure */
112 extern unsigned int gdb_library_image_size
;
122 #endif /* _DYLD_GDB_ */