2001-12-21 Michael Snyder <msnyder@redhat.com>
[deliverable/binutils-gdb.git] / gdb / hp-symtab-read.c
index 902a40d207d91bd351a5a895fff43729df3764aa..57665ffff37bd1f8038f4972477f7e144c45493b 100644 (file)
@@ -1,5 +1,5 @@
 /* Read hp debug symbols and convert to internal format, for GDB.
-   Copyright 1993, 1996 Free Software Foundation, Inc.
+   Copyright 1993, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -516,7 +516,7 @@ hpread_expand_symtab (struct objfile *objfile, int sym_offset, int sym_size,
   current_objfile = NULL;
   hp_som_som_object_present = 1;       /* Indicate we've processed an HP SOM SOM file */
 
-  return end_symtab (text_offset + text_size, objfile, 0);
+  return end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile));
 }
 \f
 
@@ -530,7 +530,7 @@ hpread_type_translate (dnttpointer typep)
   if (!typep.dntti.immediate)
     {
       error ("error in hpread_type_translate\n.");
-      return;
+      return FT_VOID;
     }
 
   switch (typep.dntti.type)
@@ -1780,7 +1780,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
              /* Enums -- will be handled by other code that takes care
                 of DNTT_TYPE_ENUM; here we see only DNTT_TYPE_MEMENUM so
                 it's not clear we could have handled them here at all. */
-             /* FUNC_TEMPLATE: is handled by other code (??). */
+             /* FUNC_TEMPLATE: is handled by other code (?). */
              /* MEMACCESS: modified access for inherited member. Not
                 sure what to do with this, ignoriing it at present. */
 
@@ -1863,7 +1863,8 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
        {
          /* neither field nor genfield ?? is this possible?? */
          /* pai:: FIXME walk to the next -- how? */
-         warning ("Internal error: unexpected DNTT kind %d encountered as field of struct");
+         warning ("Internal error: unexpected DNTT kind %d encountered as field of struct",
+                  fieldp->dblock.kind);
          warning ("Skipping remaining fields of struct");
          break;                /* get out of loop of fields */
        }
@@ -2017,6 +2018,9 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
   /* Clear the global saying what template we are in the middle of processing */
   current_template = NULL;
 
+  /* Fix up any cv-qualified versions of this type.  */
+  finish_cv_type (type);
+
   return type;
 }
 
@@ -2199,7 +2203,7 @@ hpread_read_array_type (dnttpointer hp_type, union dnttentry *dn_bufp,
        (!dn_bufp->darray.arrayisbytes && !dn_bufp->darray.elemisbytes)))
     {
       warning ("error in hpread_array_type.\n");
-      return;
+      return NULL;
     }
   else if (dn_bufp->darray.arraylength == 0x7fffffff)
     {
@@ -2302,14 +2306,17 @@ hpread_type_lookup (dnttpointer hp_type, struct objfile *objfile)
 
   /* First see if it's a simple builtin type.  */
   if (hp_type.dntti.immediate)
-    /* If this is a template argument, the argument number is
-     * encoded in the bitlength. All other cases, just return
-     * GDB's representation of this fundamental type.
-     */
-    if (hp_type.dntti.type == HP_TYPE_TEMPLATE_ARG)
-      return hpread_get_nth_template_arg (objfile, hp_type.dntti.bitlength);
-    else
-      return lookup_fundamental_type (objfile, hpread_type_translate (hp_type));
+    {
+      /* If this is a template argument, the argument number is
+       * encoded in the bitlength. All other cases, just return
+       * GDB's representation of this fundamental type.
+       */
+      if (hp_type.dntti.type == HP_TYPE_TEMPLATE_ARG)
+       return hpread_get_nth_template_arg (objfile, hp_type.dntti.bitlength);
+      else
+       return lookup_fundamental_type (objfile,
+                                       hpread_type_translate (hp_type));
+    }
 
   /* Not a builtin type.  We'll have to read it in.  */
   if (hp_type.dnttp.index < LNTT_SYMCOUNT (objfile))
@@ -2425,7 +2432,7 @@ hpread_type_lookup (dnttpointer hp_type, struct objfile *objfile)
        else
          {
            complain (&hpread_type_lookup_complaint);
-           return;
+           return NULL;
          }
 
        if (dn_bufp->dblock.kind == DNTT_TYPE_STRUCT)
This page took 0.025274 seconds and 4 git commands to generate.