osprey/cygnus/libiberty/cplus-dem.c File Reference

#include "safe-ctype.h"
#include <sys/types.h>
#include <string.h>
#include <stdio.h>
#include <demangle.h>
#include "libiberty.h"

Include dependency graph for cplus-dem.c:

Go to the source code of this file.

Data Types

type  string
type  work_stuff
type  optable

Defines

#define CURRENT_DEMANGLING_STYLE   work->options
#define min(X, Y)   (((X) < (Y)) ? (X) : (Y))
#define INTBUF_SIZE   32
#define CPLUS_MARKER   '$'
#define PRINT_ANSI_QUALIFIERS   (work -> options & DMGL_ANSI)
#define PRINT_ARG_TYPES   (work -> options & DMGL_PARAMS)
#define STRING_EMPTY(str)   ((str) -> b == (str) -> p)
#define APPEND_BLANK(str)
#define LEN_STRING(str)   ( (STRING_EMPTY(str))?0:((str)->p - (str)->b))
#define SCOPE_STRING(work)   ((work->options & DMGL_JAVA) ? "." : "::")
#define ARM_VTABLE_STRING   "__vtbl__"
#define ARM_VTABLE_STRLEN   8
#define TYPE_UNQUALIFIED   0x0
#define TYPE_QUAL_CONST   0x1
#define TYPE_QUAL_VOLATILE   0x2
#define TYPE_QUAL_RESTRICT   0x4

Enumerations

enum  type_kind_t {
  tk_none, tk_pointer, tk_reference, tk_integral,
  tk_bool, tk_char, tk_real, tk_none,
  tk_pointer, tk_reference, tk_integral, tk_bool,
  tk_char, tk_real, tk_none, tk_pointer,
  tk_reference, tk_integral, tk_bool, tk_char,
  tk_real, tk_none, tk_pointer, tk_reference,
  tk_integral, tk_bool, tk_char, tk_real
}

Functions/Subroutines

char * malloc ()
char * realloc ()
static char *ada_demangle PARAMS ((const char *, int))
void fancy_abort PARAMS ((void))
void set_cplus_marker_for_demangling (int ch)
static void delete_work_stuff PARAMS ((struct work_stuff *))
static char *mop_up PARAMS ((struct work_stuff *, string *, int))
static void work_stuff_copy_to_from PARAMS ((struct work_stuff *, struct work_stuff *))
static char
*internal_cplus_demangle 
PARAMS ((struct work_stuff *, const char *))
static int
demangle_template_template_parm 
PARAMS ((struct work_stuff *work, const char **, string *))
static int demangle_template PARAMS ((struct work_stuff *work, const char **, string *, string *, int, int))
static int arm_pt PARAMS ((struct work_stuff *, const char *, int, const char **, const char **))
static int demangle_class_name PARAMS ((struct work_stuff *, const char **, string *))
static int demangle_qualified PARAMS ((struct work_stuff *, const char **, string *, int, int))
static int arm_special PARAMS ((const char **, string *))
static void string_need PARAMS ((string *, int))
static void string_delete PARAMS ((string *))
static void string_append PARAMS ((string *, const char *))
static void string_appends PARAMS ((string *, string *))
static void string_appendn PARAMS ((string *, const char *, int))
static int get_count PARAMS ((const char **, int *))
static int consume_count PARAMS ((const char **))
static void demangle_function_name PARAMS ((struct work_stuff *, const char **, string *, const char *))
static void remember_type PARAMS ((struct work_stuff *, const char *, int))
static void remember_Btype PARAMS ((struct work_stuff *, const char *, int, int))
static int
demangle_template_value_parm 
PARAMS ((struct work_stuff *, const char **, string *, type_kind_t))
static int code_for_qualifier PARAMS ((int))
static void
demangle_arm_hp_template 
PARAMS ((struct work_stuff *, const char **, int, string *))
static void recursively_demangle PARAMS ((struct work_stuff *, const char **, string *, int))
static void grow_vect PARAMS ((char **, size_t *, size_t, int))
static int consume_count (char **type) const
static int consume_count_with_underscores (char **mangled) const
static int code_for_qualifier (int c)
static const char * qualifier_string (int type_quals)
static const char * demangle_qualifier (int c)
int cplus_demangle_opname (char *opname, char *result, int options) const
const char * cplus_mangle_opname (char *opname, int options) const
enum demangling_styles cplus_demangle_set_style (enum demangling_styles style)
enum demangling_styles cplus_demangle_name_to_style (char *name) const
char * cplus_demangle (char *mangled, int options) const
static void grow_vect (char **old_vect, size_t *size, size_t min_size, int element_size)
static char * ada_demangle (char *mangled, option) const
static char * internal_cplus_demangle (struct work_stuff *work, const char *mangled)
static void squangle_mop_up (struct work_stuff *work)
static void work_stuff_copy_to_from (struct work_stuff *to, struct work_stuff *from)
static void delete_non_B_K_work_stuff (struct work_stuff *work)
static void delete_work_stuff (struct work_stuff *work)
static char * mop_up (struct work_stuff *work, string *declp, int success)
static int demangle_signature (struct work_stuff *work, const char **mangled, string *declp)
static int demangle_template_template_parm (struct work_stuff *work, const char **mangled, string *tname)
static int demangle_expression (struct work_stuff *work, const char **mangled, string *s, type_kind_t tk)
static int demangle_integral_value (struct work_stuff *work, const char **mangled, string *s)
static int demangle_real_value (struct work_stuff *work, const char **mangled, string *s)
static int demangle_template_value_parm (struct work_stuff *work, const char **mangled, string *s, type_kind_t tk)
static int demangle_template (struct work_stuff *work, const char **mangled, string *tname, string *trawname, int is_type, int remember)
static int arm_pt (struct work_stuff *work, const char *mangled, int n, const char **anchor, const char **args)
static void demangle_arm_hp_template (struct work_stuff *work, const char **mangled, int n, string *declp)
static int demangle_class_name (struct work_stuff *work, const char **mangled, string *declp)
static int demangle_class (struct work_stuff *work, const char **mangled, string *declp)
static int iterate_demangle_function (struct work_stuff *work, const char **mangled, string *declp, const char *scan)
static int demangle_prefix (struct work_stuff *work, const char **mangled, string *declp)
static int gnu_special (struct work_stuff *work, const char **mangled, string *declp)
static void recursively_demangle (struct work_stuff *work, const char **mangled, string *result, int namelength)
static int arm_special (char **mangled, string *declp) const
static int demangle_qualified (struct work_stuff *work, const char **mangled, string *result, int isfuncname, int append)
static int get_count (char **type, int *count) const
static int do_type (struct work_stuff *work, const char **mangled, string *result)
static int demangle_fund_type (struct work_stuff *work, const char **mangled, string *result)
static int do_hpacc_template_const_value (work, const char **mangled, string *result)
static int do_hpacc_template_literal (struct work_stuff *work, const char **mangled, string *result)
static int snarf_numeric_literal (char **args, string *arg) const
static int do_arg (struct work_stuff *work, const char **mangled, string *result)
static void remember_type (struct work_stuff *work, const char *start, int len)
static void remember_Ktype (struct work_stuff *work, const char *start, int len)
static int register_Btype (struct work_stuff *work)
static void remember_Btype (struct work_stuff *work, const char *start, int len, int index)
static void forget_B_and_K_types (struct work_stuff *work)
static void forget_types (struct work_stuff *work)
static int demangle_args (struct work_stuff *work, const char **mangled, string *declp)
static int demangle_nested_args (struct work_stuff *work, const char **mangled, string *declp)
static void demangle_function_name (struct work_stuff *work, const char **mangled, string *declp, const char *scan)
static void string_need (string *s, int n)
static void string_delete (string *s)
static void string_init (string *s)
static void string_clear (string *s)
static void string_append (string *p, const char *s)
static void string_appends (string *p, string *s)
static void string_appendn (string *p, const char *s, int n)
static void string_prepend (string *p, const char *s)
static void string_prepends (string *p, string *s)
static void string_prependn (string *p, const char *s, int n)
static void string_append_template_idx (string *s, int idx)

Variables

static char char_str [2] = { '\000', '\000' }
struct demangler_engine libiberty_demanglers []


Define Documentation

#define APPEND_BLANK ( str   ) 

Value:

{if (!STRING_EMPTY(str)) \
    string_append(str, " ");}

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

Referenced by demangle_fund_type(), demangle_signature(), and do_type().

#define ARM_VTABLE_STRING   "__vtbl__"

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

Referenced by arm_special().

#define ARM_VTABLE_STRLEN   8

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

Referenced by arm_special().

#define CPLUS_MARKER   '$'

Referenced by fancy_abort(), and PARAMS().

#define CURRENT_DEMANGLING_STYLE   work->options

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

#define INTBUF_SIZE   32

#define LEN_STRING ( str   )     ( (STRING_EMPTY(str))?0:((str)->p - (str)->b))

#define min ( X,
 )     (((X) < (Y)) ? (X) : (Y))

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

#define PRINT_ANSI_QUALIFIERS   (work -> options & DMGL_ANSI)

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

Referenced by demangle_fund_type(), and do_type().

#define PRINT_ARG_TYPES   (work -> options & DMGL_PARAMS)

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

Referenced by demangle_args(), and demangle_signature().

#define SCOPE_STRING ( work   )     ((work->options & DMGL_JAVA) ? "." : "::")

#define STRING_EMPTY ( str   )     ((str) -> b == (str) -> p)

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

Referenced by demangle_fund_type(), demangle_qualified(), and do_type().

#define TYPE_QUAL_CONST   0x1

#define TYPE_QUAL_RESTRICT   0x4

#define TYPE_QUAL_VOLATILE   0x2

#define TYPE_UNQUALIFIED   0x0


Enumeration Type Documentation

Enumerator:
tk_none 
tk_pointer 
tk_reference 
tk_integral 
tk_bool 
tk_char 
tk_real 
tk_none 
tk_pointer 
tk_reference 
tk_integral 
tk_bool 
tk_char 
tk_real 
tk_none 
tk_pointer 
tk_reference 
tk_integral 
tk_bool 
tk_char 
tk_real 
tk_none 
tk_pointer 
tk_reference 
tk_integral 
tk_bool 
tk_char 
tk_real 

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


Function Documentation

static char* ada_demangle ( char *  mangled,
option   
) const [static]

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

References changed, grow_vect(), i, ISALPHA, ISDIGIT, ISUPPER, NULL, p, sprintf(), strcpy, strlen(), strncmp(), and strstr().

Referenced by cplus_demangle().

static int arm_pt ( struct work_stuff work,
const char *  mangled,
int  n,
const char **  anchor,
const char **  args 
) [static]

static int arm_special ( char **  mangled,
string declp 
) const [static]

static int code_for_qualifier ( int  c  )  [static]

static int consume_count ( char **  type  )  const [static]

static int consume_count_with_underscores ( char **  mangled  )  const [static]

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

enum demangling_styles cplus_demangle_name_to_style ( char *  name  )  const

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

enum demangling_styles cplus_demangle_set_style ( enum demangling_styles  style  ) 

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

Referenced by main(), and parse_args().

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

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

References ARRAY_SIZE, DMGL_ANSI, flags, i, in, len, memcmp, out, and strlen().

static void delete_non_B_K_work_stuff ( struct work_stuff work  )  [static]

static void delete_work_stuff ( struct work_stuff work  )  [static]

static int demangle_args ( struct work_stuff work,
const char **  mangled,
string declp 
) [static]

static void demangle_arm_hp_template ( struct work_stuff work,
const char **  mangled,
int  n,
string declp 
) [static]

static int demangle_class ( struct work_stuff work,
const char **  mangled,
string declp 
) [static]

static int demangle_class_name ( struct work_stuff work,
const char **  mangled,
string declp 
) [static]

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

References consume_count(), demangle_arm_hp_template(), n, and strlen().

Referenced by demangle_class(), and demangle_fund_type().

static int demangle_expression ( struct work_stuff work,
const char**  mangled,
string s,
type_kind_t  tk 
) [static]

static void demangle_function_name ( struct work_stuff work,
const char **  mangled,
string declp,
const char *  scan 
) [static]

static int demangle_fund_type ( struct work_stuff work,
const char **  mangled,
string result 
) [static]

static int demangle_integral_value ( struct work_stuff work,
const char**  mangled,
string s 
) [static]

static int demangle_nested_args ( struct work_stuff work,
const char **  mangled,
string declp 
) [static]

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

References demangle_args(), free(), result, and string_delete().

Referenced by do_type().

static int demangle_prefix ( struct work_stuff work,
const char **  mangled,
string declp 
) [static]

static int demangle_qualified ( struct work_stuff work,
const char **  mangled,
string result,
int  isfuncname,
int  append 
) [static]

static const char* demangle_qualifier ( int  c  )  [static]

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

References code_for_qualifier(), and qualifier_string().

Referenced by demangle_fund_type(), and do_type().

static int demangle_real_value ( struct work_stuff work,
const char **  mangled,
string s 
) [static]

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

References demangle_expression(), ISDIGIT, string_appendn(), and tk_real.

Referenced by demangle_template_value_parm().

static int demangle_signature ( struct work_stuff work,
const char **  mangled,
string declp 
) [static]

static int demangle_template ( struct work_stuff work,
const char **  mangled,
string tname,
string trawname,
int  is_type,
int  remember 
) [static]

static int demangle_template_template_parm ( struct work_stuff work,
const char **  mangled,
string tname 
) [static]

static int demangle_template_value_parm ( struct work_stuff work,
const char **  mangled,
string s,
type_kind_t  tk 
) [static]

static int do_arg ( struct work_stuff work,
const char **  mangled,
string result 
) [static]

static int do_hpacc_template_const_value ( work  ,
const char **  mangled,
string result 
) [static]

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

References ISDIGIT, and string_append().

Referenced by demangle_arm_hp_template().

static int do_hpacc_template_literal ( struct work_stuff work,
const char **  mangled,
string result 
) [static]

static int do_type ( struct work_stuff work,
const char **  mangled,
string result 
) [static]

static void forget_B_and_K_types ( struct work_stuff work  )  [static]

static void forget_types ( struct work_stuff work  )  [static]

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

References free(), i, work_stuff::ntypes, NULL, and work_stuff::typevec.

Referenced by delete_non_B_K_work_stuff(), and demangle_signature().

static int get_count ( char **  type,
int *  count 
) const [static]

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

References ISDIGIT, n, and p.

Referenced by demangle_args(), demangle_template(), demangle_template_template_parm(), and do_type().

static int gnu_special ( struct work_stuff work,
const char **  mangled,
string declp 
) [static]

static void grow_vect ( char **  old_vect,
size_t size,
size_t  min_size,
int  element_size 
) [static]

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

References xrealloc().

Referenced by ada_demangle().

static char* internal_cplus_demangle ( struct work_stuff work,
const char *  mangled 
) [static]

static int iterate_demangle_function ( struct work_stuff work,
const char **  mangled,
string declp,
const char *  scan 
) [static]

char* malloc (  ) 

static char* mop_up ( struct work_stuff work,
string declp,
int  success 
) [static]

static void grow_vect PARAMS ( (char **, size_t *, size_t, int)   )  [static]

static void recursively_demangle PARAMS ( (struct work_stuff *, const char **, string *, int)   )  [static]

static void demangle_arm_hp_template PARAMS ( (struct work_stuff *, const char **, int, string *)   )  [static]

static int code_for_qualifier PARAMS ( (int)   )  [static]

static int demangle_template_value_parm PARAMS ( (struct work_stuff *, const char **, string *, type_kind_t  )  [static]

static void remember_Btype PARAMS ( (struct work_stuff *, const char *, int, int)   )  [static]

static void remember_type PARAMS ( (struct work_stuff *, const char *, int)   )  [static]

static void demangle_function_name PARAMS ( (struct work_stuff *, const char **, string *, const char *)   )  [static]

static int consume_count PARAMS ( (const char **)   )  [static]

static int get_count PARAMS ( (const char **, int *)   )  [static]

static void string_appendn PARAMS ( (string *, const char *, int)   )  [static]

static void string_appends PARAMS ( (string *, string *)   )  [static]

static void string_append PARAMS ( (string *, const char *)   )  [static]

static void string_delete PARAMS ( (string *)   )  [static]

static void string_need PARAMS ( (string *, int)   )  [static]

static int arm_special PARAMS ( (const char **, string *)   )  [static]

static int demangle_qualified PARAMS ( (struct work_stuff *, const char **, string *, int, int)   )  [static]

static int demangle_class_name PARAMS ( (struct work_stuff *, const char **, string *)   )  [static]

static int arm_pt PARAMS ( (struct work_stuff *, const char *, int, const char **, const char **)   )  [static]

static int demangle_template PARAMS ( (struct work_stuff *work, const char **, string *, string *, int, int)   )  [static]

static int demangle_template_template_parm PARAMS ( (struct work_stuff *work, const char **, string *)   )  [static]

static char* internal_cplus_demangle PARAMS ( (struct work_stuff *, const char *)   )  [static]

static void work_stuff_copy_to_from PARAMS ( (struct work_stuff *, struct work_stuff *)   )  [static]

static char* mop_up PARAMS ( (struct work_stuff *, string *, int)   )  [static]

static void delete_work_stuff PARAMS ( (struct work_stuff *)   )  [static]

void fancy_abort PARAMS ( (void  )  [read]

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

static char* ada_demangle PARAMS ( (const char *, int)   )  [static]

static const char* qualifier_string ( int  type_quals  )  [static]

char* realloc (  ) 

static void recursively_demangle ( struct work_stuff work,
const char **  mangled,
string result,
int  namelength 
) [static]

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

References cplus_demangle(), free(), memcpy, NULL, string_append(), string_appendn(), and xmalloc().

Referenced by demangle_qualified().

static int register_Btype ( struct work_stuff work  )  [static]

static void remember_Btype ( struct work_stuff work,
const char *  start,
int  len,
int  index 
) [static]

static void remember_Ktype ( struct work_stuff work,
const char *  start,
int  len 
) [static]

static void remember_type ( struct work_stuff work,
const char *  start,
int  len 
) [static]

void set_cplus_marker_for_demangling ( int  ch  ) 

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

static int snarf_numeric_literal ( char **  args,
string arg 
) const [static]

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

References ISDIGIT, and string_append().

Referenced by demangle_arm_hp_template().

static void squangle_mop_up ( struct work_stuff work  )  [static]

static void string_append ( string p,
const char *  s 
) [static]

static void string_append_template_idx ( string s,
int  idx 
) [static]

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

References buf, INTBUF_SIZE, sprintf(), and string_append().

Referenced by demangle_template(), demangle_template_value_parm(), and do_type().

static void string_appendn ( string p,
const char *  s,
int  n 
) [static]

static void string_appends ( string p,
string s 
) [static]

static void string_clear ( string s  )  [static]

static void string_delete ( string s  )  [static]

static void string_init ( string s  )  [static]

static void string_need ( string s,
int  n 
) [static]

static void string_prepend ( string p,
const char *  s 
) [static]

static void string_prependn ( string p,
const char *  s,
int  n 
) [static]

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

References memcpy, q, and string_need().

Referenced by arm_special(), do_type(), string_prepend(), and string_prepends().

static void string_prepends ( string p,
string s 
) [static]

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

References string_prependn().

Referenced by demangle_class(), demangle_qualified(), demangle_signature(), and do_type().

static void work_stuff_copy_to_from ( struct work_stuff to,
struct work_stuff from 
) [static]


Variable Documentation

char char_str[2] = { '\000', '\000' } [static]

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

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


Generated on Wed Apr 8 15:02:39 2009 for Open64 by  doxygen 1.5.6