/* Read apollo DST symbol tables and convert to internal format, for GDB.
Contributed by Troy Rollo, University of NSW (troy@cbme.unsw.edu.au).
- Copyright 1993 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+ Free Software Foundation, Inc.
This file is part of GDB.
/* Initialize the source file line number information for this file. */
if (line_vector) /* Unlikely, but maybe possible? */
- free ((PTR) line_vector);
+ xfree (line_vector);
line_vector_index = 0;
line_vector_length = 1000;
prev_line_number = -2; /* Force first line number to be explicit */
+ ref->sect_offset;
}
-static struct type *
-create_new_type (struct objfile *objfile)
-{
- struct type *type;
-
- type = (struct type *)
- obstack_alloc (&objfile->symbol_obstack, sizeof (struct type));
- memset (type, 0, sizeof (struct type));
- return type;
-}
-
static struct symbol *
create_new_symbol (struct objfile *objfile, char *name)
{
type = find_dst_structure (name);
if (type)
{
- free ((PTR) name);
+ xfree (name);
return type;
}
- type = create_new_type (objfile);
+ type = alloc_type (objfile);
TYPE_NAME (type) = obstack_copy0 (&objfile->symbol_obstack,
name, strlen (name));
- free ((PTR) name);
+ xfree (name);
TYPE_CODE (type) = code;
TYPE_LENGTH (type) = DST_record (entry).size;
TYPE_NFIELDS (type) = DST_record (entry).nfields;
if (!type->function_type)
{
- ftype = create_new_type (objfile);
+ ftype = alloc_type (objfile);
type->function_type = ftype;
- ftype->target_type = type;
- ftype->code = TYPE_CODE_FUNC;
+ TYPE_TARGET_TYPE (ftype) = type;
+ TYPE_CODE (ftype) = TYPE_CODE_FUNC;
}
SYMBOL_TYPE (sym) = type->function_type;
block->sym[symnum] = symlist->symbol;
- free ((PTR) symlist);
+ xfree (symlist);
symlist = nextsym;
symnum++;
}
global_block->sym[symnum] =
dst_global_symbols->symbol;
- free ((PTR) dst_global_symbols);
+ xfree (dst_global_symbols);
dst_global_symbols = nextsym;
}
dst_global_symbols = NULL;
{
element = struct_list;
struct_list = element->next;
- free ((PTR) element);
+ xfree (element);
}
}
\f