1999-05-03 09:29:11 +02:00
|
|
|
/* Defs for interface to demanglers.
|
2002-06-25 03:03:52 +02:00
|
|
|
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002
|
2001-03-14 03:27:44 +01:00
|
|
|
Free Software Foundation, Inc.
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined (DEMANGLE_H)
|
|
|
|
#define DEMANGLE_H
|
|
|
|
|
2002-06-25 03:03:52 +02:00
|
|
|
#include "ansidecl.h"
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
/* Options passed to cplus_demangle (in 2nd parameter). */
|
|
|
|
|
2000-06-15 22:47:02 +02:00
|
|
|
#define DMGL_NO_OPTS 0 /* For readability... */
|
|
|
|
#define DMGL_PARAMS (1 << 0) /* Include function args */
|
|
|
|
#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
|
|
|
|
#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */
|
2002-02-05 18:53:17 +01:00
|
|
|
#define DMGL_VERBOSE (1 << 3) /* Include implementation details. */
|
|
|
|
#define DMGL_TYPES (1 << 4) /* Also try to demangle type encodings. */
|
2000-06-15 22:47:02 +02:00
|
|
|
|
|
|
|
#define DMGL_AUTO (1 << 8)
|
|
|
|
#define DMGL_GNU (1 << 9)
|
|
|
|
#define DMGL_LUCID (1 << 10)
|
|
|
|
#define DMGL_ARM (1 << 11)
|
|
|
|
#define DMGL_HP (1 << 12) /* For the HP aCC compiler;
|
|
|
|
same as ARM except for
|
|
|
|
template arguments, etc. */
|
|
|
|
#define DMGL_EDG (1 << 13)
|
2000-12-05 17:49:47 +01:00
|
|
|
#define DMGL_GNU_V3 (1 << 14)
|
2000-11-15 12:47:51 +01:00
|
|
|
#define DMGL_GNAT (1 << 15)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
/* If none of these are set, use 'current_demangling_style' as the default. */
|
2000-12-05 17:49:47 +01:00
|
|
|
#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG|DMGL_GNU_V3|DMGL_JAVA|DMGL_GNAT)
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
/* Enumeration of possible demangling styles.
|
|
|
|
|
|
|
|
Lucid and ARM styles are still kept logically distinct, even though
|
|
|
|
they now both behave identically. The resulting style is actual the
|
|
|
|
union of both. I.E. either style recognizes both "__pt__" and "__rf__"
|
|
|
|
for operator "->", even though the first is lucid style and the second
|
|
|
|
is ARM style. (FIXME?) */
|
|
|
|
|
|
|
|
extern enum demangling_styles
|
|
|
|
{
|
2001-12-06 22:57:28 +01:00
|
|
|
no_demangling = -1,
|
1999-05-03 09:29:11 +02:00
|
|
|
unknown_demangling = 0,
|
|
|
|
auto_demangling = DMGL_AUTO,
|
|
|
|
gnu_demangling = DMGL_GNU,
|
|
|
|
lucid_demangling = DMGL_LUCID,
|
|
|
|
arm_demangling = DMGL_ARM,
|
|
|
|
hp_demangling = DMGL_HP,
|
2000-06-15 22:47:02 +02:00
|
|
|
edg_demangling = DMGL_EDG,
|
2000-12-05 17:49:47 +01:00
|
|
|
gnu_v3_demangling = DMGL_GNU_V3,
|
2000-11-15 12:47:51 +01:00
|
|
|
java_demangling = DMGL_JAVA,
|
|
|
|
gnat_demangling = DMGL_GNAT
|
1999-05-03 09:29:11 +02:00
|
|
|
} current_demangling_style;
|
|
|
|
|
|
|
|
/* Define string names for the various demangling styles. */
|
|
|
|
|
2001-12-06 22:57:28 +01:00
|
|
|
#define NO_DEMANGLING_STYLE_STRING "none"
|
2000-06-15 22:47:02 +02:00
|
|
|
#define AUTO_DEMANGLING_STYLE_STRING "auto"
|
|
|
|
#define GNU_DEMANGLING_STYLE_STRING "gnu"
|
|
|
|
#define LUCID_DEMANGLING_STYLE_STRING "lucid"
|
|
|
|
#define ARM_DEMANGLING_STYLE_STRING "arm"
|
|
|
|
#define HP_DEMANGLING_STYLE_STRING "hp"
|
|
|
|
#define EDG_DEMANGLING_STYLE_STRING "edg"
|
2000-12-05 17:49:47 +01:00
|
|
|
#define GNU_V3_DEMANGLING_STYLE_STRING "gnu-v3"
|
2000-11-15 12:47:51 +01:00
|
|
|
#define JAVA_DEMANGLING_STYLE_STRING "java"
|
|
|
|
#define GNAT_DEMANGLING_STYLE_STRING "gnat"
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
/* Some macros to test what demangling style is active. */
|
|
|
|
|
|
|
|
#define CURRENT_DEMANGLING_STYLE current_demangling_style
|
|
|
|
#define AUTO_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_AUTO)
|
|
|
|
#define GNU_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU)
|
|
|
|
#define LUCID_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_LUCID)
|
|
|
|
#define ARM_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_ARM)
|
|
|
|
#define HP_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_HP)
|
|
|
|
#define EDG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_EDG)
|
2000-12-05 17:49:47 +01:00
|
|
|
#define GNU_V3_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU_V3)
|
2000-11-15 12:47:51 +01:00
|
|
|
#define JAVA_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_JAVA)
|
|
|
|
#define GNAT_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNAT)
|
2000-06-15 22:47:02 +02:00
|
|
|
|
|
|
|
/* Provide information about the available demangle styles. This code is
|
|
|
|
pulled from gdb into libiberty because it is useful to binutils also. */
|
|
|
|
|
2001-10-07 19:24:36 +02:00
|
|
|
extern const struct demangler_engine
|
2000-06-15 22:47:02 +02:00
|
|
|
{
|
2001-10-07 19:24:36 +02:00
|
|
|
const char *const demangling_style_name;
|
|
|
|
const enum demangling_styles demangling_style;
|
|
|
|
const char *const demangling_style_doc;
|
2000-06-15 22:47:02 +02:00
|
|
|
} libiberty_demanglers[];
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
extern char *
|
|
|
|
cplus_demangle PARAMS ((const char *mangled, int options));
|
|
|
|
|
|
|
|
extern int
|
|
|
|
cplus_demangle_opname PARAMS ((const char *opname, char *result, int options));
|
|
|
|
|
|
|
|
extern const char *
|
|
|
|
cplus_mangle_opname PARAMS ((const char *opname, int options));
|
|
|
|
|
|
|
|
/* Note: This sets global state. FIXME if you care about multi-threading. */
|
|
|
|
|
|
|
|
extern void
|
|
|
|
set_cplus_marker_for_demangling PARAMS ((int ch));
|
|
|
|
|
2000-06-15 22:47:02 +02:00
|
|
|
extern enum demangling_styles
|
|
|
|
cplus_demangle_set_style PARAMS ((enum demangling_styles style));
|
|
|
|
|
|
|
|
extern enum demangling_styles
|
|
|
|
cplus_demangle_name_to_style PARAMS ((const char *name));
|
|
|
|
|
2001-02-02 19:58:51 +01:00
|
|
|
/* V3 ABI demangling entry points, defined in cp-demangle.c. */
|
2000-06-15 22:47:02 +02:00
|
|
|
extern char*
|
2002-02-05 18:53:17 +01:00
|
|
|
cplus_demangle_v3 PARAMS ((const char* mangled, int options));
|
2002-02-03 14:12:45 +01:00
|
|
|
|
2001-02-02 19:58:51 +01:00
|
|
|
extern char*
|
|
|
|
java_demangle_v3 PARAMS ((const char* mangled));
|
|
|
|
|
2001-03-20 19:22:38 +01:00
|
|
|
|
|
|
|
enum gnu_v3_ctor_kinds {
|
|
|
|
gnu_v3_complete_object_ctor = 1,
|
|
|
|
gnu_v3_base_object_ctor,
|
|
|
|
gnu_v3_complete_object_allocating_ctor
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Return non-zero iff NAME is the mangled form of a constructor name
|
|
|
|
in the G++ V3 ABI demangling style. Specifically, return an `enum
|
|
|
|
gnu_v3_ctor_kinds' value indicating what kind of constructor
|
|
|
|
it is. */
|
2001-05-08 16:35:18 +02:00
|
|
|
extern enum gnu_v3_ctor_kinds
|
|
|
|
is_gnu_v3_mangled_ctor PARAMS ((const char *name));
|
2001-03-20 19:22:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
enum gnu_v3_dtor_kinds {
|
|
|
|
gnu_v3_deleting_dtor = 1,
|
|
|
|
gnu_v3_complete_object_dtor,
|
|
|
|
gnu_v3_base_object_dtor
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Return non-zero iff NAME is the mangled form of a destructor name
|
|
|
|
in the G++ V3 ABI demangling style. Specifically, return an `enum
|
|
|
|
gnu_v3_dtor_kinds' value, indicating what kind of destructor
|
|
|
|
it is. */
|
2001-05-08 16:35:18 +02:00
|
|
|
extern enum gnu_v3_dtor_kinds
|
|
|
|
is_gnu_v3_mangled_dtor PARAMS ((const char *name));
|
2001-03-20 19:22:38 +01:00
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
#endif /* DEMANGLE_H */
|