forked from Imagelibrary/binutils-gdb
Add partial support for g++ code compiled with -fvtable-thunks.
* c-valprint.c (c_val_print): Add vtblprint support when using thunks. * cp-valprint.c (cp_is_vtbl_member): A vtable can be an array of pointers (if using thunks) as well as array of structs (otherwise). * cp-valprint.c (vtbl_ptr_name_old, vtbl_ptr_name): Move to global level, and make the latter non-static (so define_symbol can use it). * stabsread.c (define_symbol): If the type being defined is a pointer type named "__vtbl_ptr_type", set the TYPE_NAME to that name. * symtab.h (VTBL_PREFIX_P): Allow "_VT" as well as "_vt". * values.c (value_virtual_fn_field): Handle thunks. * values.c (value_headof): Minor efficiency hack. * values.c (value_headof): Incomplete thunk support. FIXME.
This commit is contained in:
@@ -1075,7 +1075,13 @@ define_symbol (valu, string, desc, type, objfile)
|
||||
|
||||
if (TYPE_NAME (SYMBOL_TYPE (sym)) == NULL)
|
||||
{
|
||||
if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR
|
||||
/* gcc-2.6 or later (when using -fvtable-thunks)
|
||||
emits a unique named type for a vtable entry.
|
||||
Some gdb code depends on that specific name. */
|
||||
extern const char vtbl_ptr_name[];
|
||||
|
||||
if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR
|
||||
&& strcmp (SYMBOL_NAME (sym), vtbl_ptr_name))
|
||||
|| TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FUNC)
|
||||
{
|
||||
/* If we are giving a name to a type such as "pointer to
|
||||
|
||||
Reference in New Issue
Block a user