GNU Binutils with patches for OS216
修订版 | be01fded5c79b543d9f28974a625fe4b05162a92 (tree) |
---|---|
时间 | 2004-01-05 07:42:41 |
作者 | Daniel Jacobowitz <drow@fals...> |
Commiter | Daniel Jacobowitz |
* Makefile.in (cp_names_h): Remove.
(cp_demangle_h): New.
(cp-names.tab.o, cp-names-main.tab.o): Use $(cp_demangle_h) and
remove $(cp_names_h).
(cp-support.o): Use $(cp_demangle_h).
* cp-names.y: Don't include cp-names.h.
(cp_comp_to_string): Export.
(cp_canonicalize_string): Move to cp-support.c.
(demangled_name_to_comp, mangled_name_to_comp): New functions.
* cp-support.c: Include "cp-demangle.h".
(cp_canonicalize_string): New function, moved from cp-names.y and
updated.
(class_name_from_physname, method_name_from_physname): Rewritten.
(find_last_component): Removed.
* cp-support.h: Add new opaque types and prototypes.
* dwarf2read.c: Don't include cp-names.h.
* cp-names.h: Remove file.
@@ -1,3 +1,23 @@ | ||
1 | +2003-01-04 Daniel Jacobowitz <drow@mvista.com> | |
2 | + | |
3 | + * Makefile.in (cp_names_h): Remove. | |
4 | + (cp_demangle_h): New. | |
5 | + (cp-names.tab.o, cp-names-main.tab.o): Use $(cp_demangle_h) and | |
6 | + remove $(cp_names_h). | |
7 | + (cp-support.o): Use $(cp_demangle_h). | |
8 | + * cp-names.y: Don't include cp-names.h. | |
9 | + (cp_comp_to_string): Export. | |
10 | + (cp_canonicalize_string): Move to cp-support.c. | |
11 | + (demangled_name_to_comp, mangled_name_to_comp): New functions. | |
12 | + * cp-support.c: Include "cp-demangle.h". | |
13 | + (cp_canonicalize_string): New function, moved from cp-names.y and | |
14 | + updated. | |
15 | + (class_name_from_physname, method_name_from_physname): Rewritten. | |
16 | + (find_last_component): Removed. | |
17 | + * cp-support.h: Add new opaque types and prototypes. | |
18 | + * dwarf2read.c: Don't include cp-names.h. | |
19 | + * cp-names.h: Remove file. | |
20 | + | |
1 | 21 | 2004-01-04 Daniel Jacobowitz <drow@mvista.com> |
2 | 22 | |
3 | 23 | * Makefile.in (cp-names.tab.o, cp-names-main.tab.o, test-cpnames): |
@@ -579,6 +579,7 @@ coff_sym_h = $(INCLUDE_DIR)/coff/sym.h | ||
579 | 579 | coff_symconst_h = $(INCLUDE_DIR)/coff/symconst.h |
580 | 580 | coff_ecoff_h = $(INCLUDE_DIR)/coff/ecoff.h |
581 | 581 | coff_internal_h = $(INCLUDE_DIR)/coff/internal.h |
582 | +cp_demangle_h = $(INCLUDE_DIR)/cp-demangle.h | |
582 | 583 | dis_asm_h = $(INCLUDE_DIR)/dis-asm.h $(bfd_h) |
583 | 584 | elf_reloc_macros_h = $(INCLUDE_DIR)/elf/reloc-macros.h |
584 | 585 | elf_sh_h = $(INCLUDE_DIR)/elf/sh.h |
@@ -654,7 +655,6 @@ command_h = command.h | ||
654 | 655 | complaints_h = complaints.h |
655 | 656 | completer_h = completer.h |
656 | 657 | cp_abi_h = cp-abi.h |
657 | -cp_names_h = cp-names.h | |
658 | 658 | cp_support_h = cp-support.h $(symtab_h) |
659 | 659 | dcache_h = dcache.h |
660 | 660 | defs_h = defs.h $(config_h) $(ansidecl_h) $(gdb_locale_h) $(gdb_signals_h) \ |
@@ -1439,11 +1439,9 @@ c-exp.tab.c: c-exp.y | ||
1439 | 1439 | -rm c-exp.tmp |
1440 | 1440 | mv c-exp.new ./c-exp.tab.c |
1441 | 1441 | |
1442 | -cp-names.tab.o: cp-names.tab.c $(safe_ctype_h) $(cp_names_h) \ | |
1443 | - $(srcdir)/../include/cp-demangle.h | |
1442 | +cp-names.tab.o: cp-names.tab.c $(safe_ctype_h) $(cp_demangle_h) | |
1444 | 1443 | |
1445 | -cp-names-main.tab.o: cp-names.tab.c $(safe_ctype_h) $(cp_names_h) \ | |
1446 | - $(srcdir)/../include/cp-demangle.h | |
1444 | +cp-names-main.tab.o: cp-names.tab.c $(safe_ctype_h) $(cp_demangle_h) | |
1447 | 1445 | $(CC) -c $(INTERNAL_CFLAGS) -DTEST_CPNAMES \ |
1448 | 1446 | -o cp-names-main.tab.o cp-names.tab.c |
1449 | 1447 | test-cpnames: cp-names-main.tab.o $(LIBIBERTY) |
@@ -1708,7 +1706,8 @@ cp-namespace.o: cp-namespace.c $(defs_h) $(cp_support_h) $(gdb_obstack_h) \ | ||
1708 | 1706 | $(gdbtypes_h) $(dictionary_h) $(command_h) |
1709 | 1707 | cp-support.o: cp-support.c $(defs_h) $(cp_support_h) $(gdb_string_h) \ |
1710 | 1708 | $(demangle_h) $(gdb_assert_h) $(gdbcmd_h) $(dictionary_h) \ |
1711 | - $(objfiles_h) $(frame_h) $(symtab_h) $(block_h) $(complaints_h) | |
1709 | + $(objfiles_h) $(frame_h) $(symtab_h) $(block_h) $(complaints_h) \ | |
1710 | + $(cp_demangle_h) | |
1712 | 1711 | cpu32bug-rom.o: cpu32bug-rom.c $(defs_h) $(gdbcore_h) $(target_h) \ |
1713 | 1712 | $(monitor_h) $(serial_h) $(regcache_h) $(m68k_tdep_h) |
1714 | 1713 | cp-valprint.o: cp-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \ |
@@ -1,24 +0,0 @@ | ||
1 | -/* YACC parser for C++ names, for GDB. | |
2 | - | |
3 | - Copyright 2003 | |
4 | - Free Software Foundation, Inc. | |
5 | - | |
6 | -This file is part of GDB. | |
7 | - | |
8 | -This program is free software; you can redistribute it and/or modify | |
9 | -it under the terms of the GNU General Public License as published by | |
10 | -the Free Software Foundation; either version 2 of the License, or | |
11 | -(at your option) any later version. | |
12 | - | |
13 | -This program is distributed in the hope that it will be useful, | |
14 | -but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | -GNU General Public License for more details. | |
17 | - | |
18 | -You should have received a copy of the GNU General Public License | |
19 | -along with this program; if not, write to the Free Software | |
20 | -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |
21 | - | |
22 | -/* Return the canonicalized form of STRING, or NULL if STRING can not be | |
23 | - parsed. */ | |
24 | -char *cp_canonicalize_string (const char *string); |
@@ -43,8 +43,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | ||
43 | 43 | #define IN_GDB |
44 | 44 | #include "cp-demangle.h" |
45 | 45 | |
46 | -#include "cp-names.h" | |
47 | - | |
48 | 46 | static const char *lexptr, *prev_lexptr; |
49 | 47 | |
50 | 48 | static struct d_comp *d_qualify (struct d_comp *, int, int); |
@@ -2005,7 +2003,7 @@ symbol_end (const char *lexptr) | ||
2005 | 2003 | return p; |
2006 | 2004 | } |
2007 | 2005 | |
2008 | -static char * | |
2006 | +char * | |
2009 | 2007 | cp_comp_to_string (struct d_comp *result, int estimated_len) |
2010 | 2008 | { |
2011 | 2009 | char *str, *prefix = NULL, *buf; |
@@ -2036,26 +2034,57 @@ cp_comp_to_string (struct d_comp *result, int estimated_len) | ||
2036 | 2034 | return (buf); |
2037 | 2035 | } |
2038 | 2036 | |
2039 | -/* Return the canonicalized form of STRING, or NULL if STRING can not be | |
2040 | - parsed. */ | |
2037 | +/* Convert a demangled name to a d_comp tree. *DI_P is set to the | |
2038 | + struct d_info that should be freed when finished with the tree. */ | |
2041 | 2039 | |
2042 | -char * | |
2043 | -cp_canonicalize_string (const char *string) | |
2040 | +struct d_comp * | |
2041 | +demangled_name_to_comp (const char *demangled_name, struct d_info **di_p) | |
2044 | 2042 | { |
2045 | - int len = strlen (string); | |
2046 | - char *ret; | |
2043 | + int len = strlen (demangled_name); | |
2047 | 2044 | |
2048 | 2045 | len = len + len / 8; |
2046 | + lexptr = demangled_name; | |
2049 | 2047 | |
2050 | - lexptr = string; | |
2051 | 2048 | di = cp_v3_d_init_info_alloc (NULL, DMGL_PARAMS | DMGL_ANSI, len); |
2049 | + | |
2052 | 2050 | if (yyparse () || result == NULL) |
2053 | - return NULL; | |
2051 | + { | |
2052 | + cp_v3_d_free_info (di); | |
2053 | + return NULL; | |
2054 | + } | |
2054 | 2055 | |
2055 | - ret = cp_comp_to_string (result, len); | |
2056 | + *di_p = di; | |
2057 | + return result; | |
2058 | +} | |
2059 | + | |
2060 | +/* Convert a mangled name to a d_comp tree. *DI_P is set to the | |
2061 | + struct d_info that should be freed when finished with the tree. | |
2062 | + DEMANGLED_P is set to the char * that should be freed when finished | |
2063 | + with the tree. OPTIONS will be passed to the demangler. | |
2064 | + | |
2065 | + This could be done much more efficiently for v3 mangled names by exposing | |
2066 | + d_demangle from the demangler. */ | |
2067 | + | |
2068 | +struct d_comp * | |
2069 | +mangled_name_to_comp (const char *mangled_name, int options, | |
2070 | + struct d_info **di_p, char **demangled_p) | |
2071 | +{ | |
2072 | + char *demangled_name = cplus_demangle (mangled_name, options); | |
2073 | + int len; | |
2074 | + struct d_comp *ret; | |
2056 | 2075 | |
2057 | - cp_v3_d_free_info (di); | |
2076 | + if (demangled_name == NULL) | |
2077 | + return NULL; | |
2078 | + | |
2079 | + ret = demangled_name_to_comp (demangled_name, di_p); | |
2080 | + | |
2081 | + if (ret == NULL) | |
2082 | + { | |
2083 | + free (demangled_name); | |
2084 | + return NULL; | |
2085 | + } | |
2058 | 2086 | |
2087 | + *demangled_p = demangled_name; | |
2059 | 2088 | return ret; |
2060 | 2089 | } |
2061 | 2090 |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* Helper routines for C++ support in GDB. |
2 | - Copyright 2002, 2003 Free Software Foundation, Inc. | |
2 | + Copyright 2002, 2003, 2004 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | Contributed by MontaVista Software. |
5 | 5 |
@@ -35,6 +35,9 @@ | ||
35 | 35 | #include "complaints.h" |
36 | 36 | #include "gdbtypes.h" |
37 | 37 | |
38 | +#define IN_GDB | |
39 | +#include "cp-demangle.h" | |
40 | + | |
38 | 41 | /* Functions related to demangled name parsing. */ |
39 | 42 | |
40 | 43 | static const char *find_last_component (const char *name); |
@@ -63,78 +66,31 @@ struct cmd_list_element *maint_cplus_cmd_list = NULL; | ||
63 | 66 | static void maint_cplus_command (char *arg, int from_tty); |
64 | 67 | static void first_component_command (char *arg, int from_tty); |
65 | 68 | |
66 | -/* Here are some random pieces of trivia to keep in mind while trying | |
67 | - to take apart demangled names: | |
68 | - | |
69 | - - Names can contain function arguments or templates, so the process | |
70 | - has to be, to some extent recursive: maybe keep track of your | |
71 | - depth based on encountering <> and (). | |
72 | - | |
73 | - - Parentheses don't just have to happen at the end of a name: they | |
74 | - can occur even if the name in question isn't a function, because | |
75 | - a template argument might be a type that's a function. | |
76 | - | |
77 | - - Conversely, even if you're trying to deal with a function, its | |
78 | - demangled name might not end with ')': it could be a const or | |
79 | - volatile class method, in which case it ends with "const" or | |
80 | - "volatile". | |
81 | - | |
82 | - - Parentheses are also used in anonymous namespaces: a variable | |
83 | - 'foo' in an anonymous namespace gets demangled as "(anonymous | |
84 | - namespace)::foo". | |
85 | - | |
86 | - - And operator names can contain parentheses or angle brackets. */ | |
87 | - | |
88 | -/* FIXME: carlton/2003-03-13: We have several functions here with | |
89 | - overlapping functionality; can we combine them? Also, do they | |
90 | - handle all the above considerations correctly? */ | |
91 | - | |
92 | -/* Find the last component of the demangled C++ name NAME. NAME | |
93 | - must be a method name including arguments, in order to correctly | |
94 | - locate the last component. | |
69 | +/* Return the canonicalized form of STRING, or NULL if STRING can not be | |
70 | + parsed. */ | |
95 | 71 | |
96 | - This function return a pointer to the first colon before the | |
97 | - last component, or NULL if the name had only one component. */ | |
72 | +/* FIXME: Should we also return NULL for things that trivially do not require | |
73 | + any change? i.e. alphanumeric strings. */ | |
98 | 74 | |
99 | -static const char * | |
100 | -find_last_component (const char *name) | |
75 | +char * | |
76 | +cp_canonicalize_string (const char *string) | |
101 | 77 | { |
102 | - const char *p; | |
103 | - int depth; | |
78 | + struct d_info *di; | |
79 | + struct d_comp *ret_comp; | |
80 | + char *ret; | |
81 | + int len = strlen (string); | |
104 | 82 | |
105 | - /* Functions can have local classes, so we need to find the | |
106 | - beginning of the last argument list, not the end of the first | |
107 | - one. */ | |
108 | - p = name + strlen (name) - 1; | |
109 | - while (p > name && *p != ')') | |
110 | - p--; | |
83 | + len = len + len / 8; | |
111 | 84 | |
112 | - if (p == name) | |
85 | + ret_comp = demangled_name_to_comp (string, &di); | |
86 | + if (ret_comp == NULL) | |
113 | 87 | return NULL; |
114 | 88 | |
115 | - /* P now points at the `)' at the end of the argument list. Walk | |
116 | - back to the beginning. */ | |
117 | - p--; | |
118 | - depth = 1; | |
119 | - while (p > name && depth > 0) | |
120 | - { | |
121 | - if (*p == '<' || *p == '(') | |
122 | - depth--; | |
123 | - else if (*p == '>' || *p == ')') | |
124 | - depth++; | |
125 | - p--; | |
126 | - } | |
127 | - | |
128 | - if (p == name) | |
129 | - return NULL; | |
89 | + ret = cp_comp_to_string (ret_comp, len); | |
130 | 90 | |
131 | - while (p > name && *p != ':') | |
132 | - p--; | |
91 | + cp_v3_d_free_info (di); | |
133 | 92 | |
134 | - if (p == name || p == name + 1 || p[-1] != ':') | |
135 | - return NULL; | |
136 | - | |
137 | - return p - 1; | |
93 | + return ret; | |
138 | 94 | } |
139 | 95 | |
140 | 96 | /* Return the name of the class containing method PHYSNAME. */ |
@@ -142,22 +98,63 @@ find_last_component (const char *name) | ||
142 | 98 | char * |
143 | 99 | class_name_from_physname (const char *physname) |
144 | 100 | { |
145 | - char *ret = NULL; | |
146 | - const char *end; | |
147 | - int depth = 0; | |
148 | - char *demangled_name = cplus_demangle (physname, DMGL_ANSI | DMGL_PARAMS); | |
101 | + struct d_info *di; | |
102 | + char *demangled_name, *ret; | |
103 | + struct d_comp *ret_comp, *prev_comp; | |
104 | + int done; | |
149 | 105 | |
150 | - if (demangled_name == NULL) | |
106 | + ret_comp = mangled_name_to_comp (physname, DMGL_ANSI, &di, &demangled_name); | |
107 | + if (ret_comp == NULL) | |
151 | 108 | return NULL; |
152 | 109 | |
153 | - end = find_last_component (demangled_name); | |
154 | - if (end != NULL) | |
110 | + done = 0; | |
111 | + prev_comp = NULL; | |
112 | + while (!done) | |
113 | + switch (ret_comp->type) | |
114 | + { | |
115 | + case D_COMP_TYPED_NAME: | |
116 | + prev_comp = NULL; | |
117 | + ret_comp = d_right (ret_comp); | |
118 | + break; | |
119 | + case D_COMP_QUAL_NAME: | |
120 | + case D_COMP_LOCAL_NAME: | |
121 | + prev_comp = ret_comp; | |
122 | + ret_comp = d_right (ret_comp); | |
123 | + break; | |
124 | + case D_COMP_CONST: | |
125 | + case D_COMP_RESTRICT: | |
126 | + case D_COMP_VOLATILE: | |
127 | + case D_COMP_CONST_THIS: | |
128 | + case D_COMP_RESTRICT_THIS: | |
129 | + case D_COMP_VOLATILE_THIS: | |
130 | + case D_COMP_VENDOR_TYPE_QUAL: | |
131 | + prev_comp = NULL; | |
132 | + ret_comp = d_left (ret_comp); | |
133 | + break; | |
134 | + case D_COMP_NAME: | |
135 | + case D_COMP_TEMPLATE: | |
136 | + case D_COMP_CTOR: | |
137 | + case D_COMP_DTOR: | |
138 | + case D_COMP_OPERATOR: | |
139 | + case D_COMP_EXTENDED_OPERATOR: | |
140 | + done = 1; | |
141 | + break; | |
142 | + default: | |
143 | + done = 1; | |
144 | + prev_comp = NULL; | |
145 | + ret_comp = NULL; | |
146 | + break; | |
147 | + } | |
148 | + | |
149 | + ret = NULL; | |
150 | + if (prev_comp != NULL) | |
155 | 151 | { |
156 | - ret = xmalloc (end - demangled_name + 1); | |
157 | - memcpy (ret, demangled_name, end - demangled_name); | |
158 | - ret[end - demangled_name] = '\0'; | |
152 | + *prev_comp = *d_left (prev_comp); | |
153 | + /* The ten is completely arbitrary; we don't have a good estimate. */ | |
154 | + ret = cp_comp_to_string (prev_comp, 10); | |
159 | 155 | } |
160 | 156 | |
157 | + cp_v3_d_free_info (di); | |
161 | 158 | xfree (demangled_name); |
162 | 159 | return ret; |
163 | 160 | } |
@@ -167,43 +164,84 @@ class_name_from_physname (const char *physname) | ||
167 | 164 | char * |
168 | 165 | method_name_from_physname (const char *physname) |
169 | 166 | { |
170 | - char *ret = NULL; | |
171 | - const char *end; | |
172 | - int depth = 0; | |
173 | - char *demangled_name = cplus_demangle (physname, DMGL_ANSI | DMGL_PARAMS); | |
167 | + struct d_info *di; | |
168 | + char *demangled_name, *ret; | |
169 | + struct d_comp *ret_comp; | |
170 | + int done; | |
174 | 171 | |
175 | - if (demangled_name == NULL) | |
172 | + ret_comp = mangled_name_to_comp (physname, DMGL_ANSI, &di, &demangled_name); | |
173 | + if (ret_comp == NULL) | |
176 | 174 | return NULL; |
177 | 175 | |
178 | - end = find_last_component (demangled_name); | |
179 | - if (end != NULL) | |
180 | - { | |
181 | - char *args; | |
182 | - int len; | |
176 | + done = 0; | |
177 | + while (!done) | |
178 | + switch (ret_comp->type) | |
179 | + { | |
180 | + case D_COMP_QUAL_NAME: | |
181 | + case D_COMP_LOCAL_NAME: | |
182 | + case D_COMP_TYPED_NAME: | |
183 | + ret_comp = d_right (ret_comp); | |
184 | + break; | |
185 | + case D_COMP_CONST: | |
186 | + case D_COMP_RESTRICT: | |
187 | + case D_COMP_VOLATILE: | |
188 | + case D_COMP_CONST_THIS: | |
189 | + case D_COMP_RESTRICT_THIS: | |
190 | + case D_COMP_VOLATILE_THIS: | |
191 | + case D_COMP_VENDOR_TYPE_QUAL: | |
192 | + ret_comp = d_left (ret_comp); | |
193 | + break; | |
194 | + case D_COMP_NAME: | |
195 | + case D_COMP_TEMPLATE: | |
196 | + case D_COMP_CTOR: | |
197 | + case D_COMP_DTOR: | |
198 | + case D_COMP_OPERATOR: | |
199 | + case D_COMP_EXTENDED_OPERATOR: | |
200 | + done = 1; | |
201 | + break; | |
202 | + default: | |
203 | + done = 1; | |
204 | + ret_comp = NULL; | |
205 | + break; | |
206 | + } | |
183 | 207 | |
184 | - /* Skip "::". */ | |
185 | - end = end + 2; | |
186 | - | |
187 | - /* Find the argument list, if any. */ | |
188 | - args = strchr (end, '('); | |
189 | - if (args == NULL) | |
190 | - len = strlen (end + 2); | |
191 | - else | |
192 | - { | |
193 | - args --; | |
194 | - while (*args == ' ') | |
195 | - args --; | |
196 | - len = args - end + 1; | |
197 | - } | |
198 | - ret = xmalloc (len + 1); | |
199 | - memcpy (ret, end, len); | |
200 | - ret[len] = 0; | |
201 | - } | |
208 | + ret = NULL; | |
209 | + if (ret_comp != NULL) | |
210 | + /* The ten is completely arbitrary; we don't have a good estimate. */ | |
211 | + ret = cp_comp_to_string (ret_comp, 10); | |
202 | 212 | |
213 | + cp_v3_d_free_info (di); | |
203 | 214 | xfree (demangled_name); |
204 | 215 | return ret; |
205 | 216 | } |
206 | 217 | |
218 | +/* Here are some random pieces of trivia to keep in mind while trying | |
219 | + to take apart demangled names: | |
220 | + | |
221 | + - Names can contain function arguments or templates, so the process | |
222 | + has to be, to some extent recursive: maybe keep track of your | |
223 | + depth based on encountering <> and (). | |
224 | + | |
225 | + - Parentheses don't just have to happen at the end of a name: they | |
226 | + can occur even if the name in question isn't a function, because | |
227 | + a template argument might be a type that's a function. | |
228 | + | |
229 | + - Conversely, even if you're trying to deal with a function, its | |
230 | + demangled name might not end with ')': it could be a const or | |
231 | + volatile class method, in which case it ends with "const" or | |
232 | + "volatile". | |
233 | + | |
234 | + - Parentheses are also used in anonymous namespaces: a variable | |
235 | + 'foo' in an anonymous namespace gets demangled as "(anonymous | |
236 | + namespace)::foo". | |
237 | + | |
238 | + - And operator names can contain parentheses or angle brackets. */ | |
239 | + | |
240 | +/* FIXME: carlton/2003-03-13: We have several functions here with | |
241 | + overlapping functionality; can we combine them? Also, do they | |
242 | + handle all the above considerations correctly? */ | |
243 | + | |
244 | + | |
207 | 245 | /* This returns the length of first component of NAME, which should be |
208 | 246 | the demangled name of a C++ variable/function/method/etc. |
209 | 247 | Specifically, it returns the index of the first colon forming the |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* Helper routines for C++ support in GDB. |
2 | - Copyright 2002, 2003 Free Software Foundation, Inc. | |
2 | + Copyright 2002, 2003, 2004 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | Contributed by MontaVista Software. |
5 | 5 | Namespace support contributed by David Carlton. |
@@ -35,6 +35,8 @@ struct obstack; | ||
35 | 35 | struct block; |
36 | 36 | struct objfile; |
37 | 37 | struct type; |
38 | +struct d_comp; | |
39 | +struct d_info; | |
38 | 40 | |
39 | 41 | /* This struct is designed to store data from using directives. It |
40 | 42 | says that names from namespace INNER should be visible within |
@@ -52,6 +54,8 @@ struct using_direct | ||
52 | 54 | |
53 | 55 | /* Functions from cp-support.c. */ |
54 | 56 | |
57 | +extern char *cp_canonicalize_string (const char *string); | |
58 | + | |
55 | 59 | extern char *class_name_from_physname (const char *physname); |
56 | 60 | |
57 | 61 | extern char *method_name_from_physname (const char *physname); |
@@ -108,6 +112,18 @@ extern struct type *cp_lookup_nested_type (struct type *parent_type, | ||
108 | 112 | extern void cp_check_possible_namespace_symbols (const char *name, |
109 | 113 | struct objfile *objfile); |
110 | 114 | |
115 | +/* Functions from cp-names.y. */ | |
116 | + | |
117 | +extern struct d_comp *demangled_name_to_comp (const char *demangled_name, | |
118 | + struct d_info **di_p); | |
119 | + | |
120 | +extern struct d_comp *mangled_name_to_comp (const char *mangled_name, | |
121 | + int options, | |
122 | + struct d_info **di_p, | |
123 | + char **demangled_p); | |
124 | + | |
125 | +extern char *cp_comp_to_string (struct d_comp *result, int estimated_len); | |
126 | + | |
111 | 127 | /* The list of "maint cplus" commands. */ |
112 | 128 | |
113 | 129 | extern struct cmd_list_element *maint_cplus_cmd_list; |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* DWARF 2 debugging format support for GDB. |
2 | - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 | |
2 | + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 | |
3 | 3 | Free Software Foundation, Inc. |
4 | 4 | |
5 | 5 | Adapted by Gary Funck (gary@intrepid.com), Intrepid Technology, |
@@ -44,7 +44,6 @@ | ||
44 | 44 | #include "dwarf2expr.h" |
45 | 45 | #include "dwarf2loc.h" |
46 | 46 | #include "cp-support.h" |
47 | -#include "cp-names.h" | |
48 | 47 | |
49 | 48 | #include <fcntl.h> |
50 | 49 | #include "gdb_string.h" |