1 /*
2  * CDDL HEADER START
3  *
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  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_MDB_DISASM_IMPL_H
27 #define	_MDB_DISASM_IMPL_H
28 
29 /*
30  * Disassembler Implementation
31  *
32  * Each disassembler provides a string name (for selection with $V or -V),
33  * a brief description, and the set of operations defined in mdb_dis_ops_t.
34  * Currently the interface defined here is very primitive, but we hope to
35  * greatly enhance it in the future if we have a two-pass disassembler.
36  */
37 
38 #include <mdb/mdb_disasm.h>
39 #include <mdb/mdb_module.h>
40 
41 #ifdef	__cplusplus
42 extern "C" {
43 #endif
44 
45 typedef struct mdb_dis_ops {
46 	void (*dis_destroy)(mdb_disasm_t *);
47 	mdb_tgt_addr_t (*dis_ins2str)(mdb_disasm_t *, mdb_tgt_t *,
48 	    mdb_tgt_as_t, char *, size_t, mdb_tgt_addr_t);
49 	mdb_tgt_addr_t (*dis_previns)(mdb_disasm_t *, mdb_tgt_t *,
50 	    mdb_tgt_as_t, mdb_tgt_addr_t, uint_t);
51 	mdb_tgt_addr_t (*dis_nextins)(mdb_disasm_t *, mdb_tgt_t *,
52 	    mdb_tgt_as_t, mdb_tgt_addr_t);
53 } mdb_dis_ops_t;
54 
55 struct mdb_disasm {
56 	const char *dis_name;		/* Disassembler name */
57 	const char *dis_desc;		/* Brief description */
58 	mdb_module_t *dis_module;	/* Backpointer to containing module */
59 	const mdb_dis_ops_t *dis_ops;	/* Pointer to ops vector */
60 	void *dis_data;			/* Private storage */
61 };
62 
63 #ifdef	__cplusplus
64 }
65 #endif
66 
67 #endif	/* _MDB_DISASM_IMPL_H */
68