Print this page
6375 Add native name demangling support
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/mdb/common/mdb/mdb_demangle.h
+++ new/usr/src/cmd/mdb/common/mdb/mdb_demangle.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, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * Copyright 2001-2002 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 + *
26 + * Copyright 2017 Jason King.
25 27 */
26 28
27 29 #ifndef _MDB_DEMANGLE_H
28 30 #define _MDB_DEMANGLE_H
29 31
30 -#pragma ident "%Z%%M% %I% %E% SMI"
31 -
32 32 #ifdef __cplusplus
33 33 extern "C" {
34 34 #endif
35 35
36 36 #ifdef _MDB
37 37
38 38 #include <sys/types.h>
39 39 #include <sys/param.h>
40 40 #include <mdb/mdb_modapi.h>
41 +#include <sysdemangle.h>
41 42
42 43 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 */
44 + sysdem_lang_t dm_lang; /* language to demangle */
46 45 char *dm_buf; /* demangling buffer */
47 46 size_t dm_len; /* size of dm_buf in bytes */
48 47 char *dm_dem; /* start of demangled string (in buf) */
49 48 uint_t dm_flags; /* convert flags (see below) */
50 49 } mdb_demangler_t;
51 50
52 51 #define MDB_DM_QUAL 0x1 /* show static/const/volatile */
53 52 #define MDB_DM_SCOPE 0x2 /* show function scope specifiers */
54 53 #define MDB_DM_FUNCARG 0x4 /* show function arguments */
55 54 #define MDB_DM_MANGLED 0x8 /* show mangled name */
56 55 #define MDB_DM_ALL 0xf /* mask of all valid flags */
57 56
58 -extern mdb_demangler_t *mdb_dem_load(const char *);
57 +extern mdb_demangler_t *mdb_dem_load(void);
59 58 extern void mdb_dem_unload(mdb_demangler_t *);
60 59 extern const char *mdb_dem_convert(mdb_demangler_t *, const char *);
61 60
62 61 extern int cmd_demangle(uintptr_t, uint_t, int, const mdb_arg_t *);
63 62 extern int cmd_demflags(uintptr_t, uint_t, int, const mdb_arg_t *);
64 63 extern int cmd_demstr(uintptr_t, uint_t, int, const mdb_arg_t *);
65 64
66 65 #endif /* _MDB */
67 66
68 67 #ifdef __cplusplus
69 68 }
70 69 #endif
71 70
72 71 #endif /* _MDB_DEMANGLE_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX