~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to binutils/include/demangle.h

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Defs for interface to demanglers.
 
2
   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002
 
3
   Free Software Foundation, Inc.
 
4
   
 
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)
 
8
   any later version.
 
9
 
 
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.
 
14
 
 
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.  */
 
19
 
 
20
 
 
21
#if !defined (DEMANGLE_H)
 
22
#define DEMANGLE_H
 
23
 
 
24
#include "ansidecl.h"
 
25
 
 
26
/* Options passed to cplus_demangle (in 2nd parameter). */
 
27
 
 
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.  */
 
34
 
 
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)
 
46
 
 
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)
 
49
 
 
50
/* Enumeration of possible demangling styles.
 
51
 
 
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?) */
 
57
 
 
58
extern enum demangling_styles
 
59
{
 
60
  first_demangling = 0,
 
61
  no_demangling = 0,
 
62
  auto_demangling,
 
63
  gnu_demangling,
 
64
  lucid_demangling,
 
65
  arm_demangling,
 
66
  hp_demangling,
 
67
  edg_demangling,
 
68
  gnu_v3_demangling,
 
69
  java_demangling,
 
70
  gnat_demangling,
 
71
  compaq_demangling,
 
72
  unknown_demangling
 
73
} current_demangling_style;
 
74
 
 
75
/* Define string names for the various demangling styles. */
 
76
 
 
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"
 
88
 
 
89
/* Some macros to test what demangling style is active. */
 
90
 
 
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)
 
102
 
 
103
typedef char * (*demangle_function) PARAMS ((const char *,
 
104
                                             enum demangling_styles,
 
105
                                             int));
 
106
 
 
107
/* Provide information about the available demangle styles. This code is
 
108
   pulled from gdb into libiberty because it is useful to binutils also.  */
 
109
 
 
110
extern struct demangler_engine
 
111
{
 
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[];
 
118
 
 
119
extern char *
 
120
cplus_demangle PARAMS ((const char *mangled, int options));
 
121
 
 
122
extern char *
 
123
cplus_demangle_with_style PARAMS ((const char *mangled,
 
124
                                   enum demangling_styles style,
 
125
                                   int options));
 
126
 
 
127
extern int
 
128
cplus_demangle_opname PARAMS ((const char *opname, char *result, int options));
 
129
 
 
130
extern const char *
 
131
cplus_mangle_opname PARAMS ((const char *opname, int options));
 
132
 
 
133
/* Note: This sets global state.  FIXME if you care about multi-threading. */
 
134
 
 
135
extern void
 
136
set_cplus_marker_for_demangling PARAMS ((int ch));
 
137
 
 
138
extern enum demangling_styles 
 
139
cplus_demangle_set_style PARAMS ((enum demangling_styles style));
 
140
 
 
141
extern enum demangling_styles 
 
142
cplus_demangle_name_to_style PARAMS ((const char *name));
 
143
 
 
144
/* V3 ABI demangling entry points, defined in cp-demangle.c.  */
 
145
extern char*
 
146
cplus_demangle_v3 PARAMS ((const char* mangled, int options));
 
147
 
 
148
extern char*
 
149
java_demangle_v3 PARAMS ((const char* mangled));
 
150
 
 
151
 
 
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
 
156
};
 
157
 
 
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
 
161
   it is.  */
 
162
extern enum gnu_v3_ctor_kinds
 
163
        is_gnu_v3_mangled_ctor PARAMS ((const char *name));
 
164
 
 
165
 
 
166
enum gnu_v3_dtor_kinds {
 
167
  gnu_v3_deleting_dtor = 1,
 
168
  gnu_v3_complete_object_dtor,
 
169
  gnu_v3_base_object_dtor
 
170
};
 
171
 
 
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
 
175
   it is.  */
 
176
extern enum gnu_v3_dtor_kinds
 
177
        is_gnu_v3_mangled_dtor PARAMS ((const char *name));
 
178
 
 
179
extern char *
 
180
demangle_symbol PARAMS ((const char *mangled));
 
181
 
 
182
extern char *
 
183
demangle_symbol_with_style PARAMS ((const char *mangled,
 
184
                                    enum demangling_styles style));
 
185
 
 
186
extern char *
 
187
demangle_symbol_with_options PARAMS ((const char *mangled,
 
188
                                      int options));
 
189
 
 
190
extern char *
 
191
demangle_symbol_with_style_options PARAMS ((const char *mangled,
 
192
                                            enum demangling_styles style,
 
193
                                            int options));
 
194
 
 
195
extern int
 
196
init_demangler PARAMS ((const char *style, const char *options,
 
197
                        const char *demangler));
 
198
 
 
199
extern const char *
 
200
get_demangler_list PARAMS ((void));
 
201
 
 
202
#endif  /* DEMANGLE_H */