* write.c (relax_segment <rs_space>): Calculate growth using
[deliverable/binutils-gdb.git] / gdb / dbxread.c
index 5a8a09f983aa70402cfce13fdef2dcc51bdb084f..d3a1489bc8159314ab6910921d124d11db063f73 100644 (file)
@@ -1,5 +1,6 @@
 /* Read dbx symbol tables and convert to internal format, for GDB.
-   Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+   1996, 1997, 1998, 1999, 2000, 2001
    Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "obstack.h"
 #include "gdb_stat.h"
-#include <ctype.h>
 #include "symtab.h"
 #include "breakpoint.h"
-#include "command.h"
 #include "target.h"
 #include "gdbcore.h"           /* for bfd stuff */
 #include "libaout.h"           /* FIXME Secret internal BFD stuff for a.out */
@@ -58,6 +57,7 @@
 #include "demangle.h"
 #include "language.h"          /* Needed inside partial-stab.h */
 #include "complaints.h"
+#include "cp-abi.h"
 
 #include "aout/aout64.h"
 #include "aout/stab_gnu.h"     /* We always use GNU stabs, not native, now */
@@ -213,7 +213,8 @@ find_text_range (bfd * sym_bfd, struct objfile *objfile)
 {
   asection *sec;
   int found_any = 0;
-  CORE_ADDR start, end;
+  CORE_ADDR start = 0;
+  CORE_ADDR end = 0;
 
   for (sec = sym_bfd->sections; sec; sec = sec->next)
     if (bfd_get_section_flags (sym_bfd, sec) & SEC_CODE)
@@ -323,7 +324,7 @@ free_header_files (void)
 {
   if (this_object_header_files)
     {
-      free ((PTR) this_object_header_files);
+      xfree (this_object_header_files);
       this_object_header_files = NULL;
     }
   n_allocated_this_object_header_files = 0;
@@ -514,7 +515,7 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type,
        char *tempstring = name;
        if (tempstring[0] == bfd_get_symbol_leading_char (objfile->obfd))
          ++tempstring;
-       if (VTBL_PREFIX_P ((tempstring)))
+       if (is_vtable_name (tempstring))
          ms_type = mst_data;
       }
       section = SECT_OFF_DATA (objfile);
@@ -767,10 +768,10 @@ dbx_symfile_finish (struct objfile *objfile)
 
          while (--i >= 0)
            {
-             free (hfiles[i].name);
-             free (hfiles[i].vector);
+             xfree (hfiles[i].name);
+             xfree (hfiles[i].vector);
            }
-         free ((PTR) hfiles);
+         xfree (hfiles);
        }
       mfree (objfile->md, objfile->sym_stab_info);
     }
@@ -788,15 +789,15 @@ static int symbuf_end;
    completed after all the stabs are read.  */
 struct cont_elem
   {
-    /* sym and stabsstring for continuing information in cfront */
+    /* sym and stabstring for continuing information in cfront */
     struct symbol *sym;
     char *stabs;
-    /* state dependancies (statics that must be preserved) */
+    /* state dependencies (statics that must be preserved) */
     int sym_idx;
     int sym_end;
     int symnum;
     int (*func) (struct objfile *, struct symbol *, char *);
-    /* other state dependancies include:
+    /* other state dependencies include:
        (assumption is that these will not change since process_now FIXME!!)
        stringtab_global
        n_stabs
@@ -1093,7 +1094,7 @@ read_dbx_dynamic_symtab (struct objfile *objfile)
     return;
 
   dynsyms = (asymbol **) xmalloc (dynsym_size);
-  back_to = make_cleanup (free, dynsyms);
+  back_to = make_cleanup (xfree, dynsyms);
 
   dynsym_count = bfd_canonicalize_dynamic_symtab (abfd, dynsyms);
   if (dynsym_count < 0)
@@ -1156,7 +1157,7 @@ read_dbx_dynamic_symtab (struct objfile *objfile)
     }
 
   dynrels = (arelent **) xmalloc (dynrel_size);
-  make_cleanup (free, dynrels);
+  make_cleanup (xfree, dynrels);
 
   dynrel_count = bfd_canonicalize_dynamic_reloc (abfd, dynrels, dynsyms);
   if (dynrel_count < 0)
@@ -1738,6 +1739,9 @@ read_ofile_symtab (struct partial_symtab *pst)
       /* Try to select a C++ demangling based on the compilation unit
          producer. */
 
+#if 0
+      /* For now, stay with AUTO_DEMANGLING for g++ output, as we don't
+        know whether it will use the old style or v3 mangling.  */
       if (processing_gcc_compilation)
        {
          if (AUTO_DEMANGLING)
@@ -1745,6 +1749,7 @@ read_ofile_symtab (struct partial_symtab *pst)
              set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
            }
        }
+#endif
     }
   else
     {
@@ -1798,10 +1803,14 @@ read_ofile_symtab (struct partial_symtab *pst)
          else if (STREQ (namestring, GCC2_COMPILED_FLAG_SYMBOL))
            processing_gcc_compilation = 2;
 
+#if 0
+         /* For now, stay with AUTO_DEMANGLING for g++ output, as we don't
+            know whether it will use the old style or v3 mangling.  */
          if (AUTO_DEMANGLING)
            {
              set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
            }
+#endif
        }
       else if (type & N_EXT || type == (unsigned char) N_TEXT
               || type == (unsigned char) N_NBTEXT
@@ -1836,7 +1845,7 @@ read_ofile_symtab (struct partial_symtab *pst)
 
   pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile));
 
-  /* Process items which we had to "process_later" due to dependancies 
+  /* Process items which we had to "process_later" due to dependencies 
      on other stabs.  */
   process_now (objfile);
 
@@ -2194,7 +2203,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
          case N_ROSYM:
            goto case_N_ROSYM;
          default:
-           abort ();
+           internal_error (__FILE__, __LINE__, "failed internal consistency check");
          }
       }
 
@@ -2367,7 +2376,9 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
          if (STREQ (name, GCC2_COMPILED_FLAG_SYMBOL))
            {
              processing_gcc_compilation = 2;
-#if 1                          /* Works, but is experimental.  -fnf */
+#if 0                          /* Works, but is experimental.  -fnf */
+             /* For now, stay with AUTO_DEMANGLING for g++ output, as we don't
+                know whether it will use the old style or v3 mangling.  */
              if (AUTO_DEMANGLING)
                {
                  set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
This page took 0.025951 seconds and 4 git commands to generate.