* amd64fbsd-nat.c: Include <sys/types.h, <machine/pcb.h> and
[deliverable/binutils-gdb.git] / gdb / dbxread.c
index c1f7f8c7603409857a0793b0f17ab900b85a90ae..a505c7774bcdcd16d454fd9fd9be3658e8440fb3 100644 (file)
@@ -1,6 +1,6 @@
 /* Read dbx symbol tables and convert to internal format, for GDB.
    Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003.
+   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004.
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -49,7 +49,6 @@
 #include "target.h"
 #include "gdbcore.h"           /* for bfd stuff */
 #include "libaout.h"           /* FIXME Secret internal BFD stuff for a.out */
-#include "symfile.h"
 #include "objfiles.h"
 #include "buildsym.h"
 #include "stabsread.h"
@@ -1359,12 +1358,6 @@ read_dbx_symtab (struct objfile *objfile)
              || (namestring[(nsl = strlen (namestring)) - 1] == 'o'
                  && namestring[nsl - 2] == '.'))
          {
-           if (objfile->ei.entry_point < nlist.n_value &&
-               objfile->ei.entry_point >= last_o_file_start)
-             {
-               objfile->ei.deprecated_entry_file_lowpc = last_o_file_start;
-               objfile->ei.deprecated_entry_file_highpc = nlist.n_value;
-             }
            if (past_first_source_file && pst
                /* The gould NP1 uses low values for .o and -l symbols
                   which are not the address.  */
@@ -1464,6 +1457,7 @@ read_dbx_symtab (struct objfile *objfile)
            static int prev_so_symnum = -10;
            static int first_so_symnum;
            char *p;
+           static char *dirname_nso;
            int prev_textlow_not_set;
 
            valu = nlist.n_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
@@ -1521,18 +1515,27 @@ read_dbx_symtab (struct objfile *objfile)
 
            p = strrchr (namestring, '/');
            if (p && *(p + 1) == '\000')
-             continue;         /* Simply ignore directory name SOs */
+             {
+               /* Save the directory name SOs locally, then save it into
+                  the psymtab when it's created below. */
+               dirname_nso = namestring;
+               continue;               
+             }
 
            /* Some other compilers (C++ ones in particular) emit useless
               SOs for non-existant .c files.  We ignore all subsequent SOs that
               immediately follow the first.  */
 
            if (!pst)
+             {
              pst = start_psymtab (objfile,
                                   namestring, valu,
                                   first_so_symnum * symbol_size,
                                   objfile->global_psymbols.next,
                                   objfile->static_psymbols.next);
+               pst->dirname = dirname_nso;
+               dirname_nso = NULL;
+             }
            continue;
          }
 
@@ -2100,16 +2103,6 @@ read_dbx_symtab (struct objfile *objfile)
     }
 
   /* If there's stuff to be cleaned up, clean it up.  */
-  if (DBX_SYMCOUNT (objfile) > 0       /* We have some syms */
-      /*FIXME, does this have a bug at start address 0? */
-      && last_o_file_start
-      && objfile->ei.entry_point < nlist.n_value
-      && objfile->ei.entry_point >= last_o_file_start)
-    {
-      objfile->ei.deprecated_entry_file_lowpc = last_o_file_start;
-      objfile->ei.deprecated_entry_file_highpc = nlist.n_value;
-    }
-
   if (pst)
     {
       /* Don't set pst->texthigh lower than it already is.  */
@@ -3393,8 +3386,7 @@ coffstab_build_psymtabs (struct objfile *objfile, int mainline,
 }
 \f
 /* Scan and build partial symbols for an ELF symbol file.
-   This ELF file has already been processed to get its minimal symbols,
-   and any DWARF symbols that were in it.
+   This ELF file has already been processed to get its minimal symbols.
 
    This routine is the equivalent of dbx_symfile_init and dbx_symfile_read
    rolled into one.
This page took 0.024964 seconds and 4 git commands to generate.