2005-01-17 Kelley Cook <kcook@gcc.gnu.org>
[deliverable/binutils-gdb.git] / gdb / hpread.c
index b3742d07225aa5e85cfa8634e3dc923e80f7e36f..1103b36387e3d3c2d3f4e36a7f22d443cc275b31 100644 (file)
@@ -35,7 +35,7 @@
 #include "gdb-stabs.h"
 #include "gdbtypes.h"
 #include "demangle.h"
-#include "somsolib.h"
+#include "solib-som.h"
 #include "gdb_assert.h"
 #include "hppa-tdep.h"
 
@@ -75,7 +75,7 @@ struct hpread_symfile_info
 
 /* Accessor macros to get at the fields.  */
 #define HPUX_SYMFILE_INFO(o) \
-  ((struct hpread_symfile_info *)((o)->sym_private))
+  ((struct hpread_symfile_info *)((o)->deprecated_sym_private))
 #define GNTT(o)                 (HPUX_SYMFILE_INFO(o)->gntt)
 #define LNTT(o)                 (HPUX_SYMFILE_INFO(o)->lntt)
 #define SLT(o)                  (HPUX_SYMFILE_INFO(o)->slt)
@@ -383,6 +383,7 @@ hpread_pxdb_needed (bfd *sym_bfd)
       if (header_section_size == (bfd_size_type) sizeof (DOC_info_PXDB_header))
        {
          buf = alloca (sizeof (DOC_info_PXDB_header));
+         memset (buf, 0, sizeof (DOC_info_PXDB_header));
 
          if (!bfd_get_section_contents (sym_bfd,
                                         header_section,
@@ -450,6 +451,7 @@ hpread_pxdb_needed (bfd *sym_bfd)
        {
 
          buf = alloca (sizeof (PXDB_header));
+         memset (buf, 0, sizeof (PXDB_header));
          if (!bfd_get_section_contents (sym_bfd,
                                         header_section,
                                         buf, 0,
@@ -1665,9 +1667,9 @@ hpread_symfile_init (struct objfile *objfile)
   asection *vt_section, *slt_section, *lntt_section, *gntt_section;
 
   /* Allocate struct to keep track of the symfile */
-  objfile->sym_private =
-    xmmalloc (objfile->md, sizeof (struct hpread_symfile_info));
-  memset (objfile->sym_private, 0, sizeof (struct hpread_symfile_info));
+  objfile->deprecated_sym_private =
+    xmalloc (sizeof (struct hpread_symfile_info));
+  memset (objfile->deprecated_sym_private, 0, sizeof (struct hpread_symfile_info));
 
   /* We haven't read in any types yet.  */
   DNTT_TYPE_VECTOR (objfile) = 0;
@@ -2282,9 +2284,9 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
 void
 hpread_symfile_finish (struct objfile *objfile)
 {
-  if (objfile->sym_private != NULL)
+  if (objfile->deprecated_sym_private != NULL)
     {
-      xmfree (objfile->md, objfile->sym_private);
+      xfree (objfile->deprecated_sym_private);
     }
 }
 \f
@@ -3022,7 +3024,7 @@ hpread_lookup_type (dnttpointer hp_type, struct objfile *objfile)
            {
              DNTT_TYPE_VECTOR_LENGTH (objfile) = LNTT_SYMCOUNT (objfile) + GNTT_SYMCOUNT (objfile);
              DNTT_TYPE_VECTOR (objfile) = (struct type **)
-               xmmalloc (objfile->md, DNTT_TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *));
+               xmalloc (DNTT_TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *));
              memset (&DNTT_TYPE_VECTOR (objfile)[old_len], 0,
                      (DNTT_TYPE_VECTOR_LENGTH (objfile) - old_len) *
                      sizeof (struct type *));
@@ -3040,8 +3042,7 @@ hpread_lookup_type (dnttpointer hp_type, struct objfile *objfile)
          if (size_changed)
            {
              DNTT_TYPE_VECTOR (objfile) = (struct type **)
-               xmrealloc (objfile->md,
-                          (char *) DNTT_TYPE_VECTOR (objfile),
+               xrealloc ((char *) DNTT_TYPE_VECTOR (objfile),
                   (DNTT_TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *)));
 
              memset (&DNTT_TYPE_VECTOR (objfile)[old_len], 0,
@@ -3686,6 +3687,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
 
          /* Get space to record the next field/data-member. */
          new = (struct nextfield *) alloca (sizeof (struct nextfield));
+         memset (new, 0, sizeof (struct nextfield));
          new->next = list;
          list = new;
 
@@ -3764,6 +3766,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
          n_templ_args++;
          /* Allocate and fill in a struct next_template */
          t_new = (struct next_template *) alloca (sizeof (struct next_template));
+         memset (t_new, 0, sizeof (struct next_template));
          t_new->next = t_list;
          t_list = t_new;
          t_list->arg.name = VT (objfile) + fieldp->dtempl_arg.name;
@@ -3904,6 +3907,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
                  /* Get space to record this member function */
                  /* Note: alloca used; this will disappear on routine exit */
                  fn_new = (struct next_fn_field *) alloca (sizeof (struct next_fn_field));
+                 memset (fn_new, 0, sizeof (struct next_fn_field));
                  fn_new->next = fn_list;
                  fn_list = fn_new;
 
@@ -4021,6 +4025,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
 
              /* Get space to record this static member */
              new = (struct nextfield *) alloca (sizeof (struct nextfield));
+             memset (new, 0, sizeof (struct nextfield));
              new->next = list;
              list = new;
 
@@ -4051,6 +4056,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
                warning ("Debug info inconsistent: FIELD of anonymous union doesn't have a_union bit set");
              /* Get space to record the next field/data-member. */
              new = (struct nextfield *) alloca (sizeof (struct nextfield));
+             memset (new, 0, sizeof (struct nextfield));
              new->next = list;
              list = new;
 
@@ -4082,6 +4088,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
                warning ("Debug info inconsistent: SVAR field in anonymous union doesn't have a_union bit set");
              /* Get space to record the next field/data-member. */
              new = (struct nextfield *) alloca (sizeof (struct nextfield));
+             memset (new, 0, sizeof (struct nextfield));
              new->next = list;
              list = new;
 
@@ -4102,6 +4109,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
                warning ("Debug info inconsistent: DVAR field in anonymous union doesn't have a_union bit set");
              /* Get space to record the next field/data-member. */
              new = (struct nextfield *) alloca (sizeof (struct nextfield));
+             memset (new, 0, sizeof (struct nextfield));
              new->next = list;
              list = new;
 
@@ -4150,6 +4158,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
 
          /* Get space to record the next field/data-member. */
          new = (struct nextfield *) alloca (sizeof (struct nextfield));
+         memset (new, 0, sizeof (struct nextfield));
          new->next = list;
          list = new;
 
@@ -4233,6 +4242,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
            break;
 
          i_new = (struct next_instantiation *) alloca (sizeof (struct next_instantiation));
+         memset (i_new, 0, sizeof (struct next_instantiation));
          i_new->next = i_list;
          i_list = i_new;
          i_list->t = hpread_type_lookup (field, objfile);
@@ -5770,7 +5780,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
               * to interpret the private shared-library data.
               */
              SYMBOL_VALUE_ADDRESS (sym) = dn_bufp->dsvar.location +
-               so_lib_thread_start_addr (so);
+               gdbarch_tdep (current_gdbarch)->solib_thread_start_addr (so);
            }
        }
       break;
This page took 0.026352 seconds and 4 git commands to generate.