4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2012 by Delphix. All rights reserved.
25 * Copyright (c) 2012 Joyent, Inc. All rights reserved.
26 */
27
28 #ifndef _MDB_MODAPI_H
29 #define _MDB_MODAPI_H
30
31 /*
32 * MDB Module API
33 *
34 * The debugger provides a set of interfaces for use in writing loadable
35 * debugger modules. Modules that call functions not listed in this header
36 * file may not be compatible with future versions of the debugger.
37 */
38
39 #include <sys/types.h>
40 #include <gelf.h>
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
190
191 extern int mdb_pwalk(const char *, mdb_walk_cb_t, void *, uintptr_t);
192 extern int mdb_walk(const char *, mdb_walk_cb_t, void *);
193
194 extern int mdb_pwalk_dcmd(const char *, const char *,
195 int, const mdb_arg_t *, uintptr_t);
196
197 extern int mdb_walk_dcmd(const char *, const char *, int, const mdb_arg_t *);
198
199 extern int mdb_layered_walk(const char *, mdb_walk_state_t *);
200
201 extern int mdb_call_dcmd(const char *, uintptr_t,
202 uint_t, int, const mdb_arg_t *);
203
204 extern int mdb_add_walker(const mdb_walker_t *);
205 extern int mdb_remove_walker(const char *);
206
207 extern ssize_t mdb_vread(void *, size_t, uintptr_t);
208 extern ssize_t mdb_vwrite(const void *, size_t, uintptr_t);
209
210 extern ssize_t mdb_fread(void *, size_t, uintptr_t);
211 extern ssize_t mdb_fwrite(const void *, size_t, uintptr_t);
212
213 extern ssize_t mdb_pread(void *, size_t, uint64_t);
214 extern ssize_t mdb_pwrite(const void *, size_t, uint64_t);
215
216 extern ssize_t mdb_readstr(char *, size_t, uintptr_t);
217 extern ssize_t mdb_writestr(const char *, uintptr_t);
218
219 extern ssize_t mdb_readsym(void *, size_t, const char *);
220 extern ssize_t mdb_writesym(const void *, size_t, const char *);
221
222 extern ssize_t mdb_readvar(void *, const char *);
223 extern ssize_t mdb_writevar(const void *, const char *);
224
225 #define MDB_SYM_NAMLEN 1024 /* Recommended max name len */
226
227 #define MDB_SYM_FUZZY 0 /* Match closest address */
228 #define MDB_SYM_EXACT 1 /* Match exact address only */
229
|
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2013 by Delphix. All rights reserved.
25 * Copyright (c) 2012 Joyent, Inc. All rights reserved.
26 */
27
28 #ifndef _MDB_MODAPI_H
29 #define _MDB_MODAPI_H
30
31 /*
32 * MDB Module API
33 *
34 * The debugger provides a set of interfaces for use in writing loadable
35 * debugger modules. Modules that call functions not listed in this header
36 * file may not be compatible with future versions of the debugger.
37 */
38
39 #include <sys/types.h>
40 #include <gelf.h>
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
190
191 extern int mdb_pwalk(const char *, mdb_walk_cb_t, void *, uintptr_t);
192 extern int mdb_walk(const char *, mdb_walk_cb_t, void *);
193
194 extern int mdb_pwalk_dcmd(const char *, const char *,
195 int, const mdb_arg_t *, uintptr_t);
196
197 extern int mdb_walk_dcmd(const char *, const char *, int, const mdb_arg_t *);
198
199 extern int mdb_layered_walk(const char *, mdb_walk_state_t *);
200
201 extern int mdb_call_dcmd(const char *, uintptr_t,
202 uint_t, int, const mdb_arg_t *);
203
204 extern int mdb_add_walker(const mdb_walker_t *);
205 extern int mdb_remove_walker(const char *);
206
207 extern ssize_t mdb_vread(void *, size_t, uintptr_t);
208 extern ssize_t mdb_vwrite(const void *, size_t, uintptr_t);
209
210 extern ssize_t mdb_aread(void *, size_t, uintptr_t, void *);
211 extern ssize_t mdb_awrite(const void *, size_t, uintptr_t, void *);
212
213 extern ssize_t mdb_fread(void *, size_t, uintptr_t);
214 extern ssize_t mdb_fwrite(const void *, size_t, uintptr_t);
215
216 extern ssize_t mdb_pread(void *, size_t, uint64_t);
217 extern ssize_t mdb_pwrite(const void *, size_t, uint64_t);
218
219 extern ssize_t mdb_readstr(char *, size_t, uintptr_t);
220 extern ssize_t mdb_writestr(const char *, uintptr_t);
221
222 extern ssize_t mdb_readsym(void *, size_t, const char *);
223 extern ssize_t mdb_writesym(const void *, size_t, const char *);
224
225 extern ssize_t mdb_readvar(void *, const char *);
226 extern ssize_t mdb_writevar(const void *, const char *);
227
228 #define MDB_SYM_NAMLEN 1024 /* Recommended max name len */
229
230 #define MDB_SYM_FUZZY 0 /* Match closest address */
231 #define MDB_SYM_EXACT 1 /* Match exact address only */
232
|