Print this page
11584 ::xcall would be useful
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/mdb/common/mdb/mdb_ctf.h
+++ new/usr/src/cmd/mdb/common/mdb/mdb_ctf.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25 /*
26 26 * Copyright (c) 2013, 2015 by Delphix. All rights reserved.
27 - * Copyright (c) 2015, Joyent, Inc.
27 + * Copyright 2018 Joyent, Inc.
28 28 */
29 29
30 30 #ifndef _MDB_CTF_H
31 31 #define _MDB_CTF_H
32 32
33 33 #include <mdb/mdb_target.h>
34 34 #include <libctf.h>
35 35
36 36 #ifdef _MDB
37 37 #include <sys/machelf.h>
38 38 #endif
39 39
40 40 /*
41 41 * The following directive tells the mapfile generator that prototypes and
42 42 * declarations ending with an "Internal" comment should be excluded from the
43 43 * mapfile.
44 44 *
45 45 * MAPFILE: exclude "Internal"
46 46 */
47 47
48 48 #ifdef __cplusplus
49 49 extern "C" {
50 50 #endif
51 51
52 52 typedef struct mdb_ctf_id {
53 53 void *_opaque[2];
54 54 } mdb_ctf_id_t;
55 55
56 56 typedef struct mdb_ctf_funcinfo {
57 57 mdb_ctf_id_t mtf_return; /* function return type */
58 58 uint_t mtf_argc; /* number of arguments */
59 59 uint_t mtf_flags; /* function attributes (see libctf.h) */
60 60 uint_t mtf_symidx; /* for ctf_func_args */
61 61 } mdb_ctf_funcinfo_t;
62 62
63 63 typedef struct mdb_ctf_arinfo {
64 64 mdb_ctf_id_t mta_contents; /* type of array conents */
65 65 mdb_ctf_id_t mta_index; /* type of array index */
66 66 uint_t mta_nelems; /* number of elements */
67 67 } mdb_ctf_arinfo_t;
68 68
69 69 typedef int mdb_ctf_visit_f(const char *, mdb_ctf_id_t, mdb_ctf_id_t, ulong_t,
70 70 int, void *);
71 71 typedef int mdb_ctf_member_f(const char *, mdb_ctf_id_t, ulong_t, void *);
72 72 typedef int mdb_ctf_enum_f(const char *, int, void *);
73 73 typedef int mdb_ctf_type_f(mdb_ctf_id_t, void *);
74 74
75 75 extern int mdb_ctf_enabled_by_object(const char *);
76 76
77 77 extern int mdb_ctf_lookup_by_name(const char *, mdb_ctf_id_t *);
78 78 extern int mdb_ctf_lookup_by_addr(uintptr_t, mdb_ctf_id_t *);
79 79
80 80 extern int mdb_ctf_module_lookup(const char *, mdb_ctf_id_t *);
81 81
82 82 extern int mdb_ctf_func_info(const GElf_Sym *, const mdb_syminfo_t *,
83 83 mdb_ctf_funcinfo_t *);
84 84 extern int mdb_ctf_func_args(const mdb_ctf_funcinfo_t *, uint_t,
85 85 mdb_ctf_id_t *);
86 86
87 87 extern void mdb_ctf_type_invalidate(mdb_ctf_id_t *);
88 88 extern int mdb_ctf_type_valid(mdb_ctf_id_t);
89 89 extern int mdb_ctf_type_cmp(mdb_ctf_id_t, mdb_ctf_id_t);
90 90
91 91 extern int mdb_ctf_type_resolve(mdb_ctf_id_t, mdb_ctf_id_t *);
92 92 extern char *mdb_ctf_type_name(mdb_ctf_id_t, char *, size_t);
93 93 extern ssize_t mdb_ctf_type_size(mdb_ctf_id_t);
94 94 extern int mdb_ctf_type_kind(mdb_ctf_id_t);
95 95 extern int mdb_ctf_type_reference(const mdb_ctf_id_t, mdb_ctf_id_t *);
96 96 extern int mdb_ctf_type_encoding(mdb_ctf_id_t, ctf_encoding_t *);
97 97 extern int mdb_ctf_type_visit(mdb_ctf_id_t, mdb_ctf_visit_f *, void *);
98 98
99 99 extern int mdb_ctf_array_info(mdb_ctf_id_t, mdb_ctf_arinfo_t *);
100 100 extern const char *mdb_ctf_enum_name(mdb_ctf_id_t, int);
101 101
102 102 extern int mdb_ctf_member_iter(mdb_ctf_id_t, mdb_ctf_member_f *, void *);
103 103 extern int mdb_ctf_enum_iter(mdb_ctf_id_t, mdb_ctf_enum_f *, void *);
104 104 extern int mdb_ctf_type_iter(const char *, mdb_ctf_type_f *, void *);
105 105 extern int mdb_ctf_type_delete(const mdb_ctf_id_t *);
106 106
107 107 /*
108 108 * Special values for mdb_ctf_type_iter.
109 109 */
110 110 #define MDB_CTF_SYNTHETIC_ITER (const char *)(-1L)
111 111
112 112 #define SYNTHETIC_ILP32 1
113 113 #define SYNTHETIC_LP64 2
114 114 extern int mdb_ctf_synthetics_create_base(int);
115 115 extern int mdb_ctf_synthetics_reset(void);
116 116
117 117 /*
118 118 * Synthetic creation routines
119 119 */
120 120 extern int mdb_ctf_add_typedef(const char *, const mdb_ctf_id_t *,
121 121 mdb_ctf_id_t *);
122 122 extern int mdb_ctf_add_struct(const char *, mdb_ctf_id_t *);
123 123 extern int mdb_ctf_add_union(const char *, mdb_ctf_id_t *);
124 124 extern int mdb_ctf_add_member(const mdb_ctf_id_t *, const char *,
125 125 const mdb_ctf_id_t *, mdb_ctf_id_t *);
126 126 extern int mdb_ctf_add_array(const mdb_ctf_arinfo_t *, mdb_ctf_id_t *);
127 127 extern int mdb_ctf_add_pointer(const mdb_ctf_id_t *, mdb_ctf_id_t *);
128 128
129 129 /* utility stuff */
130 130 extern ctf_id_t mdb_ctf_type_id(mdb_ctf_id_t);
131 131 extern ctf_file_t *mdb_ctf_type_file(mdb_ctf_id_t);
132 132
133 133
134 134 extern int mdb_ctf_member_info(mdb_ctf_id_t, const char *,
↓ open down ↓ |
97 lines elided |
↑ open up ↑ |
135 135 ulong_t *, mdb_ctf_id_t *);
136 136 extern int mdb_ctf_offsetof(mdb_ctf_id_t, const char *, ulong_t *);
137 137 extern int mdb_ctf_num_members(mdb_ctf_id_t);
138 138 extern int mdb_ctf_offsetof_by_name(const char *, const char *);
139 139 extern ssize_t mdb_ctf_sizeof_by_name(const char *);
140 140
141 141 extern ssize_t mdb_ctf_offset_to_name(mdb_ctf_id_t, ulong_t, char *, size_t,
142 142 int, mdb_ctf_id_t *, ulong_t *);
143 143
144 144 #define MDB_CTF_VREAD_QUIET 0x100
145 +#define MDB_CTF_VREAD_IGNORE_ABSENT 0x200
145 146
146 147 extern int mdb_ctf_vread(void *, const char *, const char *,
147 148 uintptr_t, uint_t);
148 149 extern int mdb_ctf_readsym(void *, const char *, const char *, uint_t);
149 150
150 151 #ifdef _MDB
151 152
152 153 extern ctf_file_t *mdb_ctf_open(const char *, int *); /* Internal */
153 154 extern ctf_file_t *mdb_ctf_bufopen(const void *, size_t, /* Internal */
154 155 const void *, Shdr *, const void *, Shdr *, int *);
155 156 extern int mdb_ctf_write(const char *, ctf_file_t *fp); /* Internal */
156 157 extern void mdb_ctf_close(ctf_file_t *fp); /* Internal */
157 158 extern int mdb_ctf_synthetics_init(void); /* Internal */
158 159 extern void mdb_ctf_synthetics_fini(void); /* Internal */
159 160 extern int mdb_ctf_synthetics_from_file(const char *); /* Internal */
160 161 extern int mdb_ctf_synthetics_to_file(const char *); /* Internal */
161 162
162 163 #endif
163 164
164 165 #ifdef __cplusplus
165 166 }
166 167 #endif
167 168
168 169 #endif /* _MDB_CTF_H */
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX