[8833] | 1 | /* Defs for interface to demanglers. |
---|
| 2 | Copyright 1992, 1995 Free Software Foundation, Inc. |
---|
| 3 | |
---|
| 4 | This program is free software; you can redistribute it and/or modify |
---|
| 5 | it under the terms of the GNU General Public License as published by |
---|
| 6 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 7 | any later version. |
---|
| 8 | |
---|
| 9 | This program is distributed in the hope that it will be useful, |
---|
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 12 | GNU General Public License for more details. |
---|
| 13 | |
---|
| 14 | You should have received a copy of the GNU General Public License |
---|
| 15 | along with this program; if not, write to the Free Software |
---|
| 16 | Foundation, Inc., 59 Temple Place - Suite 330, |
---|
| 17 | Boston, MA 02111-1307, USA. */ |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | #if !defined (DEMANGLE_H) |
---|
| 21 | #define DEMANGLE_H |
---|
| 22 | |
---|
| 23 | #ifdef IN_GCC |
---|
| 24 | |
---|
| 25 | /* Add prototype support. */ |
---|
| 26 | #ifndef PROTO |
---|
| 27 | #if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__) |
---|
| 28 | #define PROTO(ARGS) ARGS |
---|
| 29 | #else |
---|
| 30 | #define PROTO(ARGS) () |
---|
| 31 | #endif |
---|
| 32 | #endif |
---|
| 33 | |
---|
| 34 | #define PARAMS(ARGS) PROTO(ARGS) |
---|
| 35 | |
---|
| 36 | #ifdef __STDC__ |
---|
| 37 | #define PTR void * |
---|
| 38 | #else |
---|
| 39 | #ifndef const |
---|
| 40 | #define const |
---|
| 41 | #endif |
---|
| 42 | #define PTR char * |
---|
| 43 | #endif |
---|
| 44 | |
---|
| 45 | #else /* ! IN_GCC */ |
---|
| 46 | #include <ansidecl.h> |
---|
| 47 | #endif /* IN_GCC */ |
---|
| 48 | |
---|
| 49 | /* Options passed to cplus_demangle (in 2nd parameter). */ |
---|
| 50 | |
---|
| 51 | #define DMGL_NO_OPTS 0 /* For readability... */ |
---|
| 52 | #define DMGL_PARAMS (1 << 0) /* Include function args */ |
---|
| 53 | #define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ |
---|
| 54 | |
---|
| 55 | #define DMGL_AUTO (1 << 8) |
---|
| 56 | #define DMGL_GNU (1 << 9) |
---|
| 57 | #define DMGL_LUCID (1 << 10) |
---|
| 58 | #define DMGL_ARM (1 << 11) |
---|
| 59 | /* If none of these are set, use 'current_demangling_style' as the default. */ |
---|
| 60 | #define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM) |
---|
| 61 | |
---|
| 62 | /* Enumeration of possible demangling styles. |
---|
| 63 | |
---|
| 64 | Lucid and ARM styles are still kept logically distinct, even though |
---|
| 65 | they now both behave identically. The resulting style is actual the |
---|
| 66 | union of both. I.E. either style recognizes both "__pt__" and "__rf__" |
---|
| 67 | for operator "->", even though the first is lucid style and the second |
---|
| 68 | is ARM style. (FIXME?) */ |
---|
| 69 | |
---|
| 70 | extern enum demangling_styles |
---|
| 71 | { |
---|
| 72 | unknown_demangling = 0, |
---|
| 73 | auto_demangling = DMGL_AUTO, |
---|
| 74 | gnu_demangling = DMGL_GNU, |
---|
| 75 | lucid_demangling = DMGL_LUCID, |
---|
| 76 | arm_demangling = DMGL_ARM |
---|
| 77 | } current_demangling_style; |
---|
| 78 | |
---|
| 79 | /* Define string names for the various demangling styles. */ |
---|
| 80 | |
---|
| 81 | #define AUTO_DEMANGLING_STYLE_STRING "auto" |
---|
| 82 | #define GNU_DEMANGLING_STYLE_STRING "gnu" |
---|
| 83 | #define LUCID_DEMANGLING_STYLE_STRING "lucid" |
---|
| 84 | #define ARM_DEMANGLING_STYLE_STRING "arm" |
---|
| 85 | |
---|
| 86 | /* Some macros to test what demangling style is active. */ |
---|
| 87 | |
---|
| 88 | #define CURRENT_DEMANGLING_STYLE current_demangling_style |
---|
| 89 | #define AUTO_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_AUTO) |
---|
| 90 | #define GNU_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU) |
---|
| 91 | #define LUCID_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_LUCID) |
---|
| 92 | #define ARM_DEMANGLING (CURRENT_DEMANGLING_STYLE & DMGL_ARM) |
---|
| 93 | |
---|
| 94 | extern char * |
---|
| 95 | cplus_demangle PARAMS ((const char *mangled, int options)); |
---|
| 96 | |
---|
| 97 | extern int |
---|
| 98 | cplus_demangle_opname PARAMS ((char *opname, char *result, int options)); |
---|
| 99 | |
---|
| 100 | extern char * |
---|
| 101 | cplus_mangle_opname PARAMS ((char *opname, int options)); |
---|
| 102 | |
---|
| 103 | /* Note: This sets global state. FIXME if you care about multi-threading. */ |
---|
| 104 | |
---|
| 105 | extern void |
---|
| 106 | set_cplus_marker_for_demangling PARAMS ((int ch)); |
---|
| 107 | |
---|
| 108 | #endif /* DEMANGLE_H */ |
---|