+2002-03-16 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * cp-valprint.c (cp_is_vtbl_ptr_type): Handle vtbl field type
+ for gcc versions after gcc-2.8.1.
+
2002-03-16 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
* eval.c (evaluate_subexp_standard): Fix setup of ``this'' pointer
/* Support for printing C++ values for GDB, the GNU debugger.
Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 2000, 2001
+ 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GDB.
int
cp_is_vtbl_member (struct type *type)
{
+ /* With older versions of g++, the vtbl field pointed to an array
+ of structures. Nowadays it points directly to the structure. */
if (TYPE_CODE (type) == TYPE_CODE_PTR)
{
type = TYPE_TARGET_TYPE (type);
return cp_is_vtbl_ptr_type (type);
}
}
+ else if (TYPE_CODE (type) == TYPE_CODE_STRUCT) /* if not using thunks */
+ {
+ return cp_is_vtbl_ptr_type (type);
+ }
+ else if (TYPE_CODE (type) == TYPE_CODE_PTR) /* if using thunks */
+ {
+ /* The type name of the thunk pointer is NULL when using dwarf2.
+ We could test for a pointer to a function, but there is
+ no type info for the virtual table either, so it wont help. */
+ return cp_is_vtbl_ptr_type (type);
+ }
}
return 0;
}