Commit | Line | Data |
---|---|---|
de17c821 | 1 | /* Helper routines for C++ support in GDB. |
6aba47ca | 2 | Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. |
de17c821 DJ |
3 | |
4 | Contributed by MontaVista Software. | |
9219021c | 5 | Namespace support contributed by David Carlton. |
de17c821 DJ |
6 | |
7 | This file is part of GDB. | |
8 | ||
9 | This program is free software; you can redistribute it and/or modify | |
10 | it under the terms of the GNU General Public License as published by | |
a9762ec7 | 11 | the Free Software Foundation; either version 3 of the License, or |
de17c821 DJ |
12 | (at your option) any later version. |
13 | ||
14 | This program is distributed in the hope that it will be useful, | |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | GNU General Public License for more details. | |
18 | ||
19 | You should have received a copy of the GNU General Public License | |
a9762ec7 | 20 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
de17c821 | 21 | |
9219021c DC |
22 | #ifndef CP_SUPPORT_H |
23 | #define CP_SUPPORT_H | |
24 | ||
1fcb5155 DC |
25 | /* We need this for 'domain_enum', alas... */ |
26 | ||
27 | #include "symtab.h" | |
28 | ||
9219021c DC |
29 | /* Opaque declarations. */ |
30 | ||
b59661bd | 31 | struct symbol; |
9219021c DC |
32 | struct obstack; |
33 | struct block; | |
4a4b3fed | 34 | struct objfile; |
362ff856 | 35 | struct type; |
fb4c6eba | 36 | struct demangle_component; |
9219021c DC |
37 | |
38 | /* This struct is designed to store data from using directives. It | |
39 | says that names from namespace INNER should be visible within | |
40 | namespace OUTER. OUTER should always be a strict initial substring | |
41 | of INNER. These form a linked list; NEXT is the next element of | |
42 | the list. */ | |
43 | ||
44 | struct using_direct | |
45 | { | |
46 | char *inner; | |
47 | char *outer; | |
48 | struct using_direct *next; | |
49 | }; | |
50 | ||
51 | ||
52 | /* Functions from cp-support.c. */ | |
53 | ||
fb4c6eba DJ |
54 | extern char *cp_canonicalize_string (const char *string); |
55 | ||
31c27f77 | 56 | extern char *cp_class_name_from_physname (const char *physname); |
de17c821 DJ |
57 | |
58 | extern char *method_name_from_physname (const char *physname); | |
9219021c DC |
59 | |
60 | extern unsigned int cp_find_first_component (const char *name); | |
61 | ||
62 | extern unsigned int cp_entire_prefix_len (const char *name); | |
63 | ||
8d577d32 DC |
64 | extern char *cp_func_name (const char *full_name); |
65 | ||
66 | extern struct symbol **make_symbol_overload_list (const char *, | |
67 | const char *); | |
9219021c | 68 | |
362ff856 MC |
69 | extern struct type *cp_lookup_rtti_type (const char *name, |
70 | struct block *block); | |
71 | ||
9219021c DC |
72 | /* Functions/variables from cp-namespace.c. */ |
73 | ||
74 | extern unsigned char processing_has_namespace_info; | |
75 | ||
38d518c9 | 76 | extern const char *processing_current_prefix; |
9219021c DC |
77 | |
78 | extern int cp_is_anonymous (const char *namespace); | |
79 | ||
80 | extern void cp_add_using_directive (const char *name, | |
81 | unsigned int outer_length, | |
82 | unsigned int inner_length); | |
83 | ||
b9362cc7 | 84 | extern void cp_initialize_namespace (void); |
9219021c DC |
85 | |
86 | extern void cp_finalize_namespace (struct block *static_block, | |
87 | struct obstack *obstack); | |
88 | ||
89 | extern void cp_set_block_scope (const struct symbol *symbol, | |
90 | struct block *block, | |
91 | struct obstack *obstack); | |
92 | ||
93 | extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol); | |
94 | ||
1fcb5155 DC |
95 | extern struct symbol *cp_lookup_symbol_nonlocal (const char *name, |
96 | const char *linkage_name, | |
97 | const struct block *block, | |
98 | const domain_enum domain, | |
99 | struct symtab **symtab); | |
100 | ||
101 | extern struct symbol *cp_lookup_symbol_namespace (const char *namespace, | |
102 | const char *name, | |
103 | const char *linkage_name, | |
104 | const struct block *block, | |
105 | const domain_enum domain, | |
106 | struct symtab **symtab); | |
107 | ||
79c2c32d DC |
108 | extern struct type *cp_lookup_nested_type (struct type *parent_type, |
109 | const char *nested_name, | |
110 | const struct block *block); | |
111 | ||
5c4e30ca DC |
112 | extern void cp_check_possible_namespace_symbols (const char *name, |
113 | struct objfile *objfile); | |
114 | ||
b368761e DC |
115 | struct type *cp_lookup_transparent_type (const char *name); |
116 | ||
fb4c6eba DJ |
117 | /* Functions from cp-names.y. */ |
118 | ||
119 | extern struct demangle_component *cp_demangled_name_to_comp | |
120 | (const char *demangled_name, void **memory_p, const char **errmsg); | |
121 | ||
122 | extern char *cp_comp_to_string (struct demangle_component *result, | |
123 | int estimated_len); | |
124 | ||
5c4e30ca DC |
125 | /* The list of "maint cplus" commands. */ |
126 | ||
127 | extern struct cmd_list_element *maint_cplus_cmd_list; | |
128 | ||
d3cbe7ef AC |
129 | /* Pointer to member function. Depends on compiler implementation. */ |
130 | ||
131 | #define METHOD_PTR_IS_VIRTUAL(ADDR) ((ADDR) & 0x80000000) | |
132 | #define METHOD_PTR_FROM_VOFFSET(OFFSET) (0x80000000 + (OFFSET)) | |
133 | #define METHOD_PTR_TO_VOFFSET(ADDR) (~0x80000000 & (ADDR)) | |
134 | ||
9219021c | 135 | #endif /* CP_SUPPORT_H */ |