* configure.ac: Switch license to GPLv3.
[deliverable/binutils-gdb.git] / gdb / cp-support.h
CommitLineData
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
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
197e01b6
EZ
21 Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 Boston, MA 02110-1301, USA. */
de17c821 23
9219021c
DC
24#ifndef CP_SUPPORT_H
25#define CP_SUPPORT_H
26
1fcb5155
DC
27/* We need this for 'domain_enum', alas... */
28
29#include "symtab.h"
30
9219021c
DC
31/* Opaque declarations. */
32
b59661bd 33struct symbol;
9219021c
DC
34struct obstack;
35struct block;
4a4b3fed 36struct objfile;
362ff856 37struct type;
fb4c6eba 38struct demangle_component;
9219021c
DC
39
40/* This struct is designed to store data from using directives. It
41 says that names from namespace INNER should be visible within
42 namespace OUTER. OUTER should always be a strict initial substring
43 of INNER. These form a linked list; NEXT is the next element of
44 the list. */
45
46struct using_direct
47{
48 char *inner;
49 char *outer;
50 struct using_direct *next;
51};
52
53
54/* Functions from cp-support.c. */
55
fb4c6eba
DJ
56extern char *cp_canonicalize_string (const char *string);
57
31c27f77 58extern char *cp_class_name_from_physname (const char *physname);
de17c821
DJ
59
60extern char *method_name_from_physname (const char *physname);
9219021c
DC
61
62extern unsigned int cp_find_first_component (const char *name);
63
64extern unsigned int cp_entire_prefix_len (const char *name);
65
8d577d32
DC
66extern char *cp_func_name (const char *full_name);
67
68extern struct symbol **make_symbol_overload_list (const char *,
69 const char *);
9219021c 70
362ff856
MC
71extern struct type *cp_lookup_rtti_type (const char *name,
72 struct block *block);
73
9219021c
DC
74/* Functions/variables from cp-namespace.c. */
75
76extern unsigned char processing_has_namespace_info;
77
38d518c9 78extern const char *processing_current_prefix;
9219021c
DC
79
80extern int cp_is_anonymous (const char *namespace);
81
82extern void cp_add_using_directive (const char *name,
83 unsigned int outer_length,
84 unsigned int inner_length);
85
b9362cc7 86extern void cp_initialize_namespace (void);
9219021c
DC
87
88extern void cp_finalize_namespace (struct block *static_block,
89 struct obstack *obstack);
90
91extern void cp_set_block_scope (const struct symbol *symbol,
92 struct block *block,
93 struct obstack *obstack);
94
95extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol);
96
1fcb5155
DC
97extern struct symbol *cp_lookup_symbol_nonlocal (const char *name,
98 const char *linkage_name,
99 const struct block *block,
100 const domain_enum domain,
101 struct symtab **symtab);
102
103extern struct symbol *cp_lookup_symbol_namespace (const char *namespace,
104 const char *name,
105 const char *linkage_name,
106 const struct block *block,
107 const domain_enum domain,
108 struct symtab **symtab);
109
79c2c32d
DC
110extern struct type *cp_lookup_nested_type (struct type *parent_type,
111 const char *nested_name,
112 const struct block *block);
113
5c4e30ca
DC
114extern void cp_check_possible_namespace_symbols (const char *name,
115 struct objfile *objfile);
116
b368761e
DC
117struct type *cp_lookup_transparent_type (const char *name);
118
fb4c6eba
DJ
119/* Functions from cp-names.y. */
120
121extern struct demangle_component *cp_demangled_name_to_comp
122 (const char *demangled_name, void **memory_p, const char **errmsg);
123
124extern char *cp_comp_to_string (struct demangle_component *result,
125 int estimated_len);
126
5c4e30ca
DC
127/* The list of "maint cplus" commands. */
128
129extern struct cmd_list_element *maint_cplus_cmd_list;
130
d3cbe7ef
AC
131/* Pointer to member function. Depends on compiler implementation. */
132
133#define METHOD_PTR_IS_VIRTUAL(ADDR) ((ADDR) & 0x80000000)
134#define METHOD_PTR_FROM_VOFFSET(OFFSET) (0x80000000 + (OFFSET))
135#define METHOD_PTR_TO_VOFFSET(ADDR) (~0x80000000 & (ADDR))
136
9219021c 137#endif /* CP_SUPPORT_H */
This page took 0.323472 seconds and 4 git commands to generate.