1 /* Support for printing C++ values for GDB, the GNU debugger.
2 Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
4 Free Software Foundation, Inc.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
24 #include "gdb_obstack.h"
27 #include "expression.h"
33 #include "gdb_string.h"
38 /* Indication of presence of HP-compiled object files */
39 extern int hp_som_som_object_present
; /* defined in symtab.c */
42 int vtblprint
; /* Controls printing of vtbl's */
43 int objectprint
; /* Controls looking up an object's derived type
44 using what we find in its vtables. */
45 int static_field_print
; /* Controls printing of static fields. */
47 static struct obstack dont_print_vb_obstack
;
48 static struct obstack dont_print_statmem_obstack
;
50 extern void _initialize_cp_valprint (void);
52 static void cp_print_static_field (struct type
*, struct value
*,
53 struct ui_file
*, int, int,
54 enum val_prettyprint
);
56 static void cp_print_value (struct type
*, struct type
*, char *, int,
57 CORE_ADDR
, struct ui_file
*, int, int,
58 enum val_prettyprint
, struct type
**);
60 static void cp_print_hpacc_virtual_table_entries (struct type
*, int *,
62 struct ui_file
*, int,
64 enum val_prettyprint
);
68 cp_print_class_method (char *valaddr
,
70 struct ui_file
*stream
)
73 struct fn_field
*f
= NULL
;
82 struct type
*target_type
= check_typedef (TYPE_TARGET_TYPE (type
));
84 domain
= TYPE_DOMAIN_TYPE (target_type
);
85 if (domain
== (struct type
*) NULL
)
87 fprintf_filtered (stream
, "<unknown>");
90 addr
= unpack_pointer (lookup_pointer_type (builtin_type_void
), valaddr
);
91 if (METHOD_PTR_IS_VIRTUAL (addr
))
93 offset
= METHOD_PTR_TO_VOFFSET (addr
);
94 len
= TYPE_NFN_FIELDS (domain
);
95 for (i
= 0; i
< len
; i
++)
97 f
= TYPE_FN_FIELDLIST1 (domain
, i
);
98 len2
= TYPE_FN_FIELDLIST_LENGTH (domain
, i
);
100 check_stub_method_group (domain
, i
);
101 for (j
= 0; j
< len2
; j
++)
103 if (TYPE_FN_FIELD_VOFFSET (f
, j
) == offset
)
113 sym
= find_pc_function (addr
);
116 /* 1997-08-01 Currently unsupported with HP aCC */
117 if (hp_som_som_object_present
)
119 fputs_filtered ("?? <not supported with HP aCC>", stream
);
122 error ("invalid pointer to member function");
124 len
= TYPE_NFN_FIELDS (domain
);
125 for (i
= 0; i
< len
; i
++)
127 f
= TYPE_FN_FIELDLIST1 (domain
, i
);
128 len2
= TYPE_FN_FIELDLIST_LENGTH (domain
, i
);
130 check_stub_method_group (domain
, i
);
131 for (j
= 0; j
< len2
; j
++)
133 if (STREQ (SYMBOL_NAME (sym
), TYPE_FN_FIELD_PHYSNAME (f
, j
)))
141 char *demangled_name
;
143 fprintf_filtered (stream
, "&");
144 fprintf_filtered (stream
, kind
);
145 demangled_name
= cplus_demangle (TYPE_FN_FIELD_PHYSNAME (f
, j
),
146 DMGL_ANSI
| DMGL_PARAMS
);
147 if (demangled_name
== NULL
)
148 fprintf_filtered (stream
, "<badly mangled name %s>",
149 TYPE_FN_FIELD_PHYSNAME (f
, j
));
152 fputs_filtered (demangled_name
, stream
);
153 xfree (demangled_name
);
158 fprintf_filtered (stream
, "(");
159 type_print (type
, "", stream
, -1);
160 fprintf_filtered (stream
, ") %d", (int) addr
>> 3);
164 /* GCC versions after 2.4.5 use this. */
165 const char vtbl_ptr_name
[] = "__vtbl_ptr_type";
167 /* HP aCC uses different names. */
168 const char hpacc_vtbl_ptr_name
[] = "__vfp";
169 const char hpacc_vtbl_ptr_type_name
[] = "__vftyp";
171 /* Return truth value for assertion that TYPE is of the type
172 "pointer to virtual function". */
175 cp_is_vtbl_ptr_type (struct type
*type
)
177 char *typename
= type_name_no_tag (type
);
179 return (typename
!= NULL
&& !strcmp (typename
, vtbl_ptr_name
));
182 /* Return truth value for the assertion that TYPE is of the type
183 "pointer to virtual function table". */
186 cp_is_vtbl_member (struct type
*type
)
188 /* With older versions of g++, the vtbl field pointed to an array
189 of structures. Nowadays it points directly to the structure. */
190 if (TYPE_CODE (type
) == TYPE_CODE_PTR
)
192 type
= TYPE_TARGET_TYPE (type
);
193 if (TYPE_CODE (type
) == TYPE_CODE_ARRAY
)
195 type
= TYPE_TARGET_TYPE (type
);
196 if (TYPE_CODE (type
) == TYPE_CODE_STRUCT
/* if not using thunks */
197 || TYPE_CODE (type
) == TYPE_CODE_PTR
) /* if using thunks */
199 /* Virtual functions tables are full of pointers
200 to virtual functions. */
201 return cp_is_vtbl_ptr_type (type
);
204 else if (TYPE_CODE (type
) == TYPE_CODE_STRUCT
) /* if not using thunks */
206 return cp_is_vtbl_ptr_type (type
);
208 else if (TYPE_CODE (type
) == TYPE_CODE_PTR
) /* if using thunks */
210 /* The type name of the thunk pointer is NULL when using dwarf2.
211 We could test for a pointer to a function, but there is
212 no type info for the virtual table either, so it wont help. */
213 return cp_is_vtbl_ptr_type (type
);
219 /* Mutually recursive subroutines of cp_print_value and c_val_print to
220 print out a structure's fields: cp_print_value_fields and cp_print_value.
222 TYPE, VALADDR, ADDRESS, STREAM, RECURSE, and PRETTY have the
223 same meanings as in cp_print_value and c_val_print.
225 2nd argument REAL_TYPE is used to carry over the type of the derived
226 class across the recursion to base classes.
228 DONT_PRINT is an array of baseclass types that we
229 should not print, or zero if called from top level. */
232 cp_print_value_fields (struct type
*type
, struct type
*real_type
, char *valaddr
,
233 int offset
, CORE_ADDR address
, struct ui_file
*stream
,
234 int format
, int recurse
, enum val_prettyprint pretty
,
235 struct type
**dont_print_vb
, int dont_print_statmem
)
237 int i
, len
, n_baseclasses
;
238 struct obstack tmp_obstack
;
239 char *last_dont_print
= obstack_next_free (&dont_print_statmem_obstack
);
242 CHECK_TYPEDEF (type
);
244 fprintf_filtered (stream
, "{");
245 len
= TYPE_NFIELDS (type
);
246 n_baseclasses
= TYPE_N_BASECLASSES (type
);
248 /* First, print out baseclasses such that we don't print
249 duplicates of virtual baseclasses. */
251 if (n_baseclasses
> 0)
252 cp_print_value (type
, real_type
, valaddr
, offset
, address
, stream
,
253 format
, recurse
+ 1, pretty
, dont_print_vb
);
255 /* Second, print out data fields */
257 /* If there are no data fields, or if the only field is the
258 * vtbl pointer, skip this part */
259 if ((len
== n_baseclasses
)
260 || ((len
- n_baseclasses
== 1)
261 && TYPE_HAS_VTABLE (type
)
262 && STREQN (TYPE_FIELD_NAME (type
, n_baseclasses
),
263 hpacc_vtbl_ptr_name
, 5))
265 fprintf_filtered (stream
, "<No data fields>");
268 extern int inspect_it
;
270 if (dont_print_statmem
== 0)
272 /* If we're at top level, carve out a completely fresh
273 chunk of the obstack and use that until this particular
274 invocation returns. */
275 tmp_obstack
= dont_print_statmem_obstack
;
276 obstack_finish (&dont_print_statmem_obstack
);
279 for (i
= n_baseclasses
; i
< len
; i
++)
281 /* If requested, skip printing of static fields. */
282 if (!static_field_print
&& TYPE_FIELD_STATIC (type
, i
))
285 /* If a vtable pointer appears, we'll print it out later */
286 if (TYPE_HAS_VTABLE (type
)
287 && STREQN (TYPE_FIELD_NAME (type
, i
), hpacc_vtbl_ptr_name
, 5))
291 fprintf_filtered (stream
, ", ");
292 else if (n_baseclasses
> 0)
296 fprintf_filtered (stream
, "\n");
297 print_spaces_filtered (2 + 2 * recurse
, stream
);
298 fputs_filtered ("members of ", stream
);
299 fputs_filtered (type_name_no_tag (type
), stream
);
300 fputs_filtered (": ", stream
);
307 fprintf_filtered (stream
, "\n");
308 print_spaces_filtered (2 + 2 * recurse
, stream
);
312 wrap_here (n_spaces (2 + 2 * recurse
));
316 if (TYPE_CODE (TYPE_FIELD_TYPE (type
, i
)) == TYPE_CODE_PTR
)
317 fputs_filtered ("\"( ptr \"", stream
);
319 fputs_filtered ("\"( nodef \"", stream
);
320 if (TYPE_FIELD_STATIC (type
, i
))
321 fputs_filtered ("static ", stream
);
322 fprintf_symbol_filtered (stream
, TYPE_FIELD_NAME (type
, i
),
324 DMGL_PARAMS
| DMGL_ANSI
);
325 fputs_filtered ("\" \"", stream
);
326 fprintf_symbol_filtered (stream
, TYPE_FIELD_NAME (type
, i
),
328 DMGL_PARAMS
| DMGL_ANSI
);
329 fputs_filtered ("\") \"", stream
);
333 annotate_field_begin (TYPE_FIELD_TYPE (type
, i
));
335 if (TYPE_FIELD_STATIC (type
, i
))
336 fputs_filtered ("static ", stream
);
337 fprintf_symbol_filtered (stream
, TYPE_FIELD_NAME (type
, i
),
339 DMGL_PARAMS
| DMGL_ANSI
);
340 annotate_field_name_end ();
341 /* do not print leading '=' in case of anonymous unions */
342 if (strcmp (TYPE_FIELD_NAME (type
, i
), ""))
343 fputs_filtered (" = ", stream
);
344 annotate_field_value ();
347 if (!TYPE_FIELD_STATIC (type
, i
) && TYPE_FIELD_PACKED (type
, i
))
351 /* Bitfields require special handling, especially due to byte
353 if (TYPE_FIELD_IGNORE (type
, i
))
355 fputs_filtered ("<optimized out or zero length>", stream
);
359 v
= value_from_longest
360 (TYPE_FIELD_TYPE (type
, i
),
361 unpack_field_as_long (type
, valaddr
+ offset
, i
));
363 val_print (TYPE_FIELD_TYPE (type
, i
), VALUE_CONTENTS (v
),
364 0, 0, stream
, format
, 0, recurse
+ 1, pretty
);
369 if (TYPE_FIELD_IGNORE (type
, i
))
371 fputs_filtered ("<optimized out or zero length>", stream
);
373 else if (TYPE_FIELD_STATIC (type
, i
))
375 struct value
*v
= value_static_field (type
, i
);
377 fputs_filtered ("<optimized out>", stream
);
379 cp_print_static_field (TYPE_FIELD_TYPE (type
, i
), v
,
380 stream
, format
, recurse
+ 1,
385 val_print (TYPE_FIELD_TYPE (type
, i
),
386 valaddr
, offset
+ TYPE_FIELD_BITPOS (type
, i
) / 8,
387 address
+ TYPE_FIELD_BITPOS (type
, i
) / 8,
388 stream
, format
, 0, recurse
+ 1, pretty
);
391 annotate_field_end ();
394 if (dont_print_statmem
== 0)
396 /* Free the space used to deal with the printing
397 of the members from top level. */
398 obstack_free (&dont_print_statmem_obstack
, last_dont_print
);
399 dont_print_statmem_obstack
= tmp_obstack
;
404 fprintf_filtered (stream
, "\n");
405 print_spaces_filtered (2 * recurse
, stream
);
407 } /* if there are data fields */
408 /* Now print out the virtual table pointer if there is one */
409 if (TYPE_HAS_VTABLE (type
)
410 && STREQN (TYPE_FIELD_NAME (type
, n_baseclasses
),
415 /* First get the virtual table pointer and print it out */
418 fputs_filtered ("__vfp = ", stream
);
421 fputs_filtered (", Virtual table at ", stream
);
423 /* pai: FIXME 32x64 problem? */
424 /* Not sure what the best notation is in the case where there is no
426 v
= value_from_pointer (lookup_pointer_type (builtin_type_unsigned_long
),
427 *(unsigned long *) (valaddr
+ offset
));
429 val_print (VALUE_TYPE (v
), VALUE_CONTENTS (v
), 0, 0,
430 stream
, format
, 0, recurse
+ 1, pretty
);
435 /* Print out function pointers in vtable. */
437 /* FIXME: then-clause is for non-RRBC layout of virtual
438 * table. The RRBC case in the else-clause is yet to be
439 * implemented. The if (1) below should be changed to a
440 * test for whether the executable we have was compiled
441 * with a version of HP aCC that doesn't have RRBC
446 /* no RRBC support; function pointers embedded directly
449 int vfuncs
= count_virtual_fns (real_type
);
451 fputs_filtered (" {", stream
);
453 /* FIXME : doesn't work at present */
455 fprintf_filtered (stream
, "%d entr%s: ", vfuncs
,
456 vfuncs
== 1 ? "y" : "ies");
458 fputs_filtered ("not implemented", stream
);
463 /* recursive function that prints all virtual function entries */
465 cp_print_hpacc_virtual_table_entries (real_type
, &vfuncs
, v
,
466 stream
, format
, recurse
,
469 fputs_filtered ("}", stream
);
470 } /* non-RRBC case */
473 /* FIXME -- see comments above */
474 /* RRBC support present; function pointers are found
475 * by indirection through the class segment entries. */
483 fprintf_filtered (stream
, "\n");
484 print_spaces_filtered (2 * recurse
, stream
);
487 } /* if vtable exists */
489 fprintf_filtered (stream
, "}");
492 /* Special val_print routine to avoid printing multiple copies of virtual
496 cp_print_value (struct type
*type
, struct type
*real_type
, char *valaddr
,
497 int offset
, CORE_ADDR address
, struct ui_file
*stream
,
498 int format
, int recurse
, enum val_prettyprint pretty
,
499 struct type
**dont_print_vb
)
501 struct obstack tmp_obstack
;
502 struct type
**last_dont_print
503 = (struct type
**) obstack_next_free (&dont_print_vb_obstack
);
504 int i
, n_baseclasses
= TYPE_N_BASECLASSES (type
);
506 struct type
*thistype
;
508 if (dont_print_vb
== 0)
510 /* If we're at top level, carve out a completely fresh
511 chunk of the obstack and use that until this particular
512 invocation returns. */
513 tmp_obstack
= dont_print_vb_obstack
;
514 /* Bump up the high-water mark. Now alpha is omega. */
515 obstack_finish (&dont_print_vb_obstack
);
518 for (i
= 0; i
< n_baseclasses
; i
++)
522 struct type
*baseclass
= check_typedef (TYPE_BASECLASS (type
, i
));
523 char *basename
= TYPE_NAME (baseclass
);
526 if (BASETYPE_VIA_VIRTUAL (type
, i
))
528 struct type
**first_dont_print
529 = (struct type
**) obstack_base (&dont_print_vb_obstack
);
531 int j
= (struct type
**) obstack_next_free (&dont_print_vb_obstack
)
535 if (baseclass
== first_dont_print
[j
])
538 obstack_ptr_grow (&dont_print_vb_obstack
, baseclass
);
542 thistype
= real_type
;
543 if (TYPE_HAS_VTABLE (type
) && BASETYPE_VIA_VIRTUAL (type
, i
))
545 /* Assume HP/Taligent runtime convention */
546 find_rt_vbase_offset (type
, TYPE_BASECLASS (type
, i
),
547 valaddr
, offset
, &boffset
, &skip
);
549 error ("Virtual base class offset not found from vtable while"
551 base_valaddr
= valaddr
;
555 boffset
= baseclass_offset (type
, i
,
558 skip
= ((boffset
== -1) || (boffset
+ offset
) < 0) ? 1 : -1;
560 if (BASETYPE_VIA_VIRTUAL (type
, i
))
562 /* The virtual base class pointer might have been
563 clobbered by the user program. Make sure that it
564 still points to a valid memory location. */
567 && ((boffset
+ offset
) < 0
568 || (boffset
+ offset
) >= TYPE_LENGTH (type
)))
570 /* FIXME (alloca): unsafe if baseclass is really really large. */
571 base_valaddr
= (char *) alloca (TYPE_LENGTH (baseclass
));
572 if (target_read_memory (address
+ offset
+ boffset
, base_valaddr
,
573 TYPE_LENGTH (baseclass
)) != 0)
577 thistype
= baseclass
;
580 base_valaddr
= valaddr
;
583 base_valaddr
= valaddr
;
586 /* now do the printing */
589 fprintf_filtered (stream
, "\n");
590 print_spaces_filtered (2 * recurse
, stream
);
592 fputs_filtered ("<", stream
);
593 /* Not sure what the best notation is in the case where there is no
595 fputs_filtered (basename
? basename
: "", stream
);
596 fputs_filtered ("> = ", stream
);
600 fprintf_filtered (stream
, "<invalid address>");
602 cp_print_value_fields (baseclass
, thistype
, base_valaddr
,
603 thisoffset
+ boffset
, address
, stream
, format
,
606 obstack_base (&dont_print_vb_obstack
)),
608 fputs_filtered (", ", stream
);
614 if (dont_print_vb
== 0)
616 /* Free the space used to deal with the printing
617 of this type from top level. */
618 obstack_free (&dont_print_vb_obstack
, last_dont_print
);
619 /* Reset watermark so that we can continue protecting
620 ourselves from whatever we were protecting ourselves. */
621 dont_print_vb_obstack
= tmp_obstack
;
625 /* Print value of a static member.
626 To avoid infinite recursion when printing a class that contains
627 a static instance of the class, we keep the addresses of all printed
628 static member classes in an obstack and refuse to print them more
631 VAL contains the value to print, TYPE, STREAM, RECURSE, and PRETTY
632 have the same meanings as in c_val_print. */
635 cp_print_static_field (struct type
*type
,
637 struct ui_file
*stream
,
640 enum val_prettyprint pretty
)
642 if (TYPE_CODE (type
) == TYPE_CODE_STRUCT
)
644 CORE_ADDR
*first_dont_print
;
648 = (CORE_ADDR
*) obstack_base (&dont_print_statmem_obstack
);
649 i
= (CORE_ADDR
*) obstack_next_free (&dont_print_statmem_obstack
)
654 if (VALUE_ADDRESS (val
) == first_dont_print
[i
])
656 fputs_filtered ("<same as static member of an already"
663 obstack_grow (&dont_print_statmem_obstack
, (char *) &VALUE_ADDRESS (val
),
666 CHECK_TYPEDEF (type
);
667 cp_print_value_fields (type
, type
, VALUE_CONTENTS_ALL (val
),
668 VALUE_EMBEDDED_OFFSET (val
), VALUE_ADDRESS (val
),
669 stream
, format
, recurse
, pretty
, NULL
, 1);
672 val_print (type
, VALUE_CONTENTS_ALL (val
),
673 VALUE_EMBEDDED_OFFSET (val
), VALUE_ADDRESS (val
),
674 stream
, format
, 0, recurse
, pretty
);
678 cp_print_class_member (char *valaddr
, struct type
*domain
,
679 struct ui_file
*stream
, char *prefix
)
682 /* VAL is a byte offset into the structure type DOMAIN.
683 Find the name of the field for that offset and
687 register unsigned int i
;
688 unsigned len
= TYPE_NFIELDS (domain
);
690 /* @@ Make VAL into bit offset */
692 /* Note: HP aCC generates offsets that are the real byte offsets added
693 to a constant bias 0x20000000 (1 << 29). This constant bias gets
694 shifted out in the code below -- joyous happenstance! */
696 /* Note: HP cfront uses a constant bias of 1; if we support this
697 compiler ever, we will have to adjust the computation below */
699 LONGEST val
= unpack_long (builtin_type_int
, valaddr
) << 3;
700 for (i
= TYPE_N_BASECLASSES (domain
); i
< len
; i
++)
702 int bitpos
= TYPE_FIELD_BITPOS (domain
, i
);
706 if (val
< bitpos
&& i
!= 0)
708 /* Somehow pointing into a field. */
710 extra
= (val
- TYPE_FIELD_BITPOS (domain
, i
));
721 fprintf_filtered (stream
, prefix
);
722 name
= type_name_no_tag (domain
);
724 fputs_filtered (name
, stream
);
726 c_type_print_base (domain
, stream
, 0, 0);
727 fprintf_filtered (stream
, "::");
728 fputs_filtered (TYPE_FIELD_NAME (domain
, i
), stream
);
730 fprintf_filtered (stream
, " + %d bytes", extra
);
732 fprintf_filtered (stream
, " (offset in bits)");
735 fprintf_filtered (stream
, "%ld", (long) (val
>> 3));
739 /* This function prints out virtual table entries for a class; it
740 * recurses on the base classes to find all virtual functions
741 * available in a class.
743 * pai/1997-05-21 Note: As the name suggests, it's currently
744 * implemented for HP aCC runtime only. g++ objects are handled
745 * differently and I have made no attempt to fold that logic in
746 * here. The runtime layout is different for the two cases. Also,
747 * this currently has only the code for non-RRBC layouts generated by
748 * the HP aCC compiler; RRBC code is stubbed out and will have to be
753 cp_print_hpacc_virtual_table_entries (struct type
*type
, int *vfuncs
,
754 struct value
*v
, struct ui_file
*stream
,
755 int format
, int recurse
,
756 enum val_prettyprint pretty
)
760 /* pai: FIXME this function doesn't work. It should handle a given
761 * virtual function only once (latest redefinition in class hierarchy)
764 /* Recursion on other classes that can share the same vtable */
765 struct type
*pbc
= primary_base_class (type
);
767 cp_print_hpacc_virtual_table_entries (pbc
, vfuncs
, v
, stream
, format
,
770 /* Now deal with vfuncs declared in this class */
771 for (fn
= 0; fn
< TYPE_NFN_FIELDS (type
); fn
++)
772 for (oi
= 0; oi
< TYPE_FN_FIELDLIST_LENGTH (type
, fn
); oi
++)
773 if (TYPE_FN_FIELD_VIRTUAL_P (TYPE_FN_FIELDLIST1 (type
, fn
), oi
))
776 const char *field_physname
;
778 /* virtual function offset */
779 int vx
= (TYPE_FN_FIELD_VOFFSET (TYPE_FN_FIELDLIST1 (type
, fn
), oi
)
782 /* Get the address of the vfunction entry */
783 struct value
*vf
= value_copy (v
);
785 (void) value_fetch_lazy (vf
);
786 /* adjust by offset */
787 vf
->aligner
.contents
[0] += 4 * (HP_ACC_VFUNC_START
+ vx
);
788 vf
= value_ind (vf
); /* get the entry */
789 VALUE_TYPE (vf
) = VALUE_TYPE (v
); /* make it a pointer */
791 /* print out the entry */
792 val_print (VALUE_TYPE (vf
), VALUE_CONTENTS (vf
), 0, 0,
793 stream
, format
, 0, recurse
+ 1, pretty
);
795 = TYPE_FN_FIELD_PHYSNAME (TYPE_FN_FIELDLIST1 (type
, fn
), oi
);
796 /* pai: (temp) FIXME Maybe this should be DMGL_ANSI */
797 vf_name
= cplus_demangle (field_physname
, DMGL_ARM
);
798 fprintf_filtered (stream
, " %s", vf_name
);
800 fputs_filtered (", ", stream
);
807 _initialize_cp_valprint (void)
810 (add_set_cmd ("static-members", class_support
, var_boolean
,
811 (char *) &static_field_print
,
812 "Set printing of C++ static members.",
815 /* Turn on printing of static fields. */
816 static_field_print
= 1;
819 (add_set_cmd ("vtbl", class_support
, var_boolean
, (char *) &vtblprint
,
820 "Set printing of C++ virtual function tables.",
825 (add_set_cmd ("object", class_support
, var_boolean
, (char *) &objectprint
,
826 "Set printing of object's derived type based on vtable info.",
830 /* Give people the defaults which they are used to. */
833 obstack_begin (&dont_print_vb_obstack
, 32 * sizeof (struct type
*));
834 obstack_specify_allocation (&dont_print_statmem_obstack
,
835 32 * sizeof (CORE_ADDR
), sizeof (CORE_ADDR
),