dbxread.c (read_type): If we get "##", don't lookup_function_type
and start clobbering it; allocate_stub_method instead. * dbxread.c (read_struct_type): Put "op$" instead of "operator" in the symbol table. * dbxread.c (read_struct_type): Set fcontext to 0 for normal member function. * dbxread.c (read_struct_type): Initialize name to 0. * dbxread.c (read_ofile_symtab, N_CATCH): Add offset to bufp->n_value. * dbxread.c (dbx_create_type): Zero TYPE_VPTR_BASETYPE. (read_struct_type): Don't bother to set TYPE_VTPR_{BASETYPE,FIELDNO} if it's just going to be {0,1}. * dbxread.c (virtual_context): Use TYPE_BASECLASS starting at 0 (yes, it's #if 0, but just in case...).
This commit is contained in:
parent
55838914fd
commit
62c4f98b2b
1 changed files with 31 additions and 24 deletions
|
@ -671,6 +671,7 @@ dbx_create_type ()
|
||||||
|
|
||||||
bzero (type, sizeof (struct type));
|
bzero (type, sizeof (struct type));
|
||||||
TYPE_VPTR_FIELDNO (type) = -1;
|
TYPE_VPTR_FIELDNO (type) = -1;
|
||||||
|
TYPE_VPTR_BASETYPE (type) = 0;
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1873,8 +1874,10 @@ read_dbx_symtab (symfile_name, addr,
|
||||||
bufp->n_value += addr; /* Relocate */
|
bufp->n_value += addr; /* Relocate */
|
||||||
SET_NAMESTRING ();
|
SET_NAMESTRING ();
|
||||||
/* Check for __DYNAMIC, which is used by Sun shared libraries.
|
/* Check for __DYNAMIC, which is used by Sun shared libraries.
|
||||||
Record it even if it's local, not global, so we can find it. */
|
Record it even if it's local, not global, so we can find it.
|
||||||
if (namestring[8] == 'C' && (strcmp ("__DYNAMIC", namestring) == 0))
|
Same with virtual function tables, both global and static. */
|
||||||
|
if ((namestring[8] == 'C' && (strcmp ("__DYNAMIC", namestring) == 0))
|
||||||
|
|| VTBL_PREFIX_P ((namestring+HASH_OFFSET)))
|
||||||
{
|
{
|
||||||
/* Not really a function here, but... */
|
/* Not really a function here, but... */
|
||||||
record_misc_function (namestring, bufp->n_value,
|
record_misc_function (namestring, bufp->n_value,
|
||||||
|
@ -2871,8 +2874,7 @@ read_ofile_symtab (desc, stringtab, stringtab_size, sym_offset,
|
||||||
{
|
{
|
||||||
/* N_CATCH is not fixed up by the linker, and unfortunately,
|
/* N_CATCH is not fixed up by the linker, and unfortunately,
|
||||||
there's no other place to put it in the .stab map. */
|
there's no other place to put it in the .stab map. */
|
||||||
/* FIXME, do we also have to add OFFSET or something? -- gnu@cygnus */
|
bufp->n_value += text_offset + offset;
|
||||||
bufp->n_value += text_offset;
|
|
||||||
}
|
}
|
||||||
else if (type == N_TEXT || type == N_DATA || type == N_BSS)
|
else if (type == N_TEXT || type == N_DATA || type == N_BSS)
|
||||||
bufp->n_value += offset;
|
bufp->n_value += offset;
|
||||||
|
@ -3992,11 +3994,9 @@ read_type (pp)
|
||||||
return_type = read_type (pp);
|
return_type = read_type (pp);
|
||||||
if (*(*pp)++ != ';')
|
if (*(*pp)++ != ';')
|
||||||
complain (&invalid_member_complaint, symnum);
|
complain (&invalid_member_complaint, symnum);
|
||||||
type = lookup_function_type (return_type);
|
type = allocate_stub_method (return_type);
|
||||||
if (typenums[0] != -1)
|
if (typenums[0] != -1)
|
||||||
*dbx_lookup_type (typenums) = type;
|
*dbx_lookup_type (typenums) = type;
|
||||||
TYPE_CODE (type) = TYPE_CODE_METHOD;
|
|
||||||
TYPE_FLAGS (type) |= TYPE_FLAG_STUB;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -4134,7 +4134,7 @@ virtual_context (for_type, type, name, fn_type, offset)
|
||||||
return TYPE_FN_FIELD_FCONTEXT (f, j);
|
return TYPE_FN_FIELD_FCONTEXT (f, j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i = TYPE_N_BASECLASSES (type); i > 0; i--)
|
for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
basetype = virtual_context (for_type, TYPE_BASECLASS (type, i), name,
|
basetype = virtual_context (for_type, TYPE_BASECLASS (type, i), name,
|
||||||
fn_type, offset);
|
fn_type, offset);
|
||||||
|
@ -4329,7 +4329,7 @@ read_struct_type (pp, type)
|
||||||
/* Special GNU C++ name. */
|
/* Special GNU C++ name. */
|
||||||
if (*++p == 'v')
|
if (*++p == 'v')
|
||||||
{
|
{
|
||||||
char *prefix, *name; /* FIXME: NAME never set! */
|
char *prefix, *name = 0;
|
||||||
struct type *context;
|
struct type *context;
|
||||||
|
|
||||||
switch (*++p)
|
switch (*++p)
|
||||||
|
@ -4349,6 +4349,7 @@ read_struct_type (pp, type)
|
||||||
{
|
{
|
||||||
if (name == 0)
|
if (name == 0)
|
||||||
error ("type name unknown at symtab pos %d.", symnum);
|
error ("type name unknown at symtab pos %d.", symnum);
|
||||||
|
/* FIXME-tiemann: when is `name' ever non-0? */
|
||||||
TYPE_NAME (context) = obsavestring (name, p - name - 1);
|
TYPE_NAME (context) = obsavestring (name, p - name - 1);
|
||||||
}
|
}
|
||||||
list->field.name = obconcat (prefix, type_name_no_tag (context), "");
|
list->field.name = obconcat (prefix, type_name_no_tag (context), "");
|
||||||
|
@ -4422,7 +4423,9 @@ read_struct_type (pp, type)
|
||||||
list->field.bitsize = read_number (pp, ';');
|
list->field.bitsize = read_number (pp, ';');
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* FIXME tiemann: what is the story here? What does the compiler
|
/* FIXME-tiemann: Can't the compiler put out something which
|
||||||
|
lets us distinguish these? (or maybe just not put out anything
|
||||||
|
for the field). What is the story here? What does the compiler
|
||||||
really do? Also, patch gdb.texinfo for this case; I document
|
really do? Also, patch gdb.texinfo for this case; I document
|
||||||
it as a possible problem there. Search for "DBX-style". */
|
it as a possible problem there. Search for "DBX-style". */
|
||||||
|
|
||||||
|
@ -4536,8 +4539,8 @@ read_struct_type (pp, type)
|
||||||
/* This lets the user type "break operator+".
|
/* This lets the user type "break operator+".
|
||||||
We could just put in "+" as the name, but that wouldn't
|
We could just put in "+" as the name, but that wouldn't
|
||||||
work for "*". */
|
work for "*". */
|
||||||
static char opname[32] = "operator";
|
static char opname[32] = {'o', 'p', CPLUS_MARKER};
|
||||||
char *o = opname + 8;
|
char *o = opname + 3;
|
||||||
|
|
||||||
/* Skip past '::'. */
|
/* Skip past '::'. */
|
||||||
p += 2;
|
p += 2;
|
||||||
|
@ -4578,7 +4581,7 @@ read_struct_type (pp, type)
|
||||||
*pp = p + 1;
|
*pp = p + 1;
|
||||||
new_sublist->visibility = *(*pp)++ - '0';
|
new_sublist->visibility = *(*pp)++ - '0';
|
||||||
if (**pp == '\\') *pp = next_symbol_text ();
|
if (**pp == '\\') *pp = next_symbol_text ();
|
||||||
/* FIXME: tiemann needs to add const/volatile info
|
/* FIXME-tiemann: need to add const/volatile info
|
||||||
to the methods. For now, just skip the char.
|
to the methods. For now, just skip the char.
|
||||||
In future, here's what we need to implement:
|
In future, here's what we need to implement:
|
||||||
|
|
||||||
|
@ -4632,6 +4635,7 @@ read_struct_type (pp, type)
|
||||||
/* **pp == '.'. */
|
/* **pp == '.'. */
|
||||||
/* normal member function. */
|
/* normal member function. */
|
||||||
new_sublist->fn_field.voffset = 0;
|
new_sublist->fn_field.voffset = 0;
|
||||||
|
new_sublist->fn_field.fcontext = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4733,7 +4737,14 @@ read_struct_type (pp, type)
|
||||||
if (type == t)
|
if (type == t)
|
||||||
{
|
{
|
||||||
if (TYPE_FIELD_NAME (t, TYPE_N_BASECLASSES (t)) == 0)
|
if (TYPE_FIELD_NAME (t, TYPE_N_BASECLASSES (t)) == 0)
|
||||||
TYPE_VPTR_FIELDNO (type) = i = TYPE_N_BASECLASSES (t);
|
{
|
||||||
|
/* FIXME-tiemann: what's this? */
|
||||||
|
#if 0
|
||||||
|
TYPE_VPTR_FIELDNO (type) = i = TYPE_N_BASECLASSES (t);
|
||||||
|
#else
|
||||||
|
error_type (pp);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else for (i = TYPE_NFIELDS (t) - 1; i >= TYPE_N_BASECLASSES (t); --i)
|
else for (i = TYPE_NFIELDS (t) - 1; i >= TYPE_N_BASECLASSES (t); --i)
|
||||||
if (! strncmp (TYPE_FIELD_NAME (t, i), vptr_name,
|
if (! strncmp (TYPE_FIELD_NAME (t, i), vptr_name,
|
||||||
sizeof (vptr_name) -1))
|
sizeof (vptr_name) -1))
|
||||||
|
@ -4749,16 +4760,6 @@ read_struct_type (pp, type)
|
||||||
TYPE_VPTR_FIELDNO (type) = TYPE_VPTR_FIELDNO (t);
|
TYPE_VPTR_FIELDNO (type) = TYPE_VPTR_FIELDNO (t);
|
||||||
*pp = p + 1;
|
*pp = p + 1;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
TYPE_VPTR_BASETYPE (type) = 0;
|
|
||||||
TYPE_VPTR_FIELDNO (type) = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TYPE_VPTR_BASETYPE (type) = 0;
|
|
||||||
TYPE_VPTR_FIELDNO (type) = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
|
@ -5096,6 +5097,12 @@ read_range_type (pp, typenums)
|
||||||
nbits = n2bits;
|
nbits = n2bits;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check for "long long". */
|
||||||
|
if (got_signed && nbits == TARGET_LONG_LONG_BIT)
|
||||||
|
return builtin_type_long_long;
|
||||||
|
if (got_unsigned && nbits == TARGET_LONG_LONG_BIT)
|
||||||
|
return builtin_type_unsigned_long_long;
|
||||||
|
|
||||||
if (got_signed || got_unsigned)
|
if (got_signed || got_unsigned)
|
||||||
{
|
{
|
||||||
result_type = (struct type *) obstack_alloc (symbol_obstack,
|
result_type = (struct type *) obstack_alloc (symbol_obstack,
|
||||||
|
|
Loading…
Reference in a new issue