2004-02-07 Elena Zannoni <ezannoni@redhat.com>

* objfiles.h (struct objfile): Add objfile_obstack field.
        Remove type_obstack field.

        * dwarf2read.c (dwarf2_add_field,dwarf2_add_member_fn,
        read_structure_scope read_enumeration, new_symbol): Replace
        type_obstack with objfile_obstack.
        * dwarfread.c (struct_type, enum_type): Ditto.
        * gdbtypes.c (alloc_type, alloc_type_instance, init_type)
        (lookup_fundamental_type): Ditto.
        * gdbtypes.h (TYPE_ALLOC): Ditto.
        * hpread.c (hpread_read_enum_type, hpread_read_function_type)
        (hpread_read_doc_function_type, hpread_read_struct_type)
        (fix_static_member_physnames, hpread_read_array_type)
        (hpread_read_subrange_type, hpread_type_lookup): Ditto.
        * jv-lang.c (java_lookup_class, type_from_class, type_from_class)
        (java_link_class_type): Ditto.
        * mdebugread.c (parse_type): Ditto.
        * objfiles.c (allocate_objfile, free_objfile): Ditto.
        * solib-sunos.c (solib_add_common_symbols): Ditto.
        * stabsread.c (define_symbol, read_type, read_member_functions,
        read_cpp_abbrev, read_one_struct_field): Ditto.
        * symfile.c (reread_symbols): Ditto.
        * symmisc.c (print_objfile_statistics): Ditto.
This commit is contained in:
Elena Zannoni 2004-02-07 16:57:55 +00:00
parent 2a8854a783
commit b99607ea3c
14 changed files with 110 additions and 74 deletions

View file

@ -1,6 +1,6 @@
/* Support routines for manipulating internal types for GDB.
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003,
2004 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
This file is part of GDB.
@ -136,7 +136,7 @@ static void virtual_base_list_aux (struct type *dclass);
/* Alloc a new type structure and fill it with some defaults. If
OBJFILE is non-NULL, then allocate the space for the type structure
in that objfile's type_obstack. Otherwise allocate the new type structure
in that objfile's objfile_obstack. Otherwise allocate the new type structure
by xmalloc () (for permanent types). */
struct type *
@ -154,10 +154,10 @@ alloc_type (struct objfile *objfile)
}
else
{
type = obstack_alloc (&objfile->type_obstack,
type = obstack_alloc (&objfile->objfile_obstack,
sizeof (struct type));
memset (type, 0, sizeof (struct type));
TYPE_MAIN_TYPE (type) = obstack_alloc (&objfile->type_obstack,
TYPE_MAIN_TYPE (type) = obstack_alloc (&objfile->objfile_obstack,
sizeof (struct main_type));
OBJSTAT (objfile, n_types++);
}
@ -191,7 +191,7 @@ alloc_type_instance (struct type *oldtype)
}
else
{
type = obstack_alloc (&TYPE_OBJFILE (oldtype)->type_obstack,
type = obstack_alloc (&TYPE_OBJFILE (oldtype)->objfile_obstack,
sizeof (struct type));
memset (type, 0, sizeof (struct type));
}
@ -1675,7 +1675,7 @@ allocate_cplus_struct_type (struct type *type)
/* Helper function to initialize the standard scalar types.
If NAME is non-NULL and OBJFILE is non-NULL, then we make a copy
of the string pointed to by name in the type_obstack for that objfile,
of the string pointed to by name in the objfile_obstack for that objfile,
and initialize the type name to that copy. There are places (mipsread.c
in particular, where init_type is called with a NULL value for NAME). */
@ -1692,7 +1692,7 @@ init_type (enum type_code code, int length, int flags, char *name,
if ((name != NULL) && (objfile != NULL))
{
TYPE_NAME (type) =
obsavestring (name, strlen (name), &objfile->type_obstack);
obsavestring (name, strlen (name), &objfile->objfile_obstack);
}
else
{
@ -1793,7 +1793,7 @@ lookup_fundamental_type (struct objfile *objfile, int typeid)
{
nbytes = FT_NUM_MEMBERS * sizeof (struct type *);
objfile->fundamental_types = (struct type **)
obstack_alloc (&objfile->type_obstack, nbytes);
obstack_alloc (&objfile->objfile_obstack, nbytes);
memset ((char *) objfile->fundamental_types, 0, nbytes);
OBJSTAT (objfile, n_types += FT_NUM_MEMBERS);
}