Back to index

cell-binutils  2.17cvs20070401
Classes | Defines | Typedefs | Enumerations | Functions | Variables
demangle.h File Reference
#include "libiberty.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  demangler_engine
struct  demangle_component
union  demangle_component.u
struct  demangle_component.u.s_name
struct  demangle_component.u.s_operator
struct  demangle_component.u.s_extended_operator
struct  demangle_component.u.s_ctor
struct  demangle_component.u.s_dtor
struct  demangle_component.u.s_builtin
struct  demangle_component.u.s_string
struct  demangle_component.u.s_number
struct  demangle_component.u.s_binary

Defines

#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++. */
#define DMGL_VERBOSE   (1 << 3) /* Include implementation details. */
#define DMGL_TYPES   (1 << 4) /* Also try to demangle type encodings. */
#define DMGL_RET_POSTFIX
#define DMGL_AUTO   (1 << 8)
#define DMGL_GNU   (1 << 9)
#define DMGL_LUCID   (1 << 10)
#define DMGL_ARM   (1 << 11)
#define DMGL_HP
#define DMGL_EDG   (1 << 13)
#define DMGL_GNU_V3   (1 << 14)
#define DMGL_GNAT   (1 << 15)
#define DMGL_STYLE_MASK   (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG|DMGL_GNU_V3|DMGL_JAVA|DMGL_GNAT)
#define NO_DEMANGLING_STYLE_STRING   "none"
#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"
#define GNU_V3_DEMANGLING_STYLE_STRING   "gnu-v3"
#define JAVA_DEMANGLING_STYLE_STRING   "java"
#define GNAT_DEMANGLING_STYLE_STRING   "gnat"
#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)
#define GNU_V3_DEMANGLING   (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU_V3)
#define JAVA_DEMANGLING   (((int) CURRENT_DEMANGLING_STYLE) & DMGL_JAVA)
#define GNAT_DEMANGLING   (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNAT)

Typedefs

typedef void(* demangle_callbackref )(const char *, size_t, void *)

Enumerations

enum  demangling_styles {
  no_demangling = -1, unknown_demangling = 0, auto_demangling = DMGL_AUTO, gnu_demangling = DMGL_GNU,
  lucid_demangling = DMGL_LUCID, arm_demangling = DMGL_ARM, hp_demangling = DMGL_HP, edg_demangling = DMGL_EDG,
  gnu_v3_demangling = DMGL_GNU_V3, java_demangling = DMGL_JAVA, gnat_demangling = DMGL_GNAT
}
enum  gnu_v3_ctor_kinds { gnu_v3_complete_object_ctor = 1, gnu_v3_base_object_ctor, gnu_v3_complete_object_allocating_ctor }
enum  gnu_v3_dtor_kinds { gnu_v3_deleting_dtor = 1, gnu_v3_complete_object_dtor, gnu_v3_base_object_dtor }
enum  demangle_component_type {
  DEMANGLE_COMPONENT_NAME, DEMANGLE_COMPONENT_QUAL_NAME, DEMANGLE_COMPONENT_LOCAL_NAME, DEMANGLE_COMPONENT_TYPED_NAME,
  DEMANGLE_COMPONENT_TEMPLATE, DEMANGLE_COMPONENT_TEMPLATE_PARAM, DEMANGLE_COMPONENT_CTOR, DEMANGLE_COMPONENT_DTOR,
  DEMANGLE_COMPONENT_VTABLE, DEMANGLE_COMPONENT_VTT, DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE, DEMANGLE_COMPONENT_TYPEINFO,
  DEMANGLE_COMPONENT_TYPEINFO_NAME, DEMANGLE_COMPONENT_TYPEINFO_FN, DEMANGLE_COMPONENT_THUNK, DEMANGLE_COMPONENT_VIRTUAL_THUNK,
  DEMANGLE_COMPONENT_COVARIANT_THUNK, DEMANGLE_COMPONENT_JAVA_CLASS, DEMANGLE_COMPONENT_GUARD, DEMANGLE_COMPONENT_REFTEMP,
  DEMANGLE_COMPONENT_HIDDEN_ALIAS, DEMANGLE_COMPONENT_SUB_STD, DEMANGLE_COMPONENT_RESTRICT, DEMANGLE_COMPONENT_VOLATILE,
  DEMANGLE_COMPONENT_CONST, DEMANGLE_COMPONENT_RESTRICT_THIS, DEMANGLE_COMPONENT_VOLATILE_THIS, DEMANGLE_COMPONENT_CONST_THIS,
  DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL, DEMANGLE_COMPONENT_POINTER, DEMANGLE_COMPONENT_REFERENCE, DEMANGLE_COMPONENT_COMPLEX,
  DEMANGLE_COMPONENT_IMAGINARY, DEMANGLE_COMPONENT_BUILTIN_TYPE, DEMANGLE_COMPONENT_VENDOR_TYPE, DEMANGLE_COMPONENT_FUNCTION_TYPE,
  DEMANGLE_COMPONENT_ARRAY_TYPE, DEMANGLE_COMPONENT_PTRMEM_TYPE, DEMANGLE_COMPONENT_ARGLIST, DEMANGLE_COMPONENT_TEMPLATE_ARGLIST,
  DEMANGLE_COMPONENT_OPERATOR, DEMANGLE_COMPONENT_EXTENDED_OPERATOR, DEMANGLE_COMPONENT_CAST, DEMANGLE_COMPONENT_UNARY,
  DEMANGLE_COMPONENT_BINARY, DEMANGLE_COMPONENT_BINARY_ARGS, DEMANGLE_COMPONENT_TRINARY, DEMANGLE_COMPONENT_TRINARY_ARG1,
  DEMANGLE_COMPONENT_TRINARY_ARG2, DEMANGLE_COMPONENT_LITERAL, DEMANGLE_COMPONENT_LITERAL_NEG
}

Functions

char * cplus_demangle (const char *mangled, int options)
int cplus_demangle_opname (const char *opname, char *result, int options)
const char * cplus_mangle_opname (const char *opname, int options)
void set_cplus_marker_for_demangling (int ch)
enum demangling_styles cplus_demangle_set_style (enum demangling_styles style)
enum demangling_styles cplus_demangle_name_to_style (const char *name)
int cplus_demangle_v3_callback (const char *mangled, int options, demangle_callbackref callback, void *opaque)
char * cplus_demangle_v3 (const char *mangled, int options)
int java_demangle_v3_callback (const char *mangled, demangle_callbackref callback, void *opaque)
char * java_demangle_v3 (const char *mangled)
enum gnu_v3_ctor_kinds is_gnu_v3_mangled_ctor (const char *name)
enum gnu_v3_dtor_kinds is_gnu_v3_mangled_dtor (const char *name)
int cplus_demangle_fill_component (struct demangle_component *fill, enum demangle_component_type, struct demangle_component *left, struct demangle_component *right)
int cplus_demangle_fill_name (struct demangle_component *fill, const char *, int)
int cplus_demangle_fill_builtin_type (struct demangle_component *fill, const char *type_name)
int cplus_demangle_fill_operator (struct demangle_component *fill, const char *opname, int args)
int cplus_demangle_fill_extended_operator (struct demangle_component *fill, int numargs, struct demangle_component *nm)
int cplus_demangle_fill_ctor (struct demangle_component *fill, enum gnu_v3_ctor_kinds kind, struct demangle_component *name)
int cplus_demangle_fill_dtor (struct demangle_component *fill, enum gnu_v3_dtor_kinds kind, struct demangle_component *name)
struct demangle_componentcplus_demangle_v3_components (const char *mangled, int options, void **mem)
char * cplus_demangle_print (int options, const struct demangle_component *tree, int estimated_length, size_t *p_allocated_size)
int cplus_demangle_print_callback (int options, const struct demangle_component *tree, demangle_callbackref callback, void *opaque)

Variables

enum demangling_styles current_demangling_style
struct demangler_engine libiberty_demanglers []

Class Documentation

struct demangler_engine

Definition at line 104 of file demangle.h.

Class Members
const char *const demangling_style_name
struct demangle_component

Definition at line 363 of file demangle.h.

Class Members
enum demangle_component_type
union demangle_component
u
union demangle_component.u

Definition at line 368 of file demangle.h.

Class Members
u s_binary
u s_builtin
u s_ctor
u s_dtor
u s_extended_operator
u s_name
u s_number
u s_operator
u s_string
struct demangle_component.u.s_name

Definition at line 371 of file demangle.h.

Class Members
int len
const char * s
struct demangle_component.u.s_operator

Definition at line 380 of file demangle.h.

Class Members
struct demangle_operator_info * op
struct demangle_component.u.s_extended_operator

Definition at line 387 of file demangle.h.

Class Members
int args
struct demangle_component * name
struct demangle_component.u.s_ctor

Definition at line 396 of file demangle.h.

Class Members
enum gnu_v3_ctor_kinds struct
demangle_component *
name
struct demangle_component.u.s_dtor

Definition at line 405 of file demangle.h.

Class Members
enum gnu_v3_dtor_kinds struct
demangle_component *
name
struct demangle_component.u.s_builtin

Definition at line 414 of file demangle.h.

Class Members
struct demangle_builtin_type_info * type
struct demangle_component.u.s_string

Definition at line 421 of file demangle.h.

Class Members
int len
const char * string
struct demangle_component.u.s_number

Definition at line 430 of file demangle.h.

Class Members
long number
struct demangle_component.u.s_binary

Definition at line 437 of file demangle.h.

Class Members
struct demangle_component * left
struct demangle_component * right

Define Documentation

Definition at line 94 of file demangle.h.

#define ARM_DEMANGLING_STYLE_STRING   "arm"

Definition at line 81 of file demangle.h.

Definition at line 91 of file demangle.h.

#define AUTO_DEMANGLING_STYLE_STRING   "auto"

Definition at line 78 of file demangle.h.

Definition at line 90 of file demangle.h.

#define DMGL_ANSI   (1 << 1) /* Include const, volatile, etc */

Definition at line 34 of file demangle.h.

#define DMGL_ARM   (1 << 11)

Definition at line 43 of file demangle.h.

#define DMGL_AUTO   (1 << 8)

Definition at line 40 of file demangle.h.

#define DMGL_EDG   (1 << 13)

Definition at line 45 of file demangle.h.

#define DMGL_GNAT   (1 << 15)

Definition at line 47 of file demangle.h.

#define DMGL_GNU   (1 << 9)

Definition at line 41 of file demangle.h.

#define DMGL_GNU_V3   (1 << 14)

Definition at line 46 of file demangle.h.

#define DMGL_HP
Value:
(1 << 12)       /* For the HP aCC compiler;
                                            same as ARM except for
                                            template arguments, etc. */

Definition at line 44 of file demangle.h.

#define DMGL_JAVA   (1 << 2) /* Demangle as Java rather than C++. */

Definition at line 35 of file demangle.h.

#define DMGL_LUCID   (1 << 10)

Definition at line 42 of file demangle.h.

#define DMGL_NO_OPTS   0 /* For readability... */

Definition at line 32 of file demangle.h.

#define DMGL_PARAMS   (1 << 0) /* Include function args */

Definition at line 33 of file demangle.h.

Value:
(1 << 5)       /* Print function return types (when
                                           present) after function signature */

Definition at line 38 of file demangle.h.

Definition at line 50 of file demangle.h.

#define DMGL_TYPES   (1 << 4) /* Also try to demangle type encodings. */

Definition at line 37 of file demangle.h.

#define DMGL_VERBOSE   (1 << 3) /* Include implementation details. */

Definition at line 36 of file demangle.h.

Definition at line 96 of file demangle.h.

#define EDG_DEMANGLING_STYLE_STRING   "edg"

Definition at line 83 of file demangle.h.

Definition at line 99 of file demangle.h.

#define GNAT_DEMANGLING_STYLE_STRING   "gnat"

Definition at line 86 of file demangle.h.

Definition at line 92 of file demangle.h.

#define GNU_DEMANGLING_STYLE_STRING   "gnu"

Definition at line 79 of file demangle.h.

Definition at line 97 of file demangle.h.

#define GNU_V3_DEMANGLING_STYLE_STRING   "gnu-v3"

Definition at line 84 of file demangle.h.

Definition at line 95 of file demangle.h.

#define HP_DEMANGLING_STYLE_STRING   "hp"

Definition at line 82 of file demangle.h.

Definition at line 98 of file demangle.h.

#define JAVA_DEMANGLING_STYLE_STRING   "java"

Definition at line 85 of file demangle.h.

Definition at line 93 of file demangle.h.

#define LUCID_DEMANGLING_STYLE_STRING   "lucid"

Definition at line 80 of file demangle.h.

#define NO_DEMANGLING_STYLE_STRING   "none"

Definition at line 77 of file demangle.h.


Typedef Documentation

typedef void(* demangle_callbackref)(const char *, size_t, void *)

Definition at line 132 of file demangle.h.


Enumeration Type Documentation

Enumerator:
DEMANGLE_COMPONENT_NAME 
DEMANGLE_COMPONENT_QUAL_NAME 
DEMANGLE_COMPONENT_LOCAL_NAME 
DEMANGLE_COMPONENT_TYPED_NAME 
DEMANGLE_COMPONENT_TEMPLATE 
DEMANGLE_COMPONENT_TEMPLATE_PARAM 
DEMANGLE_COMPONENT_CTOR 
DEMANGLE_COMPONENT_DTOR 
DEMANGLE_COMPONENT_VTABLE 
DEMANGLE_COMPONENT_VTT 
DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE 
DEMANGLE_COMPONENT_TYPEINFO 
DEMANGLE_COMPONENT_TYPEINFO_NAME 
DEMANGLE_COMPONENT_TYPEINFO_FN 
DEMANGLE_COMPONENT_THUNK 
DEMANGLE_COMPONENT_VIRTUAL_THUNK 
DEMANGLE_COMPONENT_COVARIANT_THUNK 
DEMANGLE_COMPONENT_JAVA_CLASS 
DEMANGLE_COMPONENT_GUARD 
DEMANGLE_COMPONENT_REFTEMP 
DEMANGLE_COMPONENT_HIDDEN_ALIAS 
DEMANGLE_COMPONENT_SUB_STD 
DEMANGLE_COMPONENT_RESTRICT 
DEMANGLE_COMPONENT_VOLATILE 
DEMANGLE_COMPONENT_CONST 
DEMANGLE_COMPONENT_RESTRICT_THIS 
DEMANGLE_COMPONENT_VOLATILE_THIS 
DEMANGLE_COMPONENT_CONST_THIS 
DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL 
DEMANGLE_COMPONENT_POINTER 
DEMANGLE_COMPONENT_REFERENCE 
DEMANGLE_COMPONENT_COMPLEX 
DEMANGLE_COMPONENT_IMAGINARY 
DEMANGLE_COMPONENT_BUILTIN_TYPE 
DEMANGLE_COMPONENT_VENDOR_TYPE 
DEMANGLE_COMPONENT_FUNCTION_TYPE 
DEMANGLE_COMPONENT_ARRAY_TYPE 
DEMANGLE_COMPONENT_PTRMEM_TYPE 
DEMANGLE_COMPONENT_ARGLIST 
DEMANGLE_COMPONENT_TEMPLATE_ARGLIST 
DEMANGLE_COMPONENT_OPERATOR 
DEMANGLE_COMPONENT_EXTENDED_OPERATOR 
DEMANGLE_COMPONENT_CAST 
DEMANGLE_COMPONENT_UNARY 
DEMANGLE_COMPONENT_BINARY 
DEMANGLE_COMPONENT_BINARY_ARGS 
DEMANGLE_COMPONENT_TRINARY 
DEMANGLE_COMPONENT_TRINARY_ARG1 
DEMANGLE_COMPONENT_TRINARY_ARG2 
DEMANGLE_COMPONENT_LITERAL 
DEMANGLE_COMPONENT_LITERAL_NEG 

Definition at line 192 of file demangle.h.

{
  /* A name, with a length and a pointer to a string.  */
  DEMANGLE_COMPONENT_NAME,
  /* A qualified name.  The left subtree is a class or namespace or
     some such thing, and the right subtree is a name qualified by
     that class.  */
  DEMANGLE_COMPONENT_QUAL_NAME,
  /* A local name.  The left subtree describes a function, and the
     right subtree is a name which is local to that function.  */
  DEMANGLE_COMPONENT_LOCAL_NAME,
  /* A typed name.  The left subtree is a name, and the right subtree
     describes that name as a function.  */
  DEMANGLE_COMPONENT_TYPED_NAME,
  /* A template.  The left subtree is a template name, and the right
     subtree is a template argument list.  */
  DEMANGLE_COMPONENT_TEMPLATE,
  /* A template parameter.  This holds a number, which is the template
     parameter index.  */
  DEMANGLE_COMPONENT_TEMPLATE_PARAM,
  /* A constructor.  This holds a name and the kind of
     constructor.  */
  DEMANGLE_COMPONENT_CTOR,
  /* A destructor.  This holds a name and the kind of destructor.  */
  DEMANGLE_COMPONENT_DTOR,
  /* A vtable.  This has one subtree, the type for which this is a
     vtable.  */
  DEMANGLE_COMPONENT_VTABLE,
  /* A VTT structure.  This has one subtree, the type for which this
     is a VTT.  */
  DEMANGLE_COMPONENT_VTT,
  /* A construction vtable.  The left subtree is the type for which
     this is a vtable, and the right subtree is the derived type for
     which this vtable is built.  */
  DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE,
  /* A typeinfo structure.  This has one subtree, the type for which
     this is the tpeinfo structure.  */
  DEMANGLE_COMPONENT_TYPEINFO,
  /* A typeinfo name.  This has one subtree, the type for which this
     is the typeinfo name.  */
  DEMANGLE_COMPONENT_TYPEINFO_NAME,
  /* A typeinfo function.  This has one subtree, the type for which
     this is the tpyeinfo function.  */
  DEMANGLE_COMPONENT_TYPEINFO_FN,
  /* A thunk.  This has one subtree, the name for which this is a
     thunk.  */
  DEMANGLE_COMPONENT_THUNK,
  /* A virtual thunk.  This has one subtree, the name for which this
     is a virtual thunk.  */
  DEMANGLE_COMPONENT_VIRTUAL_THUNK,
  /* A covariant thunk.  This has one subtree, the name for which this
     is a covariant thunk.  */
  DEMANGLE_COMPONENT_COVARIANT_THUNK,
  /* A Java class.  This has one subtree, the type.  */
  DEMANGLE_COMPONENT_JAVA_CLASS,
  /* A guard variable.  This has one subtree, the name for which this
     is a guard variable.  */
  DEMANGLE_COMPONENT_GUARD,
  /* A reference temporary.  This has one subtree, the name for which
     this is a temporary.  */
  DEMANGLE_COMPONENT_REFTEMP,
  /* A hidden alias.  This has one subtree, the encoding for which it
     is providing alternative linkage.  */
  DEMANGLE_COMPONENT_HIDDEN_ALIAS,
  /* A standard substitution.  This holds the name of the
     substitution.  */
  DEMANGLE_COMPONENT_SUB_STD,
  /* The restrict qualifier.  The one subtree is the type which is
     being qualified.  */
  DEMANGLE_COMPONENT_RESTRICT,
  /* The volatile qualifier.  The one subtree is the type which is
     being qualified.  */
  DEMANGLE_COMPONENT_VOLATILE,
  /* The const qualifier.  The one subtree is the type which is being
     qualified.  */
  DEMANGLE_COMPONENT_CONST,
  /* The restrict qualifier modifying a member function.  The one
     subtree is the type which is being qualified.  */
  DEMANGLE_COMPONENT_RESTRICT_THIS,
  /* The volatile qualifier modifying a member function.  The one
     subtree is the type which is being qualified.  */
  DEMANGLE_COMPONENT_VOLATILE_THIS,
  /* The const qualifier modifying a member function.  The one subtree
     is the type which is being qualified.  */
  DEMANGLE_COMPONENT_CONST_THIS,
  /* A vendor qualifier.  The left subtree is the type which is being
     qualified, and the right subtree is the name of the
     qualifier.  */
  DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL,
  /* A pointer.  The one subtree is the type which is being pointed
     to.  */
  DEMANGLE_COMPONENT_POINTER,
  /* A reference.  The one subtree is the type which is being
     referenced.  */
  DEMANGLE_COMPONENT_REFERENCE,
  /* A complex type.  The one subtree is the base type.  */
  DEMANGLE_COMPONENT_COMPLEX,
  /* An imaginary type.  The one subtree is the base type.  */
  DEMANGLE_COMPONENT_IMAGINARY,
  /* A builtin type.  This holds the builtin type information.  */
  DEMANGLE_COMPONENT_BUILTIN_TYPE,
  /* A vendor's builtin type.  This holds the name of the type.  */
  DEMANGLE_COMPONENT_VENDOR_TYPE,
  /* A function type.  The left subtree is the return type.  The right
     subtree is a list of ARGLIST nodes.  Either or both may be
     NULL.  */
  DEMANGLE_COMPONENT_FUNCTION_TYPE,
  /* An array type.  The left subtree is the dimension, which may be
     NULL, or a string (represented as DEMANGLE_COMPONENT_NAME), or an
     expression.  The right subtree is the element type.  */
  DEMANGLE_COMPONENT_ARRAY_TYPE,
  /* A pointer to member type.  The left subtree is the class type,
     and the right subtree is the member type.  CV-qualifiers appear
     on the latter.  */
  DEMANGLE_COMPONENT_PTRMEM_TYPE,
  /* An argument list.  The left subtree is the current argument, and
     the right subtree is either NULL or another ARGLIST node.  */
  DEMANGLE_COMPONENT_ARGLIST,
  /* A template argument list.  The left subtree is the current
     template argument, and the right subtree is either NULL or
     another TEMPLATE_ARGLIST node.  */
  DEMANGLE_COMPONENT_TEMPLATE_ARGLIST,
  /* An operator.  This holds information about a standard
     operator.  */
  DEMANGLE_COMPONENT_OPERATOR,
  /* An extended operator.  This holds the number of arguments, and
     the name of the extended operator.  */
  DEMANGLE_COMPONENT_EXTENDED_OPERATOR,
  /* A typecast, represented as a unary operator.  The one subtree is
     the type to which the argument should be cast.  */
  DEMANGLE_COMPONENT_CAST,
  /* A unary expression.  The left subtree is the operator, and the
     right subtree is the single argument.  */
  DEMANGLE_COMPONENT_UNARY,
  /* A binary expression.  The left subtree is the operator, and the
     right subtree is a BINARY_ARGS.  */
  DEMANGLE_COMPONENT_BINARY,
  /* Arguments to a binary expression.  The left subtree is the first
     argument, and the right subtree is the second argument.  */
  DEMANGLE_COMPONENT_BINARY_ARGS,
  /* A trinary expression.  The left subtree is the operator, and the
     right subtree is a TRINARY_ARG1.  */
  DEMANGLE_COMPONENT_TRINARY,
  /* Arguments to a trinary expression.  The left subtree is the first
     argument, and the right subtree is a TRINARY_ARG2.  */
  DEMANGLE_COMPONENT_TRINARY_ARG1,
  /* More arguments to a trinary expression.  The left subtree is the
     second argument, and the right subtree is the third argument.  */
  DEMANGLE_COMPONENT_TRINARY_ARG2,
  /* A literal.  The left subtree is the type, and the right subtree
     is the value, represented as a DEMANGLE_COMPONENT_NAME.  */
  DEMANGLE_COMPONENT_LITERAL,
  /* A negative literal.  Like LITERAL, but the value is negated.
     This is a minor hack: the NAME used for LITERAL points directly
     to the mangled string, but since negative numbers are mangled
     using 'n' instead of '-', we want a way to indicate a negative
     number which involves neither modifying the mangled string nor
Enumerator:
no_demangling 
unknown_demangling 
auto_demangling 
gnu_demangling 
lucid_demangling 
arm_demangling 
hp_demangling 
edg_demangling 
gnu_v3_demangling 
java_demangling 
gnat_demangling 

Definition at line 60 of file demangle.h.

Enumerator:
gnu_v3_complete_object_ctor 
gnu_v3_base_object_ctor 
gnu_v3_complete_object_allocating_ctor 

Definition at line 151 of file demangle.h.

Enumerator:
gnu_v3_deleting_dtor 
gnu_v3_complete_object_dtor 
gnu_v3_base_object_dtor 

Definition at line 165 of file demangle.h.


Function Documentation

char* cplus_demangle ( const char *  mangled,
int  options 
)

Definition at line 846 of file cplus-dem.c.

{
  char *ret;
  struct work_stuff work[1];

  if (current_demangling_style == no_demangling)
    return xstrdup (mangled);

  memset ((char *) work, 0, sizeof (work));
  work->options = options;
  if ((work->options & DMGL_STYLE_MASK) == 0)
    work->options |= (int) current_demangling_style & DMGL_STYLE_MASK;

  /* The V3 ABI demangling is implemented elsewhere.  */
  if (GNU_V3_DEMANGLING || AUTO_DEMANGLING)
    {
      ret = cplus_demangle_v3 (mangled, work->options);
      if (ret || GNU_V3_DEMANGLING)
       return ret;
    }

  if (JAVA_DEMANGLING)
    {
      ret = java_demangle_v3 (mangled);
      if (ret)
        return ret;
    }

  if (GNAT_DEMANGLING)
    return ada_demangle(mangled,options);

  ret = internal_cplus_demangle (work, mangled);
  squangle_mop_up (work);
  return (ret);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 132 of file cp-demint.c.

{
  int len;
  unsigned int i;

  if (p == NULL || type_name == NULL)
    return 0;
  len = strlen (type_name);
  for (i = 0; i < D_BUILTIN_TYPE_COUNT; ++i)
    {
      if (len == cplus_demangle_builtin_types[i].len
         && strcmp (type_name, cplus_demangle_builtin_types[i].name) == 0)
       {
         p->type = DEMANGLE_COMPONENT_BUILTIN_TYPE;
         p->u.s_builtin.type = &cplus_demangle_builtin_types[i];
         return 1;
       }
    }
  return 0;
}

Here is the call graph for this function:

int cplus_demangle_fill_component ( struct demangle_component fill,
enum  demangle_component_type,
struct demangle_component left,
struct demangle_component right 
)

Definition at line 59 of file cp-demint.c.

{
  if (p == NULL)
    return 0;
  switch (type)
    {
    case DEMANGLE_COMPONENT_QUAL_NAME:
    case DEMANGLE_COMPONENT_LOCAL_NAME:
    case DEMANGLE_COMPONENT_TYPED_NAME:
    case DEMANGLE_COMPONENT_TEMPLATE:
    case DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE:
    case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
    case DEMANGLE_COMPONENT_FUNCTION_TYPE:
    case DEMANGLE_COMPONENT_ARRAY_TYPE:
    case DEMANGLE_COMPONENT_PTRMEM_TYPE:
    case DEMANGLE_COMPONENT_ARGLIST:
    case DEMANGLE_COMPONENT_TEMPLATE_ARGLIST:
    case DEMANGLE_COMPONENT_UNARY:
    case DEMANGLE_COMPONENT_BINARY:
    case DEMANGLE_COMPONENT_BINARY_ARGS:
    case DEMANGLE_COMPONENT_TRINARY:
    case DEMANGLE_COMPONENT_TRINARY_ARG1:
    case DEMANGLE_COMPONENT_TRINARY_ARG2:
    case DEMANGLE_COMPONENT_LITERAL:
    case DEMANGLE_COMPONENT_LITERAL_NEG:
      break;

      /* These component types only have one subtree.  */
    case DEMANGLE_COMPONENT_VTABLE:
    case DEMANGLE_COMPONENT_VTT:
    case DEMANGLE_COMPONENT_TYPEINFO:
    case DEMANGLE_COMPONENT_TYPEINFO_NAME:
    case DEMANGLE_COMPONENT_TYPEINFO_FN:
    case DEMANGLE_COMPONENT_THUNK:
    case DEMANGLE_COMPONENT_VIRTUAL_THUNK:
    case DEMANGLE_COMPONENT_COVARIANT_THUNK:
    case DEMANGLE_COMPONENT_JAVA_CLASS:
    case DEMANGLE_COMPONENT_GUARD:
    case DEMANGLE_COMPONENT_REFTEMP:
    case DEMANGLE_COMPONENT_RESTRICT:
    case DEMANGLE_COMPONENT_VOLATILE:
    case DEMANGLE_COMPONENT_CONST:
    case DEMANGLE_COMPONENT_RESTRICT_THIS:
    case DEMANGLE_COMPONENT_VOLATILE_THIS:
    case DEMANGLE_COMPONENT_CONST_THIS:
    case DEMANGLE_COMPONENT_POINTER:
    case DEMANGLE_COMPONENT_REFERENCE:
    case DEMANGLE_COMPONENT_COMPLEX:
    case DEMANGLE_COMPONENT_IMAGINARY:
    case DEMANGLE_COMPONENT_VENDOR_TYPE:
    case DEMANGLE_COMPONENT_CAST:
      if (right != NULL)
       return 0;
      break;

    default:
      /* Other types do not use subtrees.  */
      return 0;
    }

  p->type = type;
  p->u.s_binary.left = left;
  p->u.s_binary.right = right;

  return 1;
}

Definition at line 691 of file cp-demangle.c.

{
  if (p == NULL
      || name == NULL
      || (kind < gnu_v3_complete_object_ctor
         && kind > gnu_v3_complete_object_allocating_ctor))
    return 0;
  p->type = DEMANGLE_COMPONENT_CTOR;
  p->u.s_ctor.kind = kind;
  p->u.s_ctor.name = name;
  return 1;
}

Here is the caller graph for this function:

Definition at line 710 of file cp-demangle.c.

{
  if (p == NULL
      || name == NULL
      || (kind < gnu_v3_deleting_dtor
         && kind > gnu_v3_base_object_dtor))
    return 0;
  p->type = DEMANGLE_COMPONENT_DTOR;
  p->u.s_dtor.kind = kind;
  p->u.s_dtor.name = name;
  return 1;
}

Here is the caller graph for this function:

Definition at line 676 of file cp-demangle.c.

{
  if (p == NULL || args < 0 || name == NULL)
    return 0;
  p->type = DEMANGLE_COMPONENT_EXTENDED_OPERATOR;
  p->u.s_extended_operator.args = args;
  p->u.s_extended_operator.name = name;
  return 1;
}

Here is the caller graph for this function:

Definition at line 662 of file cp-demangle.c.

{
  if (p == NULL || s == NULL || len == 0)
    return 0;
  p->type = DEMANGLE_COMPONENT_NAME;
  p->u.s_name.s = s;
  p->u.s_name.len = len;
  return 1;
}

Here is the caller graph for this function:

int cplus_demangle_fill_operator ( struct demangle_component fill,
const char *  opname,
int  args 
)

Definition at line 157 of file cp-demint.c.

{
  int len;
  unsigned int i;

  if (p == NULL || opname == NULL)
    return 0;
  len = strlen (opname);
  for (i = 0; cplus_demangle_operators[i].name != NULL; ++i)
    {
      if (len == cplus_demangle_operators[i].len
         && args == cplus_demangle_operators[i].args
         && strcmp (opname, cplus_demangle_operators[i].name) == 0)
       {
         p->type = DEMANGLE_COMPONENT_OPERATOR;
         p->u.s_operator.op = &cplus_demangle_operators[i];
         return 1;
       }
    }
  return 0;
}

Here is the call graph for this function:

Definition at line 806 of file cplus-dem.c.

{
  const struct demangler_engine *demangler = libiberty_demanglers; 

  for (; demangler->demangling_style != unknown_demangling; ++demangler)
    if (strcmp (name, demangler->demangling_style_name) == 0)
      return demangler->demangling_style;

  return unknown_demangling;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int cplus_demangle_opname ( const char *  opname,
char *  result,
int  options 
)

Definition at line 636 of file cplus-dem.c.

{
  int len, len1, ret;
  string type;
  struct work_stuff work[1];
  const char *tem;

  len = strlen(opname);
  result[0] = '\0';
  ret = 0;
  memset ((char *) work, 0, sizeof (work));
  work->options = options;

  if (opname[0] == '_' && opname[1] == '_'
      && opname[2] == 'o' && opname[3] == 'p')
    {
      /* ANSI.  */
      /* type conversion operator.  */
      tem = opname + 4;
      if (do_type (work, &tem, &type))
       {
         strcat (result, "operator ");
         strncat (result, type.b, type.p - type.b);
         string_delete (&type);
         ret = 1;
       }
    }
  else if (opname[0] == '_' && opname[1] == '_'
          && ISLOWER((unsigned char)opname[2])
          && ISLOWER((unsigned char)opname[3]))
    {
      if (opname[4] == '\0')
       {
         /* Operator.  */
         size_t i;
         for (i = 0; i < ARRAY_SIZE (optable); i++)
           {
             if (strlen (optable[i].in) == 2
                && memcmp (optable[i].in, opname + 2, 2) == 0)
              {
                strcat (result, "operator");
                strcat (result, optable[i].out);
                ret = 1;
                break;
              }
           }
       }
      else
       {
         if (opname[2] == 'a' && opname[5] == '\0')
           {
             /* Assignment.  */
             size_t i;
             for (i = 0; i < ARRAY_SIZE (optable); i++)
              {
                if (strlen (optable[i].in) == 3
                    && memcmp (optable[i].in, opname + 2, 3) == 0)
                  {
                    strcat (result, "operator");
                    strcat (result, optable[i].out);
                    ret = 1;
                    break;
                  }
              }
           }
       }
    }
  else if (len >= 3
          && opname[0] == 'o'
          && opname[1] == 'p'
          && strchr (cplus_markers, opname[2]) != NULL)
    {
      /* see if it's an assignment expression */
      if (len >= 10 /* op$assign_ */
         && memcmp (opname + 3, "assign_", 7) == 0)
       {
         size_t i;
         for (i = 0; i < ARRAY_SIZE (optable); i++)
           {
             len1 = len - 10;
             if ((int) strlen (optable[i].in) == len1
                && memcmp (optable[i].in, opname + 10, len1) == 0)
              {
                strcat (result, "operator");
                strcat (result, optable[i].out);
                strcat (result, "=");
                ret = 1;
                break;
              }
           }
       }
      else
       {
         size_t i;
         for (i = 0; i < ARRAY_SIZE (optable); i++)
           {
             len1 = len - 3;
             if ((int) strlen (optable[i].in) == len1
                && memcmp (optable[i].in, opname + 3, len1) == 0)
              {
                strcat (result, "operator");
                strcat (result, optable[i].out);
                ret = 1;
                break;
              }
           }
       }
    }
  else if (len >= 5 && memcmp (opname, "type", 4) == 0
          && strchr (cplus_markers, opname[4]) != NULL)
    {
      /* type conversion operator */
      tem = opname + 5;
      if (do_type (work, &tem, &type))
       {
         strcat (result, "operator ");
         strncat (result, type.b, type.p - type.b);
         string_delete (&type);
         ret = 1;
       }
    }
  squangle_mop_up (work);
  return ret;

}

Here is the call graph for this function:

char* cplus_demangle_print ( int  options,
const struct demangle_component tree,
int  estimated_length,
size_t p_allocated_size 
)

Definition at line 2805 of file cp-demangle.c.

{
  struct d_growable_string dgs;

  d_growable_string_init (&dgs, estimate);

  if (! cplus_demangle_print_callback (options, dc,
                                       d_growable_string_callback_adapter,
                                       &dgs))
    {
      free (dgs.buf);
      *palc = 0;
      return NULL;
    }

  *palc = dgs.allocation_failure ? 1 : dgs.alc;
  return dgs.buf;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int cplus_demangle_print_callback ( int  options,
const struct demangle_component tree,
demangle_callbackref  callback,
void *  opaque 
)

Definition at line 2780 of file cp-demangle.c.

{
  struct d_print_info dpi;

  d_print_init (&dpi, options, callback, opaque);

  d_print_comp (&dpi, dc);

  d_print_flush (&dpi);

  return ! d_print_saw_error (&dpi);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 789 of file cplus-dem.c.

{
  const struct demangler_engine *demangler = libiberty_demanglers; 

  for (; demangler->demangling_style != unknown_demangling; ++demangler)
    if (style == demangler->demangling_style)
      {
       current_demangling_style = style;
       return current_demangling_style;
      }

  return unknown_demangling;
}

Here is the caller graph for this function:

char* cplus_demangle_v3 ( const char *  mangled,
int  options 
)

Definition at line 4178 of file cp-demangle.c.

{
  size_t alc;

  return d_demangle (mangled, options, &alc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int cplus_demangle_v3_callback ( const char *  mangled,
int  options,
demangle_callbackref  callback,
void *  opaque 
)

Definition at line 4186 of file cp-demangle.c.

{
  return d_demangle_callback (mangled, options, callback, opaque);
}

Here is the call graph for this function:

struct demangle_component* cplus_demangle_v3_components ( const char *  mangled,
int  options,
void **  mem 
) [read]

Definition at line 183 of file cp-demint.c.

{
  size_t len;
  int type;
  struct d_info di;
  struct demangle_component *dc;

  len = strlen (mangled);

  if (mangled[0] == '_' && mangled[1] == 'Z')
    type = 0;
  else
    {
      if ((options & DMGL_TYPES) == 0)
       return NULL;
      type = 1;
    }

  cplus_demangle_init_info (mangled, options, len, &di);

  di.comps = ((struct demangle_component *)
             malloc (di.num_comps * sizeof (struct demangle_component)));
  di.subs = ((struct demangle_component **)
            malloc (di.num_subs * sizeof (struct demangle_component *)));
  if (di.comps == NULL || di.subs == NULL)
    {
      if (di.comps != NULL)
       free (di.comps);
      if (di.subs != NULL)
       free (di.subs);
      return NULL;
    }

  if (! type)
    dc = cplus_demangle_mangled_name (&di, 1);
  else
    dc = cplus_demangle_type (&di);

  /* If DMGL_PARAMS is set, then if we didn't consume the entire
     mangled string, then we didn't successfully demangle it.  */
  if ((options & DMGL_PARAMS) != 0 && d_peek_char (&di) != '\0')
    dc = NULL;

  free (di.subs);

  if (dc != NULL)
    *mem = di.comps;
  else
    free (di.comps);

  return dc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* cplus_mangle_opname ( const char *  opname,
int  options 
)

Definition at line 769 of file cplus-dem.c.

{
  size_t i;
  int len;

  len = strlen (opname);
  for (i = 0; i < ARRAY_SIZE (optable); i++)
    {
      if ((int) strlen (optable[i].out) == len
         && (options & DMGL_ANSI) == (optable[i].flags & DMGL_ANSI)
         && memcmp (optable[i].out, opname, len) == 0)
       return optable[i].in;
    }
  return (0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 4294 of file cp-demangle.c.

{
  enum gnu_v3_ctor_kinds ctor_kind;
  enum gnu_v3_dtor_kinds dtor_kind;

  if (! is_ctor_or_dtor (name, &ctor_kind, &dtor_kind))
    return (enum gnu_v3_ctor_kinds) 0;
  return ctor_kind;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 4309 of file cp-demangle.c.

{
  enum gnu_v3_ctor_kinds ctor_kind;
  enum gnu_v3_dtor_kinds dtor_kind;

  if (! is_ctor_or_dtor (name, &ctor_kind, &dtor_kind))
    return (enum gnu_v3_dtor_kinds) 0;
  return dtor_kind;
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* java_demangle_v3 ( const char *  mangled)

Definition at line 4199 of file cp-demangle.c.

{
  size_t alc;

  return d_demangle (mangled, DMGL_JAVA | DMGL_PARAMS | DMGL_RET_POSTFIX, &alc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int java_demangle_v3_callback ( const char *  mangled,
demangle_callbackref  callback,
void *  opaque 
)

Definition at line 4207 of file cp-demangle.c.

Here is the call graph for this function:

Definition at line 102 of file cplus-dem.c.

{
  cplus_markers[0] = ch;
}

Variable Documentation