1
/* Defs for interface to demanglers.
2
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002
3
Free Software Foundation, Inc.
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2, or (at your option)
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software
17
Foundation, Inc., 59 Temple Place - Suite 330,
18
Boston, MA 02111-1307, USA. */
21
#if !defined (DEMANGLE_H)
26
/* Options passed to cplus_demangle (in 2nd parameter). */
28
#define DMGL_NO_OPTS 0 /* For readability... */
29
#define DMGL_PARAMS (1 << 0) /* Include function args */
30
#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
31
#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */
32
#define DMGL_VERBOSE (1 << 3) /* Include implementation details. */
33
#define DMGL_TYPES (1 << 4) /* Also try to demangle type encodings. */
35
#define DMGL_AUTO (1 << 8)
36
#define DMGL_GNU (1 << 9)
37
#define DMGL_LUCID (1 << 10)
38
#define DMGL_ARM (1 << 11)
39
#define DMGL_HP (1 << 12) /* For the HP aCC compiler;
40
same as ARM except for
41
template arguments, etc. */
42
#define DMGL_EDG (1 << 13)
43
#define DMGL_GNU_V3 (1 << 14)
44
#define DMGL_GNAT (1 << 15)
45
#define DMGL_COMPAQ (1 << 16)
47
/* If none of these are set, use 'current_demangling_style' as the default. */
48
#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG|DMGL_GNU_V3|DMGL_JAVA|DMGL_GNAT|DMGL_COMPAQ)
50
/* Enumeration of possible demangling styles.
52
Lucid and ARM styles are still kept logically distinct, even though
53
they now both behave identically. The resulting style is actual the
54
union of both. I.E. either style recognizes both "__pt__" and "__rf__"
55
for operator "->", even though the first is lucid style and the second
56
is ARM style. (FIXME?) */
58
extern enum demangling_styles
73
} current_demangling_style;
75
/* Define string names for the various demangling styles. */
77
#define NO_DEMANGLING_STYLE_STRING "none"
78
#define AUTO_DEMANGLING_STYLE_STRING "auto"
79
#define GNU_DEMANGLING_STYLE_STRING "gnu"
80
#define LUCID_DEMANGLING_STYLE_STRING "lucid"
81
#define ARM_DEMANGLING_STYLE_STRING "arm"
82
#define HP_DEMANGLING_STYLE_STRING "hp"
83
#define EDG_DEMANGLING_STYLE_STRING "edg"
84
#define GNU_V3_DEMANGLING_STYLE_STRING "gnu-v3"
85
#define JAVA_DEMANGLING_STYLE_STRING "java"
86
#define GNAT_DEMANGLING_STYLE_STRING "gnat"
87
#define COMPAQ_DEMANGLING_STYLE_STRING "compaq"
89
/* Some macros to test what demangling style is active. */
91
#define CURRENT_DEMANGLING_STYLE current_demangling_style
92
#define AUTO_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_AUTO)
93
#define GNU_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU)
94
#define LUCID_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_LUCID)
95
#define ARM_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_ARM)
96
#define HP_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_HP)
97
#define EDG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_EDG)
98
#define GNU_V3_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU_V3)
99
#define JAVA_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_JAVA)
100
#define GNAT_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNAT)
101
#define COMPAQ_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_COMPAQ)
103
typedef char * (*demangle_function) PARAMS ((const char *,
104
enum demangling_styles,
107
/* Provide information about the available demangle styles. This code is
108
pulled from gdb into libiberty because it is useful to binutils also. */
110
extern struct demangler_engine
112
const char *const demangling_style_name;
113
const int demangling_style;
114
int demangling_options;
115
const char *const demangling_style_doc;
116
demangle_function df;
117
} libiberty_demanglers[];
120
cplus_demangle PARAMS ((const char *mangled, int options));
123
cplus_demangle_with_style PARAMS ((const char *mangled,
124
enum demangling_styles style,
128
cplus_demangle_opname PARAMS ((const char *opname, char *result, int options));
131
cplus_mangle_opname PARAMS ((const char *opname, int options));
133
/* Note: This sets global state. FIXME if you care about multi-threading. */
136
set_cplus_marker_for_demangling PARAMS ((int ch));
138
extern enum demangling_styles
139
cplus_demangle_set_style PARAMS ((enum demangling_styles style));
141
extern enum demangling_styles
142
cplus_demangle_name_to_style PARAMS ((const char *name));
144
/* V3 ABI demangling entry points, defined in cp-demangle.c. */
146
cplus_demangle_v3 PARAMS ((const char* mangled, int options));
149
java_demangle_v3 PARAMS ((const char* mangled));
152
enum gnu_v3_ctor_kinds {
153
gnu_v3_complete_object_ctor = 1,
154
gnu_v3_base_object_ctor,
155
gnu_v3_complete_object_allocating_ctor
158
/* Return non-zero iff NAME is the mangled form of a constructor name
159
in the G++ V3 ABI demangling style. Specifically, return an `enum
160
gnu_v3_ctor_kinds' value indicating what kind of constructor
162
extern enum gnu_v3_ctor_kinds
163
is_gnu_v3_mangled_ctor PARAMS ((const char *name));
166
enum gnu_v3_dtor_kinds {
167
gnu_v3_deleting_dtor = 1,
168
gnu_v3_complete_object_dtor,
169
gnu_v3_base_object_dtor
172
/* Return non-zero iff NAME is the mangled form of a destructor name
173
in the G++ V3 ABI demangling style. Specifically, return an `enum
174
gnu_v3_dtor_kinds' value, indicating what kind of destructor
176
extern enum gnu_v3_dtor_kinds
177
is_gnu_v3_mangled_dtor PARAMS ((const char *name));
180
demangle_symbol PARAMS ((const char *mangled));
183
demangle_symbol_with_style PARAMS ((const char *mangled,
184
enum demangling_styles style));
187
demangle_symbol_with_options PARAMS ((const char *mangled,
191
demangle_symbol_with_style_options PARAMS ((const char *mangled,
192
enum demangling_styles style,
196
init_demangler PARAMS ((const char *style, const char *options,
197
const char *demangler));
200
get_demangler_list PARAMS ((void));
202
#endif /* DEMANGLE_H */