4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
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.
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]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <mdb/mdb_target.h>
33 #include <mdb/mdb_modapi.h>
42 * Forward declaration of the disassembler structure: the internals are defined
43 * in mdb_disasm_impl.h and is opaque with respect to callers of this interface.
47 typedef struct mdb_disasm mdb_disasm_t
;
50 * Disassemblers are created by calling mdb_dis_create() with a disassembler
51 * constructor function. A constructed disassembler can be selected (made
52 * the current disassembler) by invoking mdb_dis_select().
55 typedef int mdb_dis_ctor_f(mdb_disasm_t
*);
57 extern int mdb_dis_select(const char *);
58 extern mdb_disasm_t
*mdb_dis_create(mdb_dis_ctor_f
*);
59 extern void mdb_dis_destroy(mdb_disasm_t
*);
62 * Disassembler operations - instruction-to-string and backstep.
64 extern mdb_tgt_addr_t
mdb_dis_ins2str(mdb_disasm_t
*, mdb_tgt_t
*,
65 mdb_tgt_as_t
, char *, size_t, mdb_tgt_addr_t
);
66 extern mdb_tgt_addr_t
mdb_dis_previns(mdb_disasm_t
*, mdb_tgt_t
*,
67 mdb_tgt_as_t
, mdb_tgt_addr_t
, uint_t
);
68 extern mdb_tgt_addr_t
mdb_dis_nextins(mdb_disasm_t
*, mdb_tgt_t
*,
69 mdb_tgt_as_t
, mdb_tgt_addr_t
);
72 * Builtin dcmds for selecting and listing disassemblers:
74 extern int cmd_dismode(uintptr_t, uint_t
, int, const mdb_arg_t
*);
75 extern int cmd_disasms(uintptr_t, uint_t
, int, const mdb_arg_t
*);
83 #endif /* _MDB_DISASM_H */