*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / dwarfread.c
index 70557173be9d87c042035d508b800eccd99af497..6eb0a0b06ed3d7350537d89ccacaea195a4969a5 100644 (file)
@@ -1,5 +1,6 @@
 /* DWARF debugging format support for GDB.
-   Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1998
+   Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+   2001
    Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support.  Portions based on dbxread.c,
    mipsread.c, coffread.c, and dwarfread.c from a Data General SVR4 gdb port.
@@ -240,7 +241,6 @@ typedef unsigned int DIE_REF;       /* Reference to a DIE */
 
 /* External variables referenced. */
 
-extern int info_verbose;       /* From main.c; nonzero => verbose */
 extern char *warning_pre_print;        /* From utils.c */
 
 /* The DWARF debugging information consists of two major pieces,
@@ -694,7 +694,7 @@ dwarf_build_psymtabs (struct objfile *objfile, int mainline, file_ptr dbfoff,
   dbbase = xmalloc (dbsize);
   dbroff = 0;
   if ((bfd_seek (abfd, dbfoff, SEEK_SET) != 0) ||
-      (bfd_read (dbbase, dbsize, 1, abfd) != dbsize))
+      (bfd_bread (dbbase, dbsize, abfd) != dbsize))
     {
       xfree (dbbase);
       error ("can't read DWARF data from '%s'", bfd_get_filename (abfd));
@@ -705,8 +705,9 @@ dwarf_build_psymtabs (struct objfile *objfile, int mainline, file_ptr dbfoff,
      Since we have no idea how many DIES we are looking at, we just guess
      some arbitrary value. */
 
-  if (mainline || objfile->global_psymbols.size == 0 ||
-      objfile->static_psymbols.size == 0)
+  if (mainline
+      || (objfile->global_psymbols.size == 0
+         && objfile->static_psymbols.size == 0))
     {
       init_psymbol_list (objfile, 1024);
     }
@@ -1838,7 +1839,11 @@ handle_producer (char *producer)
     {
       if (STREQN (producer, GPLUS_PRODUCER, strlen (GPLUS_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.  */
          set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
+#endif
        }
       else if (STREQN (producer, LCC_PRODUCER, strlen (LCC_PRODUCER)))
        {
@@ -2263,7 +2268,7 @@ read_ofile_symtab (struct partial_symtab *pst)
   base_section_offsets = pst->section_offsets;
   baseaddr = ANOFFSET (pst->section_offsets, 0);
   if (bfd_seek (abfd, foffset, SEEK_SET) ||
-      (bfd_read (dbbase, dbsize, 1, abfd) != dbsize))
+      (bfd_bread (dbbase, dbsize, abfd) != dbsize))
     {
       xfree (dbbase);
       error ("can't read DWARF data");
@@ -2279,8 +2284,8 @@ read_ofile_symtab (struct partial_symtab *pst)
   if (LNFOFF (pst))
     {
       if (bfd_seek (abfd, LNFOFF (pst), SEEK_SET) ||
-         (bfd_read ((PTR) lnsizedata, sizeof (lnsizedata), 1, abfd) !=
-          sizeof (lnsizedata)))
+         (bfd_bread ((PTR) lnsizedata, sizeof (lnsizedata), abfd)
+          != sizeof (lnsizedata)))
        {
          error ("can't read DWARF line number table size");
        }
@@ -2288,7 +2293,7 @@ read_ofile_symtab (struct partial_symtab *pst)
                               GET_UNSIGNED, pst->objfile);
       lnbase = xmalloc (lnsize);
       if (bfd_seek (abfd, LNFOFF (pst), SEEK_SET) ||
-         (bfd_read (lnbase, lnsize, 1, abfd) != lnsize))
+         (bfd_bread (lnbase, lnsize, abfd) != lnsize))
        {
          xfree (lnbase);
          error ("can't read DWARF line numbers");
This page took 0.024193 seconds and 4 git commands to generate.