linux-thread-db.c (record_thread): Return the created thread.
[deliverable/binutils-gdb.git] / gdb / dbxread.c
index 1d0043259bbcd094829e68f8379d49870ac1b2d8..dd81ec8c49e8b3169fee6b11824f144eb7c324e0 100644 (file)
@@ -319,7 +319,7 @@ void
 init_header_files (void)
 {
   n_allocated_this_object_header_files = 10;
-  this_object_header_files = (int *) xmalloc (10 * sizeof (int));
+  this_object_header_files = XNEWVEC (int, 10);
 }
 
 /* Add header file number I for this object file
@@ -405,9 +405,7 @@ add_new_header_file (char *name, int instance)
   hfile->name = xstrdup (name);
   hfile->instance = instance;
   hfile->length = 10;
-  hfile->vector
-    = (struct type **) xmalloc (10 * sizeof (struct type *));
-  memset (hfile->vector, 0, 10 * sizeof (struct type *));
+  hfile->vector = XCNEWVEC (struct type *, 10);
 
   add_this_object_header_file (i);
 }
@@ -890,8 +888,8 @@ static void
 init_bincl_list (int number, struct objfile *objfile)
 {
   bincls_allocated = number;
-  next_bincl = bincl_list = (struct header_file_location *)
-    xmalloc (bincls_allocated * sizeof (struct header_file_location));
+  next_bincl = bincl_list = XNEWVEC (struct header_file_location,
+                                    bincls_allocated);
 }
 
 /* Add a bincl to the list.  */
@@ -2170,8 +2168,8 @@ start_psymtab (struct objfile *objfile, char *filename, CORE_ADDR textlow,
     start_psymtab_common (objfile, filename, textlow,
                          global_syms, static_syms);
 
-  result->read_symtab_private = obstack_alloc (&objfile->objfile_obstack,
-                                              sizeof (struct symloc));
+  result->read_symtab_private =
+    XOBNEW (&objfile->objfile_obstack, struct symloc);
   LDSYMOFF (result) = ldsymoff;
   result->read_symtab = dbx_read_symtab;
   SYMBOL_SIZE (result) = symbol_size;
@@ -2288,9 +2286,9 @@ dbx_end_psymtab (struct objfile *objfile, struct partial_symtab *pst,
   pst->number_of_dependencies = number_dependencies;
   if (number_dependencies)
     {
-      pst->dependencies = (struct partial_symtab **)
-       obstack_alloc (&objfile->objfile_obstack,
-                      number_dependencies * sizeof (struct partial_symtab *));
+      pst->dependencies = XOBNEWVEC (&objfile->objfile_obstack,
+                                    struct partial_symtab *,
+                                    number_dependencies);
       memcpy (pst->dependencies, dependency_list,
              number_dependencies * sizeof (struct partial_symtab *));
     }
@@ -2303,7 +2301,7 @@ dbx_end_psymtab (struct objfile *objfile, struct partial_symtab *pst,
        allocate_psymtab (include_list[i], objfile);
 
       subpst->read_symtab_private =
-       obstack_alloc (&objfile->objfile_obstack, sizeof (struct symloc));
+       XOBNEW (&objfile->objfile_obstack, struct symloc);
       LDSYMOFF (subpst) =
        LDSYMLEN (subpst) =
        subpst->textlow =
@@ -2311,9 +2309,8 @@ dbx_end_psymtab (struct objfile *objfile, struct partial_symtab *pst,
 
       /* We could save slight bits of space by only making one of these,
          shared by the entire set of include files.  FIXME-someday.  */
-      subpst->dependencies = (struct partial_symtab **)
-       obstack_alloc (&objfile->objfile_obstack,
-                      sizeof (struct partial_symtab *));
+      subpst->dependencies =
+       XOBNEW (&objfile->objfile_obstack, struct partial_symtab *);
       subpst->dependencies[0] = pst;
       subpst->number_of_dependencies = 1;
 
@@ -2344,7 +2341,7 @@ dbx_end_psymtab (struct objfile *objfile, struct partial_symtab *pst,
       discard_psymtab (objfile, pst);
 
       /* Indicate that psymtab was thrown away.  */
-      pst = (struct partial_symtab *) NULL;
+      pst = NULL;
     }
   return pst;
 }
@@ -2756,7 +2753,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
 
          /* Make a block for the local symbols within.  */
          block = finish_block (newobj->name, &local_symbols,
-                               newobj->old_blocks,
+                               newobj->old_blocks, NULL,
                                newobj->start_addr, newobj->start_addr + valu);
 
          /* For C++, set the block's scope.  */
@@ -2857,7 +2854,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
                  newobj->start_addr = valu;
                }
              /* Make a block for the local symbols within.  */
-             finish_block (0, &local_symbols, newobj->old_blocks,
+             finish_block (0, &local_symbols, newobj->old_blocks, NULL,
                            newobj->start_addr, valu);
            }
        }
@@ -3155,8 +3152,8 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
                  newobj = pop_context ();
                  /* Make a block for the local symbols within.  */
                  block = finish_block (newobj->name, &local_symbols,
-                                       newobj->old_blocks, newobj->start_addr,
-                                       valu);
+                                       newobj->old_blocks, NULL,
+                                       newobj->start_addr, valu);
 
                  /* For C++, set the block's scope.  */
                  if (SYMBOL_LANGUAGE (newobj->name) == language_cplus)
This page took 0.026045 seconds and 4 git commands to generate.