* configure.tgt (hppa*-*-bsd*, hppa*-*-osf*, m68*-*-sunos4*,
[deliverable/binutils-gdb.git] / gdb / dwarf2read.c
index c215c9941d8e067ca5e2589d61bfd2cf22bcab70..8a0513d72ced2099c035a09b04603dada1b98cf4 100644 (file)
 #include "gdb_string.h"
 #include <sys/types.h>
 
+#ifndef DWARF2_REG_TO_REGNUM
+#define DWARF2_REG_TO_REGNUM(REG) (REG)
+#endif
+
 #if 0
 /* .debug_info header for a compilation unit
    Because of alignment constraints, this structure has padding and cannot
@@ -275,11 +279,6 @@ static struct abbrev_info *dwarf2_abbrevs[ABBREV_HASH_SIZE];
 
 static struct die_info *die_ref_table[REF_HASH_SIZE];
 
-#ifndef TYPE_HASH_SIZE
-#define TYPE_HASH_SIZE 4096
-#endif
-static struct type *dwarf2_cached_types[TYPE_HASH_SIZE];
-
 /* Obstack for allocating temporary storage used during symbol reading.  */
 static struct obstack dwarf2_tmp_obstack;
 
@@ -2901,7 +2900,7 @@ read_comp_unit (char *info_ptr, bfd *abfd,
   char *cur_ptr;
   int nesting_level;
 
-  /* Reset die reference table and cached types table; we are
+  /* Reset die reference table; we are
      building new ones now.  */
   dwarf2_empty_hash_tables ();
 
@@ -4206,11 +4205,13 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
                  else if (isreg)
                    {
                      SYMBOL_CLASS (sym) = LOC_REGISTER;
+                     SYMBOL_VALUE (sym) = 
+                       DWARF2_REG_TO_REGNUM (SYMBOL_VALUE (sym));
                    }
                  else if (offreg)
                    {
                      SYMBOL_CLASS (sym) = LOC_BASEREG;
-                     SYMBOL_BASEREG (sym) = basereg;
+                     SYMBOL_BASEREG (sym) = DWARF2_REG_TO_REGNUM (basereg);
                    }
                  else if (islocal)
                    {
@@ -4252,6 +4253,8 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
              if (isreg)
                {
                  SYMBOL_CLASS (sym) = LOC_REGPARM;
+                 SYMBOL_VALUE (sym) = 
+                   DWARF2_REG_TO_REGNUM (SYMBOL_VALUE (sym));
                }
              else if (offreg)
                {
@@ -4264,7 +4267,7 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile,
                  else
                    {
                      SYMBOL_CLASS (sym) = LOC_BASEREG_ARG;
-                     SYMBOL_BASEREG (sym) = basereg;
+                     SYMBOL_BASEREG (sym) = DWARF2_REG_TO_REGNUM (basereg);
                    }
                }
              else
@@ -4528,38 +4531,7 @@ tag_type_to_type (struct die_info *die, struct objfile *objfile,
     }
   else
     {
-      struct attribute *attr;
-      attr = dwarf_attr (die, DW_AT_name);
-      if (attr && DW_STRING (attr))
-       {
-         char *attrname=DW_STRING (attr);
-         unsigned long hashval=hash(attrname, strlen(attrname)) % TYPE_HASH_SIZE;
-
-         if (dwarf2_cached_types[hashval] != NULL)
-           {
-             const char *nameoftype;
-             nameoftype = TYPE_NAME(dwarf2_cached_types[hashval]) == NULL ? TYPE_TAG_NAME(dwarf2_cached_types[hashval]) : TYPE_NAME(dwarf2_cached_types[hashval]);
-             if (strcmp(attrname, nameoftype) == 0)
-               {
-                 die->type=dwarf2_cached_types[hashval];
-               }
-             else
-               {
-                 read_type_die (die, objfile, cu_header);
-                 dwarf2_cached_types[hashval] = die->type;
-               }
-           }
-         else
-           {
-             read_type_die (die, objfile, cu_header);
-             dwarf2_cached_types[hashval] = die->type;
-           }
-       }
-      else
-       {
-         read_type_die (die, objfile, cu_header);
-       }
-
+      read_type_die (die, objfile, cu_header);
       if (!die->type)
        {
          dump_die (die);
@@ -5606,7 +5578,6 @@ static void
 dwarf2_empty_hash_tables (void)
 {
   memset (die_ref_table, 0, sizeof (die_ref_table));
-  memset (dwarf2_cached_types, 0, sizeof(dwarf2_cached_types));
 }
 
 static unsigned int
This page took 0.027615 seconds and 4 git commands to generate.