xref: /openbsd/gnu/usr.bin/binutils/gdb/cp-support.h (revision 73471bf0)
1 /* Helper routines for C++ support in GDB.
2    Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
3 
4    Contributed by MontaVista Software.
5    Namespace support contributed by David Carlton.
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
11    the Free Software Foundation; either version 2 of the License, or
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
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 59 Temple Place - Suite 330,
22    Boston, MA 02111-1307, USA.  */
23 
24 #ifndef CP_SUPPORT_H
25 #define CP_SUPPORT_H
26 
27 /* We need this for 'domain_enum', alas...  */
28 
29 #include "symtab.h"
30 
31 /* Opaque declarations.  */
32 
33 struct symbol;
34 struct obstack;
35 struct block;
36 struct objfile;
37 struct type;
38 
39 /* This struct is designed to store data from using directives.  It
40    says that names from namespace INNER should be visible within
41    namespace OUTER.  OUTER should always be a strict initial substring
42    of INNER.  These form a linked list; NEXT is the next element of
43    the list.  */
44 
45 struct using_direct
46 {
47   char *inner;
48   char *outer;
49   struct using_direct *next;
50 };
51 
52 
53 /* Functions from cp-support.c.  */
54 
55 extern char *cp_class_name_from_physname (const char *physname);
56 
57 extern char *method_name_from_physname (const char *physname);
58 
59 extern unsigned int cp_find_first_component (const char *name);
60 
61 extern unsigned int cp_entire_prefix_len (const char *name);
62 
63 extern char *cp_func_name (const char *full_name);
64 
65 extern struct symbol **make_symbol_overload_list (const char *,
66 						  const char *);
67 
68 extern struct type *cp_lookup_rtti_type (const char *name,
69 					 struct block *block);
70 
71 /* Functions/variables from cp-namespace.c.  */
72 
73 extern unsigned char processing_has_namespace_info;
74 
75 extern const char *processing_current_prefix;
76 
77 extern int cp_is_anonymous (const char *namespace);
78 
79 extern void cp_add_using_directive (const char *name,
80 				    unsigned int outer_length,
81 				    unsigned int inner_length);
82 
83 extern void cp_initialize_namespace (void);
84 
85 extern void cp_finalize_namespace (struct block *static_block,
86 				   struct obstack *obstack);
87 
88 extern void cp_set_block_scope (const struct symbol *symbol,
89 				struct block *block,
90 				struct obstack *obstack);
91 
92 extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol);
93 
94 extern struct symbol *cp_lookup_symbol_nonlocal (const char *name,
95 						 const char *linkage_name,
96 						 const struct block *block,
97 						 const domain_enum domain,
98 						 struct symtab **symtab);
99 
100 extern struct symbol *cp_lookup_symbol_namespace (const char *namespace,
101 						  const char *name,
102 						  const char *linkage_name,
103 						  const struct block *block,
104 						  const domain_enum domain,
105 						  struct symtab **symtab);
106 
107 extern struct type *cp_lookup_nested_type (struct type *parent_type,
108 					   const char *nested_name,
109 					   const struct block *block);
110 
111 extern void cp_check_possible_namespace_symbols (const char *name,
112 						 struct objfile *objfile);
113 
114 struct type *cp_lookup_transparent_type (const char *name);
115 
116 /* The list of "maint cplus" commands.  */
117 
118 extern struct cmd_list_element *maint_cplus_cmd_list;
119 
120 #endif /* CP_SUPPORT_H */
121