* h8300s now new target, not alias of h8300h
[deliverable/binutils-gdb.git] / gdb / dwarfread.c
index 0bfb4fdda68837e4199807d4b8c76482edbd2e67..dc72f87661d2b2d72989e709b1c8cfa5d8a375ba 100644 (file)
@@ -1,6 +1,6 @@
 /* DWARF debugging format support for GDB.
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001
+   2001, 2002
    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.
@@ -239,11 +239,6 @@ typedef unsigned int DIE_REF;      /* Reference to a DIE */
 
 #define        AT_short_element_list    (0x00f0|FORM_BLOCK2)
 
-/* 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,
    one is a block of DWARF Information Entries (DIE's) and the other
    is a line number table.  The "struct dieinfo" structure contains
@@ -695,7 +690,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));
@@ -706,8 +701,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);
     }
@@ -1147,7 +1143,7 @@ read_structure_scope (struct dieinfo *dip, char *thisdie, char *enddie,
   struct symbol *sym;
 
   type = struct_type (dip, thisdie, enddie, objfile);
-  if (!(TYPE_FLAGS (type) & TYPE_FLAG_STUB))
+  if (!TYPE_STUB (type))
     {
       sym = new_symbol (dip, objfile);
       if (sym != NULL)
@@ -1956,11 +1952,9 @@ process_dies (char *thisdie, char *enddie, struct objfile *objfile)
            {
              nextdie = thisdie + di.die_length;
            }
-#ifdef SMASH_TEXT_ADDRESS
          /* I think that these are always text, not data, addresses.  */
-         SMASH_TEXT_ADDRESS (di.at_low_pc);
-         SMASH_TEXT_ADDRESS (di.at_high_pc);
-#endif
+         di.at_low_pc = SMASH_TEXT_ADDRESS (di.at_low_pc);
+         di.at_high_pc = SMASH_TEXT_ADDRESS (di.at_high_pc);
          switch (di.die_tag)
            {
            case TAG_compile_unit:
@@ -2268,7 +2262,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");
@@ -2284,8 +2278,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");
        }
@@ -2293,7 +2287,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.02474 seconds and 4 git commands to generate.