1 /* Abstraction of various C++ ABI's we support, and the info we need
3 Contributed by Daniel Berlin <dberlin@redhat.com>
4 Copyright 2001 Free Software Foundation, Inc.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or
10 it under the terms of the GNU General Public License as published
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. */
28 /* Kinds of constructors. All these values are guaranteed to be
32 /* Initialize a complete object, including virtual bases, using
33 memory provided by caller. */
34 complete_object_ctor
= 1,
36 /* Initialize a base object of some larger object. */
39 /* An allocating complete-object constructor. */
40 complete_object_allocating_ctor
44 /* Kinds of destructors. All these values are guaranteed to be
48 /* A destructor which finalizes the entire object, and then calls
49 `delete' on its storage. */
52 /* A destructor which finalizes the entire object, but does not call
56 /* A destructor which finalizes a subobject of some larger object. */
63 const char *shortname
;
67 /* The functions here that attempt to determine what sort of thing a
68 mangled name refers to may well be revised in the future. It
69 would certainly be cleaner to carry this information explicitly
70 in GDB's data structures than to derive it from the mangled name. */
72 /* Return non-zero iff NAME is the mangled name of a constructor.
73 Actually, return an `enum ctor_kind' value describing what *kind*
74 of constructor it is. */
75 enum ctor_kinds (*is_constructor_name
) (const char *name
);
77 /* Return non-zero iff NAME is the mangled name of a destructor.
78 Actually, return an `enum dtor_kind' value describing what *kind*
79 of destructor it is. */
80 enum dtor_kinds (*is_destructor_name
) (const char *name
);
82 /* Return non-zero iff NAME is the mangled name of a vtable. */
83 int (*is_vtable_name
) (const char *name
);
85 /* Return non-zero iff NAME is the un-mangled name of an operator,
86 perhaps scoped within some class. */
87 int (*is_operator_name
) (const char *name
);
89 value_ptr (*virtual_fn_field
) (value_ptr
* arg1p
, struct fn_field
* f
,
90 int j
, struct type
* type
, int offset
);
92 /* Find the real run-time type of a value using RTTI.
93 * V is a pointer to the value.
94 * A pointer to the struct type entry of the run-time type
96 * FULL is a flag that is set only if the value V includes
97 * the entire contents of an object of the RTTI type.
98 * TOP is the offset to the top of the enclosing object of
99 * the real run-time type. This offset may be for the embedded
100 * object, or for the enclosing object of V.
101 * USING_ENC is the flag that distinguishes the two cases.
102 * If it is 1, then the offset is for the enclosing object,
103 * otherwise for the embedded object.
107 struct type
*(*rtti_type
) (value_ptr v
, int *full
, int *top
,
112 extern struct cp_abi_ops
*cp_abis
;
114 extern int num_cp_abis
;
116 extern struct cp_abi_ops current_cp_abi
;
118 extern enum ctor_kinds
is_constructor_name (const char *name
);
119 extern enum dtor_kinds
is_destructor_name (const char *name
);
120 extern int is_vtable_name (const char *name
);
121 extern int is_operator_name (const char *name
);
122 extern value_ptr
value_virtual_fn_field (value_ptr
* arg1p
,
123 struct fn_field
*f
, int j
,
124 struct type
*type
, int offset
);
125 extern struct type
*value_rtti_type (value_ptr v
, int *full
, int *top
,
127 extern int register_cp_abi (struct cp_abi_ops abi
);
128 extern int switch_to_cp_abi (const char *short_name
);