1*b725ae77Skettenis /* Abstraction of GNU v2 abi.
2*b725ae77Skettenis
3*b725ae77Skettenis Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
4*b725ae77Skettenis
5*b725ae77Skettenis Contributed by Daniel Berlin <dberlin@redhat.com>
6*b725ae77Skettenis
7*b725ae77Skettenis This file is part of GDB.
8*b725ae77Skettenis
9*b725ae77Skettenis This program is free software; you can redistribute it and/or
10*b725ae77Skettenis modify
11*b725ae77Skettenis it under the terms of the GNU General Public License as published
12*b725ae77Skettenis by
13*b725ae77Skettenis the Free Software Foundation; either version 2 of the License, or
14*b725ae77Skettenis (at your option) any later version.
15*b725ae77Skettenis
16*b725ae77Skettenis This program is distributed in the hope that it will be useful,
17*b725ae77Skettenis but WITHOUT ANY WARRANTY; without even the implied warranty of
18*b725ae77Skettenis MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19*b725ae77Skettenis GNU General Public License for more details.
20*b725ae77Skettenis
21*b725ae77Skettenis You should have received a copy of the GNU General Public License
22*b725ae77Skettenis along with this program; if not, write to the Free Software
23*b725ae77Skettenis Foundation, Inc., 59 Temple Place - Suite 330,
24*b725ae77Skettenis Boston, MA 02111-1307, USA. */
25*b725ae77Skettenis
26*b725ae77Skettenis #include "defs.h"
27*b725ae77Skettenis #include "gdb_string.h"
28*b725ae77Skettenis #include "symtab.h"
29*b725ae77Skettenis #include "gdbtypes.h"
30*b725ae77Skettenis #include "value.h"
31*b725ae77Skettenis #include "demangle.h"
32*b725ae77Skettenis #include "cp-abi.h"
33*b725ae77Skettenis #include "cp-support.h"
34*b725ae77Skettenis
35*b725ae77Skettenis #include <ctype.h>
36*b725ae77Skettenis
37*b725ae77Skettenis struct cp_abi_ops gnu_v2_abi_ops;
38*b725ae77Skettenis
39*b725ae77Skettenis static int vb_match (struct type *, int, struct type *);
40*b725ae77Skettenis int gnuv2_baseclass_offset (struct type *type, int index, char *valaddr,
41*b725ae77Skettenis CORE_ADDR address);
42*b725ae77Skettenis
43*b725ae77Skettenis static enum dtor_kinds
gnuv2_is_destructor_name(const char * name)44*b725ae77Skettenis gnuv2_is_destructor_name (const char *name)
45*b725ae77Skettenis {
46*b725ae77Skettenis if ((name[0] == '_' && is_cplus_marker (name[1]) && name[2] == '_')
47*b725ae77Skettenis || strncmp (name, "__dt__", 6) == 0)
48*b725ae77Skettenis return complete_object_dtor;
49*b725ae77Skettenis else
50*b725ae77Skettenis return 0;
51*b725ae77Skettenis }
52*b725ae77Skettenis
53*b725ae77Skettenis static enum ctor_kinds
gnuv2_is_constructor_name(const char * name)54*b725ae77Skettenis gnuv2_is_constructor_name (const char *name)
55*b725ae77Skettenis {
56*b725ae77Skettenis if ((name[0] == '_' && name[1] == '_'
57*b725ae77Skettenis && (isdigit (name[2]) || strchr ("Qt", name[2])))
58*b725ae77Skettenis || strncmp (name, "__ct__", 6) == 0)
59*b725ae77Skettenis return complete_object_ctor;
60*b725ae77Skettenis else
61*b725ae77Skettenis return 0;
62*b725ae77Skettenis }
63*b725ae77Skettenis
64*b725ae77Skettenis static int
gnuv2_is_vtable_name(const char * name)65*b725ae77Skettenis gnuv2_is_vtable_name (const char *name)
66*b725ae77Skettenis {
67*b725ae77Skettenis return (((name)[0] == '_'
68*b725ae77Skettenis && (((name)[1] == 'V' && (name)[2] == 'T')
69*b725ae77Skettenis || ((name)[1] == 'v' && (name)[2] == 't'))
70*b725ae77Skettenis && is_cplus_marker ((name)[3])) ||
71*b725ae77Skettenis ((name)[0] == '_' && (name)[1] == '_'
72*b725ae77Skettenis && (name)[2] == 'v' && (name)[3] == 't' && (name)[4] == '_'));
73*b725ae77Skettenis }
74*b725ae77Skettenis
75*b725ae77Skettenis static int
gnuv2_is_operator_name(const char * name)76*b725ae77Skettenis gnuv2_is_operator_name (const char *name)
77*b725ae77Skettenis {
78*b725ae77Skettenis return strncmp (name, "operator", 8) == 0;
79*b725ae77Skettenis }
80*b725ae77Skettenis
81*b725ae77Skettenis
82*b725ae77Skettenis /* Return a virtual function as a value.
83*b725ae77Skettenis ARG1 is the object which provides the virtual function
84*b725ae77Skettenis table pointer. *ARG1P is side-effected in calling this function.
85*b725ae77Skettenis F is the list of member functions which contains the desired virtual
86*b725ae77Skettenis function.
87*b725ae77Skettenis J is an index into F which provides the desired virtual function.
88*b725ae77Skettenis
89*b725ae77Skettenis TYPE is the type in which F is located. */
90*b725ae77Skettenis static struct value *
gnuv2_virtual_fn_field(struct value ** arg1p,struct fn_field * f,int j,struct type * type,int offset)91*b725ae77Skettenis gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
92*b725ae77Skettenis struct type * type, int offset)
93*b725ae77Skettenis {
94*b725ae77Skettenis struct value *arg1 = *arg1p;
95*b725ae77Skettenis struct type *type1 = check_typedef (VALUE_TYPE (arg1));
96*b725ae77Skettenis
97*b725ae77Skettenis
98*b725ae77Skettenis struct type *entry_type;
99*b725ae77Skettenis /* First, get the virtual function table pointer. That comes
100*b725ae77Skettenis with a strange type, so cast it to type `pointer to long' (which
101*b725ae77Skettenis should serve just fine as a function type). Then, index into
102*b725ae77Skettenis the table, and convert final value to appropriate function type. */
103*b725ae77Skettenis struct value *entry;
104*b725ae77Skettenis struct value *vfn;
105*b725ae77Skettenis struct value *vtbl;
106*b725ae77Skettenis struct value *vi = value_from_longest (builtin_type_int,
107*b725ae77Skettenis (LONGEST) TYPE_FN_FIELD_VOFFSET (f, j));
108*b725ae77Skettenis struct type *fcontext = TYPE_FN_FIELD_FCONTEXT (f, j);
109*b725ae77Skettenis struct type *context;
110*b725ae77Skettenis if (fcontext == NULL)
111*b725ae77Skettenis /* We don't have an fcontext (e.g. the program was compiled with
112*b725ae77Skettenis g++ version 1). Try to get the vtbl from the TYPE_VPTR_BASETYPE.
113*b725ae77Skettenis This won't work right for multiple inheritance, but at least we
114*b725ae77Skettenis should do as well as GDB 3.x did. */
115*b725ae77Skettenis fcontext = TYPE_VPTR_BASETYPE (type);
116*b725ae77Skettenis context = lookup_pointer_type (fcontext);
117*b725ae77Skettenis /* Now context is a pointer to the basetype containing the vtbl. */
118*b725ae77Skettenis if (TYPE_TARGET_TYPE (context) != type1)
119*b725ae77Skettenis {
120*b725ae77Skettenis struct value *tmp = value_cast (context, value_addr (arg1));
121*b725ae77Skettenis arg1 = value_ind (tmp);
122*b725ae77Skettenis type1 = check_typedef (VALUE_TYPE (arg1));
123*b725ae77Skettenis }
124*b725ae77Skettenis
125*b725ae77Skettenis context = type1;
126*b725ae77Skettenis /* Now context is the basetype containing the vtbl. */
127*b725ae77Skettenis
128*b725ae77Skettenis /* This type may have been defined before its virtual function table
129*b725ae77Skettenis was. If so, fill in the virtual function table entry for the
130*b725ae77Skettenis type now. */
131*b725ae77Skettenis if (TYPE_VPTR_FIELDNO (context) < 0)
132*b725ae77Skettenis fill_in_vptr_fieldno (context);
133*b725ae77Skettenis
134*b725ae77Skettenis /* The virtual function table is now an array of structures
135*b725ae77Skettenis which have the form { int16 offset, delta; void *pfn; }. */
136*b725ae77Skettenis vtbl = value_primitive_field (arg1, 0, TYPE_VPTR_FIELDNO (context),
137*b725ae77Skettenis TYPE_VPTR_BASETYPE (context));
138*b725ae77Skettenis
139*b725ae77Skettenis /* With older versions of g++, the vtbl field pointed to an array
140*b725ae77Skettenis of structures. Nowadays it points directly to the structure. */
141*b725ae77Skettenis if (TYPE_CODE (VALUE_TYPE (vtbl)) == TYPE_CODE_PTR
142*b725ae77Skettenis && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (vtbl))) == TYPE_CODE_ARRAY)
143*b725ae77Skettenis {
144*b725ae77Skettenis /* Handle the case where the vtbl field points to an
145*b725ae77Skettenis array of structures. */
146*b725ae77Skettenis vtbl = value_ind (vtbl);
147*b725ae77Skettenis
148*b725ae77Skettenis /* Index into the virtual function table. This is hard-coded because
149*b725ae77Skettenis looking up a field is not cheap, and it may be important to save
150*b725ae77Skettenis time, e.g. if the user has set a conditional breakpoint calling
151*b725ae77Skettenis a virtual function. */
152*b725ae77Skettenis entry = value_subscript (vtbl, vi);
153*b725ae77Skettenis }
154*b725ae77Skettenis else
155*b725ae77Skettenis {
156*b725ae77Skettenis /* Handle the case where the vtbl field points directly to a structure. */
157*b725ae77Skettenis vtbl = value_add (vtbl, vi);
158*b725ae77Skettenis entry = value_ind (vtbl);
159*b725ae77Skettenis }
160*b725ae77Skettenis
161*b725ae77Skettenis entry_type = check_typedef (VALUE_TYPE (entry));
162*b725ae77Skettenis
163*b725ae77Skettenis if (TYPE_CODE (entry_type) == TYPE_CODE_STRUCT)
164*b725ae77Skettenis {
165*b725ae77Skettenis /* Move the `this' pointer according to the virtual function table. */
166*b725ae77Skettenis VALUE_OFFSET (arg1) += value_as_long (value_field (entry, 0));
167*b725ae77Skettenis
168*b725ae77Skettenis if (!VALUE_LAZY (arg1))
169*b725ae77Skettenis {
170*b725ae77Skettenis VALUE_LAZY (arg1) = 1;
171*b725ae77Skettenis value_fetch_lazy (arg1);
172*b725ae77Skettenis }
173*b725ae77Skettenis
174*b725ae77Skettenis vfn = value_field (entry, 2);
175*b725ae77Skettenis }
176*b725ae77Skettenis else if (TYPE_CODE (entry_type) == TYPE_CODE_PTR)
177*b725ae77Skettenis vfn = entry;
178*b725ae77Skettenis else
179*b725ae77Skettenis error ("I'm confused: virtual function table has bad type");
180*b725ae77Skettenis /* Reinstantiate the function pointer with the correct type. */
181*b725ae77Skettenis VALUE_TYPE (vfn) = lookup_pointer_type (TYPE_FN_FIELD_TYPE (f, j));
182*b725ae77Skettenis
183*b725ae77Skettenis *arg1p = arg1;
184*b725ae77Skettenis return vfn;
185*b725ae77Skettenis }
186*b725ae77Skettenis
187*b725ae77Skettenis
188*b725ae77Skettenis static struct type *
gnuv2_value_rtti_type(struct value * v,int * full,int * top,int * using_enc)189*b725ae77Skettenis gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
190*b725ae77Skettenis {
191*b725ae77Skettenis struct type *known_type;
192*b725ae77Skettenis struct type *rtti_type;
193*b725ae77Skettenis CORE_ADDR coreptr;
194*b725ae77Skettenis struct value *vp;
195*b725ae77Skettenis long top_offset = 0;
196*b725ae77Skettenis char rtti_type_name[256];
197*b725ae77Skettenis CORE_ADDR vtbl;
198*b725ae77Skettenis struct minimal_symbol *minsym;
199*b725ae77Skettenis struct symbol *sym;
200*b725ae77Skettenis char *demangled_name;
201*b725ae77Skettenis struct type *btype;
202*b725ae77Skettenis
203*b725ae77Skettenis if (full)
204*b725ae77Skettenis *full = 0;
205*b725ae77Skettenis if (top)
206*b725ae77Skettenis *top = -1;
207*b725ae77Skettenis if (using_enc)
208*b725ae77Skettenis *using_enc = 0;
209*b725ae77Skettenis
210*b725ae77Skettenis /* Get declared type */
211*b725ae77Skettenis known_type = VALUE_TYPE (v);
212*b725ae77Skettenis CHECK_TYPEDEF (known_type);
213*b725ae77Skettenis /* RTTI works only or class objects */
214*b725ae77Skettenis if (TYPE_CODE (known_type) != TYPE_CODE_CLASS)
215*b725ae77Skettenis return NULL;
216*b725ae77Skettenis
217*b725ae77Skettenis /* Plan on this changing in the future as i get around to setting
218*b725ae77Skettenis the vtables properly for G++ compiled stuff. Also, I'll be using
219*b725ae77Skettenis the type info functions, which are always right. Deal with it
220*b725ae77Skettenis until then. */
221*b725ae77Skettenis
222*b725ae77Skettenis /* If the type has no vptr fieldno, try to get it filled in */
223*b725ae77Skettenis if (TYPE_VPTR_FIELDNO(known_type) < 0)
224*b725ae77Skettenis fill_in_vptr_fieldno(known_type);
225*b725ae77Skettenis
226*b725ae77Skettenis /* If we still can't find one, give up */
227*b725ae77Skettenis if (TYPE_VPTR_FIELDNO(known_type) < 0)
228*b725ae77Skettenis return NULL;
229*b725ae77Skettenis
230*b725ae77Skettenis /* Make sure our basetype and known type match, otherwise, cast
231*b725ae77Skettenis so we can get at the vtable properly.
232*b725ae77Skettenis */
233*b725ae77Skettenis btype = TYPE_VPTR_BASETYPE (known_type);
234*b725ae77Skettenis CHECK_TYPEDEF (btype);
235*b725ae77Skettenis if (btype != known_type )
236*b725ae77Skettenis {
237*b725ae77Skettenis v = value_cast (btype, v);
238*b725ae77Skettenis if (using_enc)
239*b725ae77Skettenis *using_enc=1;
240*b725ae77Skettenis }
241*b725ae77Skettenis /*
242*b725ae77Skettenis We can't use value_ind here, because it would want to use RTTI, and
243*b725ae77Skettenis we'd waste a bunch of time figuring out we already know the type.
244*b725ae77Skettenis Besides, we don't care about the type, just the actual pointer
245*b725ae77Skettenis */
246*b725ae77Skettenis if (VALUE_ADDRESS (value_field (v, TYPE_VPTR_FIELDNO (known_type))) == 0)
247*b725ae77Skettenis return NULL;
248*b725ae77Skettenis
249*b725ae77Skettenis vtbl=value_as_address(value_field(v,TYPE_VPTR_FIELDNO(known_type)));
250*b725ae77Skettenis
251*b725ae77Skettenis /* Try to find a symbol that is the vtable */
252*b725ae77Skettenis minsym=lookup_minimal_symbol_by_pc(vtbl);
253*b725ae77Skettenis if (minsym==NULL
254*b725ae77Skettenis || (demangled_name=DEPRECATED_SYMBOL_NAME (minsym))==NULL
255*b725ae77Skettenis || !is_vtable_name (demangled_name))
256*b725ae77Skettenis return NULL;
257*b725ae77Skettenis
258*b725ae77Skettenis /* If we just skip the prefix, we get screwed by namespaces */
259*b725ae77Skettenis demangled_name=cplus_demangle(demangled_name,DMGL_PARAMS|DMGL_ANSI);
260*b725ae77Skettenis *(strchr(demangled_name,' '))=0;
261*b725ae77Skettenis
262*b725ae77Skettenis /* Lookup the type for the name */
263*b725ae77Skettenis /* FIXME: chastain/2003-11-26: block=NULL is bogus. See pr gdb/1465. */
264*b725ae77Skettenis rtti_type = cp_lookup_rtti_type (demangled_name, NULL);
265*b725ae77Skettenis if (rtti_type == NULL)
266*b725ae77Skettenis return NULL;
267*b725ae77Skettenis
268*b725ae77Skettenis if (TYPE_N_BASECLASSES(rtti_type) > 1 && full && (*full) != 1)
269*b725ae77Skettenis {
270*b725ae77Skettenis if (top)
271*b725ae77Skettenis *top=TYPE_BASECLASS_BITPOS(rtti_type,TYPE_VPTR_FIELDNO(rtti_type))/8;
272*b725ae77Skettenis if (top && ((*top) >0))
273*b725ae77Skettenis {
274*b725ae77Skettenis if (TYPE_LENGTH(rtti_type) > TYPE_LENGTH(known_type))
275*b725ae77Skettenis {
276*b725ae77Skettenis if (full)
277*b725ae77Skettenis *full=0;
278*b725ae77Skettenis }
279*b725ae77Skettenis else
280*b725ae77Skettenis {
281*b725ae77Skettenis if (full)
282*b725ae77Skettenis *full=1;
283*b725ae77Skettenis }
284*b725ae77Skettenis }
285*b725ae77Skettenis }
286*b725ae77Skettenis else
287*b725ae77Skettenis {
288*b725ae77Skettenis if (full)
289*b725ae77Skettenis *full=1;
290*b725ae77Skettenis }
291*b725ae77Skettenis
292*b725ae77Skettenis return rtti_type;
293*b725ae77Skettenis }
294*b725ae77Skettenis
295*b725ae77Skettenis /* Return true if the INDEXth field of TYPE is a virtual baseclass
296*b725ae77Skettenis pointer which is for the base class whose type is BASECLASS. */
297*b725ae77Skettenis
298*b725ae77Skettenis static int
vb_match(struct type * type,int index,struct type * basetype)299*b725ae77Skettenis vb_match (struct type *type, int index, struct type *basetype)
300*b725ae77Skettenis {
301*b725ae77Skettenis struct type *fieldtype;
302*b725ae77Skettenis char *name = TYPE_FIELD_NAME (type, index);
303*b725ae77Skettenis char *field_class_name = NULL;
304*b725ae77Skettenis
305*b725ae77Skettenis if (*name != '_')
306*b725ae77Skettenis return 0;
307*b725ae77Skettenis /* gcc 2.4 uses _vb$. */
308*b725ae77Skettenis if (name[1] == 'v' && name[2] == 'b' && is_cplus_marker (name[3]))
309*b725ae77Skettenis field_class_name = name + 4;
310*b725ae77Skettenis /* gcc 2.5 will use __vb_. */
311*b725ae77Skettenis if (name[1] == '_' && name[2] == 'v' && name[3] == 'b' && name[4] == '_')
312*b725ae77Skettenis field_class_name = name + 5;
313*b725ae77Skettenis
314*b725ae77Skettenis if (field_class_name == NULL)
315*b725ae77Skettenis /* This field is not a virtual base class pointer. */
316*b725ae77Skettenis return 0;
317*b725ae77Skettenis
318*b725ae77Skettenis /* It's a virtual baseclass pointer, now we just need to find out whether
319*b725ae77Skettenis it is for this baseclass. */
320*b725ae77Skettenis fieldtype = TYPE_FIELD_TYPE (type, index);
321*b725ae77Skettenis if (fieldtype == NULL
322*b725ae77Skettenis || TYPE_CODE (fieldtype) != TYPE_CODE_PTR)
323*b725ae77Skettenis /* "Can't happen". */
324*b725ae77Skettenis return 0;
325*b725ae77Skettenis
326*b725ae77Skettenis /* What we check for is that either the types are equal (needed for
327*b725ae77Skettenis nameless types) or have the same name. This is ugly, and a more
328*b725ae77Skettenis elegant solution should be devised (which would probably just push
329*b725ae77Skettenis the ugliness into symbol reading unless we change the stabs format). */
330*b725ae77Skettenis if (TYPE_TARGET_TYPE (fieldtype) == basetype)
331*b725ae77Skettenis return 1;
332*b725ae77Skettenis
333*b725ae77Skettenis if (TYPE_NAME (basetype) != NULL
334*b725ae77Skettenis && TYPE_NAME (TYPE_TARGET_TYPE (fieldtype)) != NULL
335*b725ae77Skettenis && strcmp (TYPE_NAME (basetype),
336*b725ae77Skettenis TYPE_NAME (TYPE_TARGET_TYPE (fieldtype))) == 0)
337*b725ae77Skettenis return 1;
338*b725ae77Skettenis return 0;
339*b725ae77Skettenis }
340*b725ae77Skettenis
341*b725ae77Skettenis /* Compute the offset of the baseclass which is
342*b725ae77Skettenis the INDEXth baseclass of class TYPE,
343*b725ae77Skettenis for value at VALADDR (in host) at ADDRESS (in target).
344*b725ae77Skettenis The result is the offset of the baseclass value relative
345*b725ae77Skettenis to (the address of)(ARG) + OFFSET.
346*b725ae77Skettenis
347*b725ae77Skettenis -1 is returned on error. */
348*b725ae77Skettenis
349*b725ae77Skettenis int
gnuv2_baseclass_offset(struct type * type,int index,char * valaddr,CORE_ADDR address)350*b725ae77Skettenis gnuv2_baseclass_offset (struct type *type, int index, char *valaddr,
351*b725ae77Skettenis CORE_ADDR address)
352*b725ae77Skettenis {
353*b725ae77Skettenis struct type *basetype = TYPE_BASECLASS (type, index);
354*b725ae77Skettenis
355*b725ae77Skettenis if (BASETYPE_VIA_VIRTUAL (type, index))
356*b725ae77Skettenis {
357*b725ae77Skettenis /* Must hunt for the pointer to this virtual baseclass. */
358*b725ae77Skettenis int i, len = TYPE_NFIELDS (type);
359*b725ae77Skettenis int n_baseclasses = TYPE_N_BASECLASSES (type);
360*b725ae77Skettenis
361*b725ae77Skettenis /* First look for the virtual baseclass pointer
362*b725ae77Skettenis in the fields. */
363*b725ae77Skettenis for (i = n_baseclasses; i < len; i++)
364*b725ae77Skettenis {
365*b725ae77Skettenis if (vb_match (type, i, basetype))
366*b725ae77Skettenis {
367*b725ae77Skettenis CORE_ADDR addr
368*b725ae77Skettenis = unpack_pointer (TYPE_FIELD_TYPE (type, i),
369*b725ae77Skettenis valaddr + (TYPE_FIELD_BITPOS (type, i) / 8));
370*b725ae77Skettenis
371*b725ae77Skettenis return addr - (LONGEST) address;
372*b725ae77Skettenis }
373*b725ae77Skettenis }
374*b725ae77Skettenis /* Not in the fields, so try looking through the baseclasses. */
375*b725ae77Skettenis for (i = index + 1; i < n_baseclasses; i++)
376*b725ae77Skettenis {
377*b725ae77Skettenis int boffset =
378*b725ae77Skettenis baseclass_offset (type, i, valaddr, address);
379*b725ae77Skettenis if (boffset)
380*b725ae77Skettenis return boffset;
381*b725ae77Skettenis }
382*b725ae77Skettenis /* Not found. */
383*b725ae77Skettenis return -1;
384*b725ae77Skettenis }
385*b725ae77Skettenis
386*b725ae77Skettenis /* Baseclass is easily computed. */
387*b725ae77Skettenis return TYPE_BASECLASS_BITPOS (type, index) / 8;
388*b725ae77Skettenis }
389*b725ae77Skettenis
390*b725ae77Skettenis static void
init_gnuv2_ops(void)391*b725ae77Skettenis init_gnuv2_ops (void)
392*b725ae77Skettenis {
393*b725ae77Skettenis gnu_v2_abi_ops.shortname = "gnu-v2";
394*b725ae77Skettenis gnu_v2_abi_ops.longname = "GNU G++ Version 2 ABI";
395*b725ae77Skettenis gnu_v2_abi_ops.doc = "G++ Version 2 ABI";
396*b725ae77Skettenis gnu_v2_abi_ops.is_destructor_name = gnuv2_is_destructor_name;
397*b725ae77Skettenis gnu_v2_abi_ops.is_constructor_name = gnuv2_is_constructor_name;
398*b725ae77Skettenis gnu_v2_abi_ops.is_vtable_name = gnuv2_is_vtable_name;
399*b725ae77Skettenis gnu_v2_abi_ops.is_operator_name = gnuv2_is_operator_name;
400*b725ae77Skettenis gnu_v2_abi_ops.virtual_fn_field = gnuv2_virtual_fn_field;
401*b725ae77Skettenis gnu_v2_abi_ops.rtti_type = gnuv2_value_rtti_type;
402*b725ae77Skettenis gnu_v2_abi_ops.baseclass_offset = gnuv2_baseclass_offset;
403*b725ae77Skettenis }
404*b725ae77Skettenis
405*b725ae77Skettenis extern initialize_file_ftype _initialize_gnu_v2_abi; /* -Wmissing-prototypes */
406*b725ae77Skettenis
407*b725ae77Skettenis void
_initialize_gnu_v2_abi(void)408*b725ae77Skettenis _initialize_gnu_v2_abi (void)
409*b725ae77Skettenis {
410*b725ae77Skettenis init_gnuv2_ops ();
411*b725ae77Skettenis register_cp_abi (&gnu_v2_abi_ops);
412*b725ae77Skettenis set_cp_abi_as_auto_default (gnu_v2_abi_ops.shortname);
413*b725ae77Skettenis }
414