xref: /titanic_50/usr/src/cmd/mdb/common/mdb/mdb_demangle.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
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 2001-2002 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_MDB_DEMANGLE_H
28 #define	_MDB_DEMANGLE_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #ifdef	_MDB
37 
38 #include <sys/types.h>
39 #include <sys/param.h>
40 #include <mdb/mdb_modapi.h>
41 
42 typedef struct mdb_demangler {
43 	char dm_pathname[MAXPATHLEN];	/* pathname of demangling library */
44 	void *dm_handle;		/* rtld handle to demangling library */
45 	int (*dm_convert)(const char *, char *, size_t);	/* demangler */
46 	char *dm_buf;			/* demangling buffer */
47 	size_t dm_len;			/* size of dm_buf in bytes */
48 	char *dm_dem;			/* start of demangled string (in buf) */
49 	uint_t dm_flags;		/* convert flags (see below) */
50 } mdb_demangler_t;
51 
52 #define	MDB_DM_QUAL	0x1		/* show static/const/volatile */
53 #define	MDB_DM_SCOPE	0x2		/* show function scope specifiers */
54 #define	MDB_DM_FUNCARG	0x4		/* show function arguments */
55 #define	MDB_DM_MANGLED	0x8		/* show mangled name */
56 #define	MDB_DM_ALL	0xf		/* mask of all valid flags */
57 
58 extern mdb_demangler_t *mdb_dem_load(const char *);
59 extern void mdb_dem_unload(mdb_demangler_t *);
60 extern const char *mdb_dem_convert(mdb_demangler_t *, const char *);
61 
62 extern int cmd_demangle(uintptr_t, uint_t, int, const mdb_arg_t *);
63 extern int cmd_demflags(uintptr_t, uint_t, int, const mdb_arg_t *);
64 extern int cmd_demstr(uintptr_t, uint_t, int, const mdb_arg_t *);
65 
66 #endif	/* _MDB */
67 
68 #ifdef	__cplusplus
69 }
70 #endif
71 
72 #endif	/* _MDB_DEMANGLE_H */
73