You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
3.1 KiB

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