7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26 /*
27 * Copyright 2018 Joyent, Inc.
28 */
29
30 /*
31 * This header file defines the interfaces available from the CTF debugger
32 * library, libctf, and an equivalent kernel module. This API can be used by
33 * a debugger to operate on data in the Compact ANSI-C Type Format (CTF).
34 * This is NOT a public interface, although it may eventually become one in
35 * the fullness of time after we gain more experience with the interfaces.
36 *
37 * In the meantime, be aware that any program linked with this API in this
38 * release of Solaris is almost guaranteed to break in the next release.
39 *
40 * In short, do not user this header file or the CTF routines for any purpose.
41 */
42
43 #ifndef _CTF_API_H
44 #define _CTF_API_H
45
46 #include <sys/types.h>
47 #include <sys/param.h>
99 ECTF_NOTYPEDAT, /* no type info available for object */
100 ECTF_NOLABEL, /* no label found corresponding to name */
101 ECTF_NOLABELDATA, /* file does not contain any labels */
102 ECTF_NOTSUP, /* feature not supported */
103 ECTF_NOENUMNAM, /* enum element name not found */
104 ECTF_NOMEMBNAM, /* member name not found */
105 ECTF_RDONLY, /* CTF container is read-only */
106 ECTF_DTFULL, /* CTF type is full (no more members allowed) */
107 ECTF_FULL, /* CTF container is full */
108 ECTF_DUPMEMBER, /* duplicate member name definition */
109 ECTF_CONFLICT, /* conflicting type definition present */
110 ECTF_REFERENCED, /* type has outstanding references */
111 ECTF_NOTDYN, /* type is not a dynamic type */
112 ECTF_ELF, /* elf library failure */
113 ECTF_MCHILD, /* cannot merge child container */
114 ECTF_LABELEXISTS, /* label already exists */
115 ECTF_LCONFLICT, /* merged labels conflict */
116 ECTF_ZLIB, /* zlib library failure */
117 ECTF_CONVBKERR, /* CTF conversion backend error */
118 ECTF_CONVNOCSRC, /* No C source to convert from */
119 ECTF_NOCONVBKEND /* No applicable conversion backend */
120 };
121
122 /*
123 * If the debugger needs to provide the CTF library with a set of raw buffers
124 * for use as the CTF data, symbol table, and string table, it can do so by
125 * filling in ctf_sect_t structures and passing them to ctf_bufopen():
126 */
127 typedef struct ctf_sect {
128 const char *cts_name; /* section name (if any) */
129 ulong_t cts_type; /* section type (ELF SHT_... value) */
130 ulong_t cts_flags; /* section flags (ELF SHF_... value) */
131 const void *cts_data; /* pointer to section data */
132 size_t cts_size; /* size of data in bytes */
133 size_t cts_entsize; /* size of each section entry (symtab only) */
134 off64_t cts_offset; /* file offset of this section (if any) */
135 } ctf_sect_t;
136
137 /*
138 * Encoding information for integers, floating-point values, and certain other
139 * intrinsics can be obtained by calling ctf_type_encoding(), below. The flags
|
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26 /*
27 * Copyright 2019 Joyent, Inc.
28 */
29
30 /*
31 * This header file defines the interfaces available from the CTF debugger
32 * library, libctf, and an equivalent kernel module. This API can be used by
33 * a debugger to operate on data in the Compact ANSI-C Type Format (CTF).
34 * This is NOT a public interface, although it may eventually become one in
35 * the fullness of time after we gain more experience with the interfaces.
36 *
37 * In the meantime, be aware that any program linked with this API in this
38 * release of Solaris is almost guaranteed to break in the next release.
39 *
40 * In short, do not user this header file or the CTF routines for any purpose.
41 */
42
43 #ifndef _CTF_API_H
44 #define _CTF_API_H
45
46 #include <sys/types.h>
47 #include <sys/param.h>
99 ECTF_NOTYPEDAT, /* no type info available for object */
100 ECTF_NOLABEL, /* no label found corresponding to name */
101 ECTF_NOLABELDATA, /* file does not contain any labels */
102 ECTF_NOTSUP, /* feature not supported */
103 ECTF_NOENUMNAM, /* enum element name not found */
104 ECTF_NOMEMBNAM, /* member name not found */
105 ECTF_RDONLY, /* CTF container is read-only */
106 ECTF_DTFULL, /* CTF type is full (no more members allowed) */
107 ECTF_FULL, /* CTF container is full */
108 ECTF_DUPMEMBER, /* duplicate member name definition */
109 ECTF_CONFLICT, /* conflicting type definition present */
110 ECTF_REFERENCED, /* type has outstanding references */
111 ECTF_NOTDYN, /* type is not a dynamic type */
112 ECTF_ELF, /* elf library failure */
113 ECTF_MCHILD, /* cannot merge child container */
114 ECTF_LABELEXISTS, /* label already exists */
115 ECTF_LCONFLICT, /* merged labels conflict */
116 ECTF_ZLIB, /* zlib library failure */
117 ECTF_CONVBKERR, /* CTF conversion backend error */
118 ECTF_CONVNOCSRC, /* No C source to convert from */
119 ECTF_CONVNODEBUG /* No debug info to convert into CTF */
120 };
121
122 /*
123 * If the debugger needs to provide the CTF library with a set of raw buffers
124 * for use as the CTF data, symbol table, and string table, it can do so by
125 * filling in ctf_sect_t structures and passing them to ctf_bufopen():
126 */
127 typedef struct ctf_sect {
128 const char *cts_name; /* section name (if any) */
129 ulong_t cts_type; /* section type (ELF SHT_... value) */
130 ulong_t cts_flags; /* section flags (ELF SHF_... value) */
131 const void *cts_data; /* pointer to section data */
132 size_t cts_size; /* size of data in bytes */
133 size_t cts_entsize; /* size of each section entry (symtab only) */
134 off64_t cts_offset; /* file offset of this section (if any) */
135 } ctf_sect_t;
136
137 /*
138 * Encoding information for integers, floating-point values, and certain other
139 * intrinsics can be obtained by calling ctf_type_encoding(), below. The flags
|