Rizin
unix-like reverse engineering framework and cli tools
demangle.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 1992-2018 Free Software Foundation, Inc.
2 // SPDX-License-Identifier: LGPL-2.0-or-later
3 
4 /* Defs for interface to demanglers.
5  Copyright (C) 1992-2018 Free Software Foundation, Inc.
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public License
9  as published by the Free Software Foundation; either version 2, or
10  (at your option) any later version.
11 
12  In addition to the permissions in the GNU Library General Public
13  License, the Free Software Foundation gives you unlimited
14  permission to link the compiled version of this file into
15  combinations with other programs, and to distribute those
16  combinations without any restriction coming from the use of this
17  file. (The Library Public License restrictions do apply in other
18  respects; for example, they cover modification of the file, and
19  distribution when not linked into a combined executable.)
20 
21  This program is distributed in the hope that it will be useful, but
22  WITHOUT ANY WARRANTY; without even the implied warranty of
23  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24  Library General Public License for more details.
25 
26  You should have received a copy of the GNU Library General Public
27  License along with this program; if not, write to the Free Software
28  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
29  02110-1301, USA. */
30 
31 #if !defined(DEMANGLE_H)
32 #define DEMANGLE_H
33 
34 #include "libiberty.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif /* __cplusplus */
39 
40 /* Options passed to cplus_demangle (in 2nd parameter). */
41 
42 #define DMGL_NO_OPTS 0 /* For readability... */
43 #define DMGL_PARAMS (1 << 0) /* Include function args */
44 #define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
45 #define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */
46 #define DMGL_VERBOSE (1 << 3) /* Include implementation details. */
47 #define DMGL_TYPES (1 << 4) /* Also try to demangle type encodings. */
48 #define DMGL_RET_POSTFIX (1 << 5) /* Print function return types (when \
49  present) after function signature. \
50  It applies only to the toplevel \
51  function type. */
52 #define DMGL_RET_DROP (1 << 6) /* Suppress printing function return \
53  types, even if present. It applies \
54  only to the toplevel function type. \
55  */
56 
57 #define DMGL_AUTO (1 << 8)
58 #define DMGL_GNU (1 << 9)
59 #define DMGL_LUCID (1 << 10)
60 #define DMGL_ARM (1 << 11)
61 #define DMGL_HP (1 << 12) /* For the HP aCC compiler; \
62  same as ARM except for \
63  template arguments, etc. */
64 #define DMGL_EDG (1 << 13)
65 #define DMGL_GNU_V3 (1 << 14)
66 #define DMGL_GNAT (1 << 15)
67 #define DMGL_DLANG (1 << 16)
68 #define DMGL_RUST (1 << 17) /* Rust wraps GNU_V3 style mangling. */
69 
70 /* If none of these are set, use 'current_demangling_style' as the default. */
71 #define DMGL_STYLE_MASK (DMGL_AUTO | DMGL_GNU | DMGL_LUCID | DMGL_ARM | DMGL_HP | DMGL_EDG | DMGL_GNU_V3 | DMGL_JAVA | DMGL_GNAT | DMGL_DLANG | DMGL_RUST)
72 
73 /* Enumeration of possible demangling styles.
74 
75  Lucid and ARM styles are still kept logically distinct, even though
76  they now both behave identically. The resulting style is actual the
77  union of both. I.E. either style recognizes both "__pt__" and "__rf__"
78  for operator "->", even though the first is lucid style and the second
79  is ARM style. (FIXME?) */
80 
81 extern enum demangling_styles {
96 
97 /* Define string names for the various demangling styles. */
98 
99 #define NO_DEMANGLING_STYLE_STRING "none"
100 #define AUTO_DEMANGLING_STYLE_STRING "auto"
101 #define GNU_DEMANGLING_STYLE_STRING "gnu"
102 #define LUCID_DEMANGLING_STYLE_STRING "lucid"
103 #define ARM_DEMANGLING_STYLE_STRING "arm"
104 #define HP_DEMANGLING_STYLE_STRING "hp"
105 #define EDG_DEMANGLING_STYLE_STRING "edg"
106 #define GNU_V3_DEMANGLING_STYLE_STRING "gnu-v3"
107 #define JAVA_DEMANGLING_STYLE_STRING "java"
108 #define GNAT_DEMANGLING_STYLE_STRING "gnat"
109 #define DLANG_DEMANGLING_STYLE_STRING "dlang"
110 #define RUST_DEMANGLING_STYLE_STRING "rust"
111 
112 /* Some macros to test what demangling style is active. */
113 
114 #define CURRENT_DEMANGLING_STYLE current_demangling_style
115 #define AUTO_DEMANGLING (((int)CURRENT_DEMANGLING_STYLE) & DMGL_AUTO)
116 #define GNU_DEMANGLING (((int)CURRENT_DEMANGLING_STYLE) & DMGL_GNU)
117 #define LUCID_DEMANGLING (((int)CURRENT_DEMANGLING_STYLE) & DMGL_LUCID)
118 #define ARM_DEMANGLING (((int)CURRENT_DEMANGLING_STYLE) & DMGL_ARM)
119 #define HP_DEMANGLING (((int)CURRENT_DEMANGLING_STYLE) & DMGL_HP)
120 #define EDG_DEMANGLING (((int)CURRENT_DEMANGLING_STYLE) & DMGL_EDG)
121 #define GNU_V3_DEMANGLING (((int)CURRENT_DEMANGLING_STYLE) & DMGL_GNU_V3)
122 #define JAVA_DEMANGLING (((int)CURRENT_DEMANGLING_STYLE) & DMGL_JAVA)
123 #define GNAT_DEMANGLING (((int)CURRENT_DEMANGLING_STYLE) & DMGL_GNAT)
124 #define DLANG_DEMANGLING (((int)CURRENT_DEMANGLING_STYLE) & DMGL_DLANG)
125 #define RUST_DEMANGLING (((int)CURRENT_DEMANGLING_STYLE) & DMGL_RUST)
126 
127 /* Provide information about the available demangle styles. This code is
128  pulled from gdb into libiberty because it is useful to binutils also. */
129 
130 extern const struct demangler_engine {
131  const char *const demangling_style_name;
133  const char *const demangling_style_doc;
135 
136 extern char *
137 cplus_demangle(const char *mangled, int options);
138 
139 extern int
140 cplus_demangle_opname(const char *opname, char *result, int options);
141 
142 extern const char *
143 cplus_mangle_opname(const char *opname, int options);
144 
145 /* Note: This sets global state. FIXME if you care about multi-threading. */
146 
147 extern void
149 
150 extern enum demangling_styles
152 
153 extern enum demangling_styles
155 
156 /* Callback typedef for allocation-less demangler interfaces. */
157 typedef void (*demangle_callbackref)(const char *, size_t, void *);
158 
159 /* V3 ABI demangling entry points, defined in cp-demangle.c. Callback
160  variants return non-zero on success, zero on error. char* variants
161  return a string allocated by malloc on success, NULL on error. */
162 extern int
163 cplus_demangle_v3_callback(const char *mangled, int options,
164  demangle_callbackref callback, void *opaque);
165 
166 extern char *
167 cplus_demangle_v3(const char *mangled, int options);
168 
169 extern int
170 java_demangle_v3_callback(const char *mangled,
171  demangle_callbackref callback, void *opaque);
172 
173 extern char *
174 java_demangle_v3(const char *mangled);
175 
176 char *
177 ada_demangle(const char *mangled, int options);
178 
179 extern char *
180 dlang_demangle(const char *mangled, int options);
181 
182 /* Returns non-zero iff MANGLED is a rust mangled symbol. MANGLED must
183  already have been demangled through cplus_demangle_v3. If this function
184  returns non-zero then MANGLED can be demangled (in-place) using
185  RUST_DEMANGLE_SYM. */
186 extern int
187 rust_is_mangled(const char *mangled);
188 
189 /* Demangles SYM (in-place) if RUST_IS_MANGLED returned non-zero for SYM.
190  If RUST_IS_MANGLED returned zero for SYM then RUST_DEMANGLE_SYM might
191  replace characters that cannot be demangled with '?' and might truncate
192  SYM. After calling RUST_DEMANGLE_SYM SYM might be shorter, but never
193  larger. */
194 extern void
195 rust_demangle_sym(char *sym);
196 
197 /* Demangles MANGLED if it was GNU_V3 and then RUST mangled, otherwise
198  returns NULL. Uses CPLUS_DEMANGLE_V3, RUST_IS_MANGLED and
199  RUST_DEMANGLE_SYM. Returns a new string that is owned by the caller. */
200 extern char *
201 rust_demangle(const char *mangled, int options);
202 
203 enum gnu_v3_ctor_kinds {
207  /* These are not part of the V3 ABI. Unified constructors are generated
208  as a speed-for-space optimization when the -fdeclone-ctor-dtor option
209  is used, and are always internal symbols. */
212 };
213 
214 /* Return non-zero iff NAME is the mangled form of a constructor name
215  in the G++ V3 ABI demangling style. Specifically, return an `enum
216  gnu_v3_ctor_kinds' value indicating what kind of constructor
217  it is. */
218 extern enum gnu_v3_ctor_kinds
219 is_gnu_v3_mangled_ctor(const char *name);
220 
221 enum gnu_v3_dtor_kinds {
225  /* These are not part of the V3 ABI. Unified destructors are generated
226  as a speed-for-space optimization when the -fdeclone-ctor-dtor option
227  is used, and are always internal symbols. */
230 };
231 
232 /* Return non-zero iff NAME is the mangled form of a destructor name
233  in the G++ V3 ABI demangling style. Specifically, return an `enum
234  gnu_v3_dtor_kinds' value, indicating what kind of destructor
235  it is. */
236 extern enum gnu_v3_dtor_kinds
237 is_gnu_v3_mangled_dtor(const char *name);
238 
239 /* The V3 demangler works in two passes. The first pass builds a tree
240  representation of the mangled name, and the second pass turns the
241  tree representation into a demangled string. Here we define an
242  interface to permit a caller to build their own tree
243  representation, which they can pass to the demangler to get a
244  demangled string. This can be used to canonicalize user input into
245  something which the demangler might output. It could also be used
246  by other demanglers in the future. */
247 
248 /* These are the component types which may be found in the tree. Many
249  component types have one or two subtrees, referred to as left and
250  right (a component type with only one subtree puts it in the left
251  subtree). */
252 
254  /* A name, with a length and a pointer to a string. */
256  /* A qualified name. The left subtree is a class or namespace or
257  some such thing, and the right subtree is a name qualified by
258  that class. */
260  /* A local name. The left subtree describes a function, and the
261  right subtree is a name which is local to that function. */
263  /* A typed name. The left subtree is a name, and the right subtree
264  describes that name as a function. */
266  /* A template. The left subtree is a template name, and the right
267  subtree is a template argument list. */
269  /* A template parameter. This holds a number, which is the template
270  parameter index. */
272  /* A function parameter. This holds a number, which is the index. */
274  /* A constructor. This holds a name and the kind of
275  constructor. */
277  /* A destructor. This holds a name and the kind of destructor. */
279  /* A vtable. This has one subtree, the type for which this is a
280  vtable. */
282  /* A VTT structure. This has one subtree, the type for which this
283  is a VTT. */
285  /* A construction vtable. The left subtree is the type for which
286  this is a vtable, and the right subtree is the derived type for
287  which this vtable is built. */
289  /* A typeinfo structure. This has one subtree, the type for which
290  this is the tpeinfo structure. */
292  /* A typeinfo name. This has one subtree, the type for which this
293  is the typeinfo name. */
295  /* A typeinfo function. This has one subtree, the type for which
296  this is the tpyeinfo function. */
298  /* A thunk. This has one subtree, the name for which this is a
299  thunk. */
301  /* A virtual thunk. This has one subtree, the name for which this
302  is a virtual thunk. */
304  /* A covariant thunk. This has one subtree, the name for which this
305  is a covariant thunk. */
307  /* A Java class. This has one subtree, the type. */
309  /* A guard variable. This has one subtree, the name for which this
310  is a guard variable. */
312  /* The init and wrapper functions for C++11 thread_local variables. */
315  /* A reference temporary. This has one subtree, the name for which
316  this is a temporary. */
318  /* A hidden alias. This has one subtree, the encoding for which it
319  is providing alternative linkage. */
321  /* A standard substitution. This holds the name of the
322  substitution. */
324  /* The restrict qualifier. The one subtree is the type which is
325  being qualified. */
327  /* The volatile qualifier. The one subtree is the type which is
328  being qualified. */
330  /* The const qualifier. The one subtree is the type which is being
331  qualified. */
333  /* The restrict qualifier modifying a member function. The one
334  subtree is the type which is being qualified. */
336  /* The volatile qualifier modifying a member function. The one
337  subtree is the type which is being qualified. */
339  /* The const qualifier modifying a member function. The one subtree
340  is the type which is being qualified. */
342  /* C++11 A reference modifying a member function. The one subtree is the
343  type which is being referenced. */
345  /* C++11: An rvalue reference modifying a member function. The one
346  subtree is the type which is being referenced. */
348  /* A vendor qualifier. The left subtree is the type which is being
349  qualified, and the right subtree is the name of the
350  qualifier. */
352  /* A pointer. The one subtree is the type which is being pointed
353  to. */
355  /* A reference. The one subtree is the type which is being
356  referenced. */
358  /* C++0x: An rvalue reference. The one subtree is the type which is
359  being referenced. */
361  /* A complex type. The one subtree is the base type. */
363  /* An imaginary type. The one subtree is the base type. */
365  /* A builtin type. This holds the builtin type information. */
367  /* A vendor's builtin type. This holds the name of the type. */
369  /* A function type. The left subtree is the return type. The right
370  subtree is a list of ARGLIST nodes. Either or both may be
371  NULL. */
373  /* An array type. The left subtree is the dimension, which may be
374  NULL, or a string (represented as DEMANGLE_COMPONENT_NAME), or an
375  expression. The right subtree is the element type. */
377  /* A pointer to member type. The left subtree is the class type,
378  and the right subtree is the member type. CV-qualifiers appear
379  on the latter. */
381  /* A fixed-point type. */
383  /* A vector type. The left subtree is the number of elements,
384  the right subtree is the element type. */
386  /* An argument list. The left subtree is the current argument, and
387  the right subtree is either NULL or another ARGLIST node. */
389  /* A template argument list. The left subtree is the current
390  template argument, and the right subtree is either NULL or
391  another TEMPLATE_ARGLIST node. */
393  /* A template parameter object (C++20). The left subtree is the
394  corresponding template argument. */
396  /* An initializer list. The left subtree is either an explicit type or
397  NULL, and the right subtree is a DEMANGLE_COMPONENT_ARGLIST. */
399  /* An operator. This holds information about a standard
400  operator. */
402  /* An extended operator. This holds the number of arguments, and
403  the name of the extended operator. */
405  /* A typecast, represented as a unary operator. The one subtree is
406  the type to which the argument should be cast. */
408  /* A conversion operator, represented as a unary operator. The one
409  subtree is the type to which the argument should be converted
410  to. */
412  /* A nullary expression. The left subtree is the operator. */
414  /* A unary expression. The left subtree is the operator, and the
415  right subtree is the single argument. */
417  /* A binary expression. The left subtree is the operator, and the
418  right subtree is a BINARY_ARGS. */
420  /* Arguments to a binary expression. The left subtree is the first
421  argument, and the right subtree is the second argument. */
423  /* A trinary expression. The left subtree is the operator, and the
424  right subtree is a TRINARY_ARG1. */
426  /* Arguments to a trinary expression. The left subtree is the first
427  argument, and the right subtree is a TRINARY_ARG2. */
429  /* More arguments to a trinary expression. The left subtree is the
430  second argument, and the right subtree is the third argument. */
432  /* A literal. The left subtree is the type, and the right subtree
433  is the value, represented as a DEMANGLE_COMPONENT_NAME. */
435  /* A negative literal. Like LITERAL, but the value is negated.
436  This is a minor hack: the NAME used for LITERAL points directly
437  to the mangled string, but since negative numbers are mangled
438  using 'n' instead of '-', we want a way to indicate a negative
439  number which involves neither modifying the mangled string nor
440  allocating a new copy of the literal in memory. */
442  /* A libgcj compiled resource. The left subtree is the name of the
443  resource. */
445  /* A name formed by the concatenation of two parts. The left
446  subtree is the first part and the right subtree the second. */
448  /* A name formed by a single character. */
450  /* A number. */
452  /* A decltype type. */
454  /* Global constructors keyed to name. */
456  /* Global destructors keyed to name. */
458  /* A lambda closure type. */
460  /* A default argument scope. */
462  /* An unnamed type. */
464  /* A transactional clone. This has one subtree, the encoding for
465  which it is providing alternative linkage. */
467  /* A non-transactional clone entry point. In the i386/x86_64 abi,
468  the unmangled symbol of a tm_callable becomes a thunk and the
469  non-transactional function version is mangled thus. */
471  /* A pack expansion. */
473  /* A name with an ABI tag. */
475  /* A transaction-safe function type. */
477  /* A cloned function. */
481 };
482 
483 /* Types which are only used internally. */
484 
487 
488 /* A node in the tree representation is an instance of a struct
489  demangle_component. Note that the field names of the struct are
490  not well protected against macros defined by the file including
491  this one. We can fix this if it ever becomes a problem. */
492 
493 struct demangle_component {
494  /* The type of this component. */
496 
497  /* Guard against recursive component printing.
498  Initialize to zero. Private to d_print_comp.
499  All other fields are final after initialization. */
501 
502  union {
503  /* For DEMANGLE_COMPONENT_NAME. */
504  struct
505  {
506  /* A pointer to the name (which need not NULL terminated) and
507  its length. */
508  const char *s;
509  int len;
510  } s_name;
511 
512  /* For DEMANGLE_COMPONENT_OPERATOR. */
513  struct
514  {
515  /* Operator. */
516  const struct demangle_operator_info *op;
518 
519  /* For DEMANGLE_COMPONENT_EXTENDED_OPERATOR. */
520  struct
521  {
522  /* Number of arguments. */
523  int args;
524  /* Name. */
525  struct demangle_component *name;
527 
528  /* For DEMANGLE_COMPONENT_FIXED_TYPE. */
529  struct
530  {
531  /* The length, indicated by a C integer type name. */
532  struct demangle_component *length;
533  /* _Accum or _Fract? */
534  short accum;
535  /* Saturating or not? */
536  short sat;
538 
539  /* For DEMANGLE_COMPONENT_CTOR. */
540  struct
541  {
542  /* Kind of constructor. */
543  enum gnu_v3_ctor_kinds kind;
544  /* Name. */
545  struct demangle_component *name;
546  } s_ctor;
547 
548  /* For DEMANGLE_COMPONENT_DTOR. */
549  struct
550  {
551  /* Kind of destructor. */
552  enum gnu_v3_dtor_kinds kind;
553  /* Name. */
555  } s_dtor;
556 
557  /* For DEMANGLE_COMPONENT_BUILTIN_TYPE. */
558  struct
559  {
560  /* Builtin type. */
561  const struct demangle_builtin_type_info *type;
562  } s_builtin;
563 
564  /* For DEMANGLE_COMPONENT_SUB_STD. */
565  struct
566  {
567  /* Standard substitution string. */
568  const char *string;
569  /* Length of string. */
570  int len;
571  } s_string;
572 
573  /* For DEMANGLE_COMPONENT_*_PARAM. */
574  struct
575  {
576  /* Parameter index. */
577  long number;
578  } s_number;
579 
580  /* For DEMANGLE_COMPONENT_CHARACTER. */
581  struct
582  {
583  int character;
585 
586  /* For other types. */
587  struct
588  {
589  /* Left (or only) subtree. */
591  /* Right subtree. */
594 
595  struct
596  {
597  /* subtree, same place as d_left. */
598  struct demangle_component *sub;
599  /* integer. */
600  int num;
601  } s_unary_num;
602 
603  } u;
604 };
605 
606 /* People building mangled trees are expected to allocate instances of
607  struct demangle_component themselves. They can then call one of
608  the following functions to fill them in. */
609 
610 /* Fill in most component types with a left subtree and a right
611  subtree. Returns non-zero on success, zero on failure, such as an
612  unrecognized or inappropriate component type. */
613 
614 extern int
617  struct demangle_component *left,
618  struct demangle_component *right);
619 
620 /* Fill in a DEMANGLE_COMPONENT_NAME. Returns non-zero on success,
621  zero for bad arguments. */
622 
623 extern int
625  const char *, int);
626 
627 /* Fill in a DEMANGLE_COMPONENT_BUILTIN_TYPE, using the name of the
628  builtin type (e.g., "int", etc.). Returns non-zero on success,
629  zero if the type is not recognized. */
630 
631 extern int
633  const char *type_name);
634 
635 /* Fill in a DEMANGLE_COMPONENT_OPERATOR, using the name of the
636  operator and the number of arguments which it takes (the latter is
637  used to disambiguate operators which can be both binary and unary,
638  such as '-'). Returns non-zero on success, zero if the operator is
639  not recognized. */
640 
641 extern int
643  const char *opname, int args);
644 
645 /* Fill in a DEMANGLE_COMPONENT_EXTENDED_OPERATOR, providing the
646  number of arguments and the name. Returns non-zero on success,
647  zero for bad arguments. */
648 
649 extern int
651  int numargs,
652  struct demangle_component *nm);
653 
654 /* Fill in a DEMANGLE_COMPONENT_CTOR. Returns non-zero on success,
655  zero for bad arguments. */
656 
657 extern int
659  enum gnu_v3_ctor_kinds kind,
660  struct demangle_component *name);
661 
662 /* Fill in a DEMANGLE_COMPONENT_DTOR. Returns non-zero on success,
663  zero for bad arguments. */
664 
665 extern int
667  enum gnu_v3_dtor_kinds kind,
668  struct demangle_component *name);
669 
670 /* This function translates a mangled name into a struct
671  demangle_component tree. The first argument is the mangled name.
672  The second argument is DMGL_* options. This returns a pointer to a
673  tree on success, or NULL on failure. On success, the third
674  argument is set to a block of memory allocated by malloc. This
675  block should be passed to free when the tree is no longer
676  needed. */
677 
678 extern struct demangle_component *
679 cplus_demangle_v3_components(const char *mangled, int options, void **mem);
680 
681 /* This function takes a struct demangle_component tree and returns
682  the corresponding demangled string. The first argument is DMGL_*
683  options. The second is the tree to demangle. The third is a guess
684  at the length of the demangled string, used to initially allocate
685  the return buffer. The fourth is a pointer to a size_t. On
686  success, this function returns a buffer allocated by malloc(), and
687  sets the size_t pointed to by the fourth argument to the size of
688  the allocated buffer (not the length of the returned string). On
689  failure, this function returns NULL, and sets the size_t pointed to
690  by the fourth argument to 0 for an invalid tree, or to 1 for a
691  memory allocation error. */
692 
693 extern char *
695  struct demangle_component *tree,
696  int estimated_length,
697  size_t *p_allocated_size);
698 
699 /* This function takes a struct demangle_component tree and passes back
700  a demangled string in one or more calls to a callback function.
701  The first argument is DMGL_* options. The second is the tree to
702  demangle. The third is a pointer to a callback function; on each call
703  this receives an element of the demangled string, its length, and an
704  opaque value. The fourth is the opaque value passed to the callback.
705  The callback is called once or more to return the full demangled
706  string. The demangled element string is always nul-terminated, though
707  its length is also provided for convenience. In contrast to
708  cplus_demangle_print(), this function does not allocate heap memory
709  to grow output strings (except perhaps where alloca() is implemented
710  by malloc()), and so is normally safe for use where the heap has been
711  corrupted. On success, this function returns 1; on failure, 0. */
712 
713 extern int
715  struct demangle_component *tree,
716  demangle_callbackref callback, void *opaque);
717 
718 #ifdef __cplusplus
719 }
720 #endif /* __cplusplus */
721 
722 #endif /* DEMANGLE_H */
gnu_v3_ctor_kinds
Definition: demangle.h:195
@ gnu_v3_complete_object_ctor
Definition: demangle.h:196
@ gnu_v3_complete_object_allocating_ctor
Definition: demangle.h:198
@ gnu_v3_object_ctor_group
Definition: demangle.h:203
@ gnu_v3_unified_ctor
Definition: demangle.h:202
@ gnu_v3_base_object_ctor
Definition: demangle.h:197
const char * cplus_mangle_opname(const char *opname, int options)
char * java_demangle_v3(const char *mangled)
Definition: cp-demangle.c:5960
int cplus_demangle_fill_dtor(struct demangle_component *fill, enum gnu_v3_dtor_kinds kind, struct demangle_component *name)
Definition: cp-demangle.c:886
enum demangling_styles current_demangling_style
enum demangling_styles cplus_demangle_set_style(enum demangling_styles style)
gnu_v3_dtor_kinds
Definition: demangle.h:213
@ gnu_v3_object_dtor_group
Definition: demangle.h:221
@ gnu_v3_unified_dtor
Definition: demangle.h:220
@ gnu_v3_base_object_dtor
Definition: demangle.h:216
@ gnu_v3_complete_object_dtor
Definition: demangle.h:215
@ gnu_v3_deleting_dtor
Definition: demangle.h:214
char * cplus_demangle_v3(const char *mangled, int options)
Definition: cp-demangle.c:5942
int cplus_demangle_v3_callback(const char *mangled, int options, demangle_callbackref callback, void *opaque)
Definition: cp-demangle.c:5948
void set_cplus_marker_for_demangling(int ch)
int cplus_demangle_opname(const char *opname, char *result, int options)
void rust_demangle_sym(char *sym)
char * ada_demangle(const char *mangled, int options)
int cplus_demangle_print_callback(int options, struct demangle_component *tree, demangle_callbackref callback, void *opaque)
Definition: cp-demangle.c:3967
enum demangling_styles cplus_demangle_name_to_style(const char *name)
int cplus_demangle_fill_ctor(struct demangle_component *fill, enum gnu_v3_ctor_kinds kind, struct demangle_component *name)
Definition: cp-demangle.c:871
char * rust_demangle(const char *mangled, int options)
#define DMGL_DLANG
Definition: demangle.h:59
struct demangle_component * cplus_demangle_v3_components(const char *mangled, int options, void **mem)
char * cplus_demangle(const char *mangled, int options)
const struct demangler_engine libiberty_demanglers[]
enum gnu_v3_dtor_kinds is_gnu_v3_mangled_dtor(const char *name)
Definition: cp-demangle.c:6065
demangle_component_type
Definition: demangle.h:245
@ DEMANGLE_COMPONENT_UNNAMED_TYPE
Definition: demangle.h:455
@ DEMANGLE_COMPONENT_CTOR
Definition: demangle.h:268
@ DEMANGLE_COMPONENT_TLS_WRAPPER
Definition: demangle.h:306
@ DEMANGLE_COMPONENT_CONST
Definition: demangle.h:324
@ DEMANGLE_COMPONENT_VIRTUAL_THUNK
Definition: demangle.h:295
@ DEMANGLE_COMPONENT_TRINARY_ARG1
Definition: demangle.h:420
@ DEMANGLE_COMPONENT_REFERENCE_THIS
Definition: demangle.h:336
@ DEMANGLE_COMPONENT_TRANSACTION_CLONE
Definition: demangle.h:458
@ DEMANGLE_COMPONENT_LITERAL
Definition: demangle.h:426
@ DEMANGLE_COMPONENT_DTOR
Definition: demangle.h:270
@ DEMANGLE_COMPONENT_ARGLIST
Definition: demangle.h:380
@ DEMANGLE_COMPONENT_RESTRICT_THIS
Definition: demangle.h:327
@ DEMANGLE_COMPONENT_CONVERSION
Definition: demangle.h:403
@ DEMANGLE_COMPONENT_TRINARY
Definition: demangle.h:417
@ DEMANGLE_COMPONENT_EXTENDED_OPERATOR
Definition: demangle.h:396
@ DEMANGLE_COMPONENT_PACK_EXPANSION
Definition: demangle.h:464
@ DEMANGLE_COMPONENT_REFERENCE
Definition: demangle.h:349
@ DEMANGLE_COMPONENT_TPARM_OBJ
Definition: demangle.h:387
@ DEMANGLE_COMPONENT_TEMPLATE_PARAM
Definition: demangle.h:263
@ DEMANGLE_COMPONENT_SUB_STD
Definition: demangle.h:315
@ DEMANGLE_COMPONENT_COMPLEX
Definition: demangle.h:354
@ DEMANGLE_COMPONENT_TYPEINFO_FN
Definition: demangle.h:289
@ DEMANGLE_COMPONENT_NONTRANSACTION_CLONE
Definition: demangle.h:462
@ DEMANGLE_COMPONENT_NAME
Definition: demangle.h:247
@ DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE
Definition: demangle.h:280
@ DEMANGLE_COMPONENT_QUAL_NAME
Definition: demangle.h:251
@ DEMANGLE_COMPONENT_REFTEMP
Definition: demangle.h:309
@ DEMANGLE_COMPONENT_TRANSACTION_SAFE
Definition: demangle.h:468
@ DEMANGLE_COMPONENT_BUILTIN_TYPE
Definition: demangle.h:358
@ DEMANGLE_COMPONENT_NULLARY
Definition: demangle.h:405
@ DEMANGLE_COMPONENT_POINTER
Definition: demangle.h:346
@ DEMANGLE_COMPONENT_GLOBAL_DESTRUCTORS
Definition: demangle.h:449
@ DEMANGLE_COMPONENT_DEFAULT_ARG
Definition: demangle.h:453
@ DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS
Definition: demangle.h:339
@ DEMANGLE_COMPONENT_INITIALIZER_LIST
Definition: demangle.h:390
@ DEMANGLE_COMPONENT_TAGGED_NAME
Definition: demangle.h:466
@ DEMANGLE_COMPONENT_PTRMEM_TYPE
Definition: demangle.h:372
@ DEMANGLE_COMPONENT_HIDDEN_ALIAS
Definition: demangle.h:312
@ DEMANGLE_COMPONENT_LOCAL_NAME
Definition: demangle.h:254
@ DEMANGLE_COMPONENT_NUMBER
Definition: demangle.h:443
@ DEMANGLE_COMPONENT_FUNCTION_TYPE
Definition: demangle.h:364
@ DEMANGLE_COMPONENT_VENDOR_TYPE
Definition: demangle.h:360
@ DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL
Definition: demangle.h:343
@ DEMANGLE_COMPONENT_TEMPLATE_ARGLIST
Definition: demangle.h:384
@ DEMANGLE_COMPONENT_RESTRICT
Definition: demangle.h:318
@ DEMANGLE_COMPONENT_THROW_SPEC
Definition: demangle.h:472
@ DEMANGLE_COMPONENT_LITERAL_NEG
Definition: demangle.h:433
@ DEMANGLE_COMPONENT_VOLATILE_THIS
Definition: demangle.h:330
@ DEMANGLE_COMPONENT_TRINARY_ARG2
Definition: demangle.h:423
@ DEMANGLE_COMPONENT_CAST
Definition: demangle.h:399
@ DEMANGLE_COMPONENT_JAVA_CLASS
Definition: demangle.h:300
@ DEMANGLE_COMPONENT_RVALUE_REFERENCE
Definition: demangle.h:352
@ DEMANGLE_COMPONENT_GUARD
Definition: demangle.h:303
@ DEMANGLE_COMPONENT_ARRAY_TYPE
Definition: demangle.h:368
@ DEMANGLE_COMPONENT_BINARY_ARGS
Definition: demangle.h:414
@ DEMANGLE_COMPONENT_LAMBDA
Definition: demangle.h:451
@ DEMANGLE_COMPONENT_TLS_INIT
Definition: demangle.h:305
@ DEMANGLE_COMPONENT_COVARIANT_THUNK
Definition: demangle.h:298
@ DEMANGLE_COMPONENT_THUNK
Definition: demangle.h:292
@ DEMANGLE_COMPONENT_CONST_THIS
Definition: demangle.h:333
@ DEMANGLE_COMPONENT_NOEXCEPT
Definition: demangle.h:471
@ DEMANGLE_COMPONENT_DECLTYPE
Definition: demangle.h:445
@ DEMANGLE_COMPONENT_UNARY
Definition: demangle.h:408
@ DEMANGLE_COMPONENT_VECTOR_TYPE
Definition: demangle.h:377
@ DEMANGLE_COMPONENT_COMPOUND_NAME
Definition: demangle.h:439
@ DEMANGLE_COMPONENT_VOLATILE
Definition: demangle.h:321
@ DEMANGLE_COMPONENT_TYPED_NAME
Definition: demangle.h:257
@ DEMANGLE_COMPONENT_CHARACTER
Definition: demangle.h:441
@ DEMANGLE_COMPONENT_OPERATOR
Definition: demangle.h:393
@ DEMANGLE_COMPONENT_TYPEINFO_NAME
Definition: demangle.h:286
@ DEMANGLE_COMPONENT_VTT
Definition: demangle.h:276
@ DEMANGLE_COMPONENT_GLOBAL_CONSTRUCTORS
Definition: demangle.h:447
@ DEMANGLE_COMPONENT_CLONE
Definition: demangle.h:470
@ DEMANGLE_COMPONENT_IMAGINARY
Definition: demangle.h:356
@ DEMANGLE_COMPONENT_JAVA_RESOURCE
Definition: demangle.h:436
@ DEMANGLE_COMPONENT_TEMPLATE
Definition: demangle.h:260
@ DEMANGLE_COMPONENT_VTABLE
Definition: demangle.h:273
@ DEMANGLE_COMPONENT_TYPEINFO
Definition: demangle.h:283
@ DEMANGLE_COMPONENT_FUNCTION_PARAM
Definition: demangle.h:265
@ DEMANGLE_COMPONENT_FIXED_TYPE
Definition: demangle.h:374
@ DEMANGLE_COMPONENT_BINARY
Definition: demangle.h:411
char * cplus_demangle_print(int options, struct demangle_component *tree, int estimated_length, size_t *p_allocated_size)
Definition: cp-demangle.c:4010
#define DMGL_GNU_V3
Definition: demangle.h:57
#define DMGL_ARM
Definition: demangle.h:54
int rust_is_mangled(const char *mangled)
#define DMGL_HP
Definition: demangle.h:55
#define DMGL_GNAT
Definition: demangle.h:58
int cplus_demangle_fill_component(struct demangle_component *fill, enum demangle_component_type, struct demangle_component *left, struct demangle_component *right)
#define DMGL_LUCID
Definition: demangle.h:53
#define DMGL_EDG
Definition: demangle.h:56
demangling_styles
Definition: demangle.h:73
@ arm_demangling
Definition: demangle.h:79
@ edg_demangling
Definition: demangle.h:81
@ auto_demangling
Definition: demangle.h:76
@ rust_demangling
Definition: demangle.h:86
@ gnu_v3_demangling
Definition: demangle.h:82
@ hp_demangling
Definition: demangle.h:80
@ lucid_demangling
Definition: demangle.h:78
@ unknown_demangling
Definition: demangle.h:75
@ no_demangling
Definition: demangle.h:74
@ gnu_demangling
Definition: demangle.h:77
@ gnat_demangling
Definition: demangle.h:84
@ dlang_demangling
Definition: demangle.h:85
@ java_demangling
Definition: demangle.h:83
#define DMGL_RUST
Definition: demangle.h:60
#define DMGL_AUTO
Definition: demangle.h:51
#define DMGL_JAVA
Definition: demangle.h:45
enum gnu_v3_ctor_kinds is_gnu_v3_mangled_ctor(const char *name)
Definition: cp-demangle.c:6052
int cplus_demangle_fill_builtin_type(struct demangle_component *fill, const char *type_name)
int cplus_demangle_fill_extended_operator(struct demangle_component *fill, int numargs, struct demangle_component *nm)
Definition: cp-demangle.c:857
char * dlang_demangle(const char *mangled, int options)
int java_demangle_v3_callback(const char *mangled, demangle_callbackref callback, void *opaque)
Definition: cp-demangle.c:5966
void(* demangle_callbackref)(const char *, size_t, void *)
Definition: demangle.h:149
int cplus_demangle_fill_operator(struct demangle_component *fill, const char *opname, int args)
int cplus_demangle_fill_name(struct demangle_component *fill, const char *, int)
Definition: cp-demangle.c:844
#define DMGL_GNU
Definition: demangle.h:52
void * mem
Definition: libc.cpp:91
static const char struct stat static buf struct stat static buf static vhangup int options
Definition: sflib.h:145
int args
Definition: mipsasm.c:18
int size_t
Definition: sftypes.h:40
struct demangle_component::@376::@384 s_string
struct demangle_component::@376::@385 s_number
struct demangle_component * name
Definition: demangle.h:517
struct demangle_component * right
Definition: demangle.h:584
union demangle_component::@376 u
struct demangle_component::@376::@377 s_name
const struct demangle_operator_info * op
Definition: demangle.h:508
struct demangle_component * length
Definition: demangle.h:524
struct demangle_component::@376::@381 s_ctor
struct demangle_component::@376::@378 s_operator
enum gnu_v3_ctor_kinds kind
Definition: demangle.h:535
struct demangle_component::@376::@387 s_binary
struct demangle_component::@376::@382 s_dtor
struct demangle_component::@376::@379 s_extended_operator
const char * s
Definition: demangle.h:500
struct demangle_component * sub
Definition: demangle.h:590
enum demangle_component_type type
Definition: demangle.h:487
struct demangle_component::@376::@383 s_builtin
struct demangle_component::@376::@388 s_unary_num
struct demangle_component::@376::@380 s_fixed
struct demangle_component * left
Definition: demangle.h:582
struct demangle_component::@376::@386 s_character
const char * string
Definition: demangle.h:560
const char *const demangling_style_name
Definition: demangle.h:123
const char *const demangling_style_doc
Definition: demangle.h:125
enum demangling_styles demangling_style
Definition: demangle.h:124
Definition: z80asm.h:102