Add support for target specific command line switches to old-style simualtors.
[deliverable/binutils-gdb.git] / gdb / dstread.c
index b6f31ac8463ff87e370828cba1eb066c5b1a59f0..abcce097a2743b327db8c10860cb462489dfc472 100644 (file)
@@ -1,6 +1,7 @@
 /* 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.
 
@@ -107,7 +108,7 @@ dst_start_symtab (void)
   /* 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 */
@@ -704,17 +705,6 @@ dst_sym_addr (dst_sect_ref_t *ref)
     + 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)
 {
@@ -861,13 +851,13 @@ decode_dst_structure (struct objfile *objfile, dst_rec_ptr_t entry, int code,
   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;
@@ -1305,10 +1295,10 @@ process_dst_function (struct objfile *objfile, dst_rec_ptr_t entry, char *name,
 
   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;
 
@@ -1401,7 +1391,7 @@ process_dst_block (struct objfile *objfile, dst_rec_ptr_t entry)
 
       block->sym[symnum] = symlist->symbol;
 
-      free ((PTR) symlist);
+      xfree (symlist);
       symlist = nextsym;
       symnum++;
     }
@@ -1497,7 +1487,7 @@ read_dst_symtab (struct objfile *objfile)
              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;
@@ -1534,7 +1524,7 @@ read_dst_symtab (struct objfile *objfile)
     {
       element = struct_list;
       struct_list = element->next;
-      free ((PTR) element);
+      xfree (element);
     }
 }
 \f
@@ -1577,9 +1567,7 @@ struct section_offsets dst_symfile_faker =
 {0};
 
 void
-dst_symfile_offsets (objfile, addr)
-     struct objfile *objfile;
-     struct section_addr_info *addrs;
+dst_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs)
 {
   objfile->num_sections = 1;
   objfile->section_offsets = &dst_symfile_faker;
This page took 0.027337 seconds and 4 git commands to generate.