version 1.1.1.3, 2018/04/14 15:37:04 |
version 1.1.1.4, 2020/04/03 17:41:39 |
|
|
/* Defs for interface to demanglers. |
/* Defs for interface to demanglers. |
Copyright (C) 1992-2016 Free Software Foundation, Inc. |
Copyright (C) 1992-2018 Free Software Foundation, Inc. |
|
|
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public License |
modify it under the terms of the GNU Library General Public License |
|
|
#define DMGL_GNU_V3 (1 << 14) |
#define DMGL_GNU_V3 (1 << 14) |
#define DMGL_GNAT (1 << 15) |
#define DMGL_GNAT (1 << 15) |
#define DMGL_DLANG (1 << 16) |
#define DMGL_DLANG (1 << 16) |
|
#define DMGL_RUST (1 << 17) /* Rust wraps GNU_V3 style mangling. */ |
|
|
/* If none of these are set, use 'current_demangling_style' as the default. */ |
/* If none of these are set, use 'current_demangling_style' as the default. */ |
#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) |
#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) |
|
|
/* Enumeration of possible demangling styles. |
/* Enumeration of possible demangling styles. |
|
|
Line 88 extern enum demangling_styles |
|
Line 89 extern enum demangling_styles |
|
gnu_v3_demangling = DMGL_GNU_V3, |
gnu_v3_demangling = DMGL_GNU_V3, |
java_demangling = DMGL_JAVA, |
java_demangling = DMGL_JAVA, |
gnat_demangling = DMGL_GNAT, |
gnat_demangling = DMGL_GNAT, |
dlang_demangling = DMGL_DLANG |
dlang_demangling = DMGL_DLANG, |
|
rust_demangling = DMGL_RUST |
} current_demangling_style; |
} current_demangling_style; |
|
|
/* Define string names for the various demangling styles. */ |
/* Define string names for the various demangling styles. */ |
Line 104 extern enum demangling_styles |
|
Line 106 extern enum demangling_styles |
|
#define JAVA_DEMANGLING_STYLE_STRING "java" |
#define JAVA_DEMANGLING_STYLE_STRING "java" |
#define GNAT_DEMANGLING_STYLE_STRING "gnat" |
#define GNAT_DEMANGLING_STYLE_STRING "gnat" |
#define DLANG_DEMANGLING_STYLE_STRING "dlang" |
#define DLANG_DEMANGLING_STYLE_STRING "dlang" |
|
#define RUST_DEMANGLING_STYLE_STRING "rust" |
|
|
/* Some macros to test what demangling style is active. */ |
/* Some macros to test what demangling style is active. */ |
|
|
Line 118 extern enum demangling_styles |
|
Line 121 extern enum demangling_styles |
|
#define JAVA_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_JAVA) |
#define JAVA_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_JAVA) |
#define GNAT_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNAT) |
#define GNAT_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNAT) |
#define DLANG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_DLANG) |
#define DLANG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_DLANG) |
|
#define RUST_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_RUST) |
|
|
/* Provide information about the available demangle styles. This code is |
/* Provide information about the available demangle styles. This code is |
pulled from gdb into libiberty because it is useful to binutils also. */ |
pulled from gdb into libiberty because it is useful to binutils also. */ |
Line 175 ada_demangle (const char *mangled, int o |
|
Line 179 ada_demangle (const char *mangled, int o |
|
extern char * |
extern char * |
dlang_demangle (const char *mangled, int options); |
dlang_demangle (const char *mangled, int options); |
|
|
|
/* Returns non-zero iff MANGLED is a rust mangled symbol. MANGLED must |
|
already have been demangled through cplus_demangle_v3. If this function |
|
returns non-zero then MANGLED can be demangled (in-place) using |
|
RUST_DEMANGLE_SYM. */ |
|
extern int |
|
rust_is_mangled (const char *mangled); |
|
|
|
/* Demangles SYM (in-place) if RUST_IS_MANGLED returned non-zero for SYM. |
|
If RUST_IS_MANGLED returned zero for SYM then RUST_DEMANGLE_SYM might |
|
replace characters that cannot be demangled with '?' and might truncate |
|
SYM. After calling RUST_DEMANGLE_SYM SYM might be shorter, but never |
|
larger. */ |
|
extern void |
|
rust_demangle_sym (char *sym); |
|
|
|
/* Demangles MANGLED if it was GNU_V3 and then RUST mangled, otherwise |
|
returns NULL. Uses CPLUS_DEMANGLE_V3, RUST_IS_MANGLED and |
|
RUST_DEMANGLE_SYM. Returns a new string that is owned by the caller. */ |
|
extern char * |
|
rust_demangle (const char *mangled, int options); |
|
|
enum gnu_v3_ctor_kinds { |
enum gnu_v3_ctor_kinds { |
gnu_v3_complete_object_ctor = 1, |
gnu_v3_complete_object_ctor = 1, |
gnu_v3_base_object_ctor, |
gnu_v3_base_object_ctor, |
Line 449 enum demangle_component_type |
|
Line 474 enum demangle_component_type |
|
/* A transaction-safe function type. */ |
/* A transaction-safe function type. */ |
DEMANGLE_COMPONENT_TRANSACTION_SAFE, |
DEMANGLE_COMPONENT_TRANSACTION_SAFE, |
/* A cloned function. */ |
/* A cloned function. */ |
DEMANGLE_COMPONENT_CLONE |
DEMANGLE_COMPONENT_CLONE, |
|
DEMANGLE_COMPONENT_NOEXCEPT, |
|
DEMANGLE_COMPONENT_THROW_SPEC |
}; |
}; |
|
|
/* Types which are only used internally. */ |
/* Types which are only used internally. */ |
Line 467 struct demangle_component |
|
Line 494 struct demangle_component |
|
/* The type of this component. */ |
/* The type of this component. */ |
enum demangle_component_type type; |
enum demangle_component_type type; |
|
|
|
/* Guard against recursive component printing. |
|
Initialize to zero. Private to d_print_comp. |
|
All other fields are final after initialization. */ |
|
int d_printing; |
|
|
union |
union |
{ |
{ |
/* For DEMANGLE_COMPONENT_NAME. */ |
/* For DEMANGLE_COMPONENT_NAME. */ |
Line 661 cplus_demangle_v3_components (const char |
|
Line 693 cplus_demangle_v3_components (const char |
|
|
|
extern char * |
extern char * |
cplus_demangle_print (int options, |
cplus_demangle_print (int options, |
const struct demangle_component *tree, |
struct demangle_component *tree, |
int estimated_length, |
int estimated_length, |
size_t *p_allocated_size); |
size_t *p_allocated_size); |
|
|
Line 681 cplus_demangle_print (int options, |
|
Line 713 cplus_demangle_print (int options, |
|
|
|
extern int |
extern int |
cplus_demangle_print_callback (int options, |
cplus_demangle_print_callback (int options, |
const struct demangle_component *tree, |
struct demangle_component *tree, |
demangle_callbackref callback, void *opaque); |
demangle_callbackref callback, void *opaque); |
|
|
#ifdef __cplusplus |
#ifdef __cplusplus |