* gdbarch.sh: Document the return_value method. Explain that
[deliverable/binutils-gdb.git] / gdb / dbxread.c
index 277008c972813c596470d184c53bbafab3450de1..bb9e21a69bac34ec9a7c99e2224b2bb983d63b8d 100644 (file)
@@ -1,6 +1,6 @@
 /* Read dbx symbol tables and convert to internal format, for GDB.
    Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004.
+   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2008.
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -1181,6 +1181,7 @@ units"),
 static void
 read_dbx_symtab (struct objfile *objfile)
 {
+  struct gdbarch *gdbarch = get_objfile_arch (objfile);
   struct external_nlist *bufp = 0;     /* =0 avoids gcc -Wall glitch */
   struct internal_nlist nlist;
   CORE_ADDR text_addr;
@@ -1312,7 +1313,6 @@ read_dbx_symtab (struct objfile *objfile)
 
       switch (nlist.n_type)
        {
-       char *p;
          /*
           * Standard, external, non-debugger, symbols
           */
@@ -1480,7 +1480,7 @@ read_dbx_symtab (struct objfile *objfile)
               don't relocate it.  */
 
            if (nlist.n_value == 0
-               && gdbarch_sofun_address_maybe_missing (current_gdbarch))
+               && gdbarch_sofun_address_maybe_missing (gdbarch))
              {
                textlow_not_set = 1;
                valu = 0;
@@ -1532,8 +1532,8 @@ read_dbx_symtab (struct objfile *objfile)
              }
 
            /* 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.  */
+              SOs for non-existant .c files.  We ignore all subsequent SOs
+              that immediately follow the first.  */
 
            if (!pst)
              {
@@ -1657,6 +1657,8 @@ pos %d"),
                                   suspect not.  */
        case N_M2C:             /* I suspect that I can ignore this here. */
        case N_SCOPE:           /* Same.   */
+       {
+         char *p;
 
          namestring = set_namestring (objfile, nlist);
 
@@ -1678,8 +1680,6 @@ pos %d"),
          if (!p)
            continue;                   /* Not a debugging symbol.   */
 
-
-
          /* Main processing section for debugging symbols which
             the initial read through the symbol tables needs to worry
             about.  If we reach this point, the symbol which we are
@@ -1693,9 +1693,9 @@ pos %d"),
              nlist.n_value += ANOFFSET (objfile->section_offsets,
                                         data_sect_index);
 
-             if (gdbarch_static_transform_name_p (current_gdbarch))
-               namestring = gdbarch_static_transform_name
-                 (current_gdbarch, namestring);
+             if (gdbarch_static_transform_name_p (gdbarch))
+               namestring = gdbarch_static_transform_name (gdbarch,
+                                                           namestring);
 
              add_psymbol_to_list (namestring, p - namestring,
                                   VAR_DOMAIN, LOC_STATIC,
@@ -1703,6 +1703,7 @@ pos %d"),
                                   0, nlist.n_value,
                                   psymtab_language, objfile);
              continue;
+
            case 'G':
              nlist.n_value += ANOFFSET (objfile->section_offsets,
                                         data_sect_index);
@@ -1743,6 +1744,7 @@ pos %d"),
                    }
                }
              goto check_enum;
+
            case 't':
              if (p != namestring)      /* a name is there, not just :T... */
                {
@@ -1823,6 +1825,7 @@ pos %d"),
                    }
                }
              continue;
+
            case 'c':
              /* Constant, e.g. from "const" in Pascal.  */
              add_psymbol_to_list (namestring, p - namestring,
@@ -1849,7 +1852,7 @@ pos %d"),
                 value for the bottom of the text seg in those cases. */
              if (nlist.n_value == ANOFFSET (objfile->section_offsets, 
                                             SECT_OFF_TEXT (objfile))
-                 && gdbarch_sofun_address_maybe_missing (current_gdbarch))
+                 && gdbarch_sofun_address_maybe_missing (gdbarch))
                {
                  CORE_ADDR minsym_valu = 
                    find_stab_function_addr (namestring, 
@@ -1864,7 +1867,7 @@ pos %d"),
                    nlist.n_value = minsym_valu;
                }
              if (pst && textlow_not_set
-                 && gdbarch_sofun_address_maybe_missing (current_gdbarch))
+                 && gdbarch_sofun_address_maybe_missing (gdbarch))
                {
                  pst->textlow = nlist.n_value;
                  textlow_not_set = 0;
@@ -1917,7 +1920,7 @@ pos %d"),
                 value for the bottom of the text seg in those cases. */
              if (nlist.n_value == ANOFFSET (objfile->section_offsets, 
                                             SECT_OFF_TEXT (objfile))
-                 && gdbarch_sofun_address_maybe_missing (current_gdbarch))
+                 && gdbarch_sofun_address_maybe_missing (gdbarch))
                {
                  CORE_ADDR minsym_valu = 
                    find_stab_function_addr (namestring, 
@@ -1932,7 +1935,7 @@ pos %d"),
                    nlist.n_value = minsym_valu;
                }
              if (pst && textlow_not_set
-                 && gdbarch_sofun_address_maybe_missing (current_gdbarch))
+                 && gdbarch_sofun_address_maybe_missing (gdbarch))
                {
                  pst->textlow = nlist.n_value;
                  textlow_not_set = 0;
@@ -2008,6 +2011,7 @@ pos %d"),
                 know about.  */
              continue;
            }
+       }
 
        case N_EXCL:
 
@@ -2068,7 +2072,7 @@ pos %d"),
             end_psymtab will set pst->texthigh to the proper value, which
             is necessary if a module compiled without debugging info
             follows this module.  */
-         if (pst && gdbarch_sofun_address_maybe_missing (current_gdbarch))
+         if (pst && gdbarch_sofun_address_maybe_missing (gdbarch))
            {
              end_psymtab (pst, psymtab_include_list, includes_used,
                           symnum * symbol_size,
@@ -2149,7 +2153,6 @@ pos %d"),
    is the address relative to which its symbols are (incremental) or 0
    (normal). */
 
-
 static struct partial_symtab *
 start_psymtab (struct objfile *objfile, char *filename, CORE_ADDR textlow,
               int ldsymoff, struct partial_symbol **global_syms,
@@ -2195,6 +2198,7 @@ end_psymtab (struct partial_symtab *pst, char **include_list, int num_includes,
 {
   int i;
   struct objfile *objfile = pst->objfile;
+  struct gdbarch *gdbarch = get_objfile_arch (objfile);
 
   if (capping_symbol_offset != -1)
     LDSYMLEN (pst) = capping_symbol_offset - LDSYMOFF (pst);
@@ -2216,7 +2220,7 @@ end_psymtab (struct partial_symtab *pst, char **include_list, int num_includes,
      last function in the file.  */
 
   if (pst->texthigh == 0 && last_function_name
-      && gdbarch_sofun_address_maybe_missing (current_gdbarch))
+      && gdbarch_sofun_address_maybe_missing (gdbarch))
     {
       char *p;
       int n;
@@ -2247,7 +2251,7 @@ end_psymtab (struct partial_symtab *pst, char **include_list, int num_includes,
       last_function_name = NULL;
     }
 
-  if (!gdbarch_sofun_address_maybe_missing (current_gdbarch))
+  if (!gdbarch_sofun_address_maybe_missing (gdbarch))
     ;
   /* this test will be true if the last .o file is only data */
   else if (textlow_not_set)
@@ -2677,6 +2681,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
                    struct section_offsets *section_offsets,
                    struct objfile *objfile)
 {
+  struct gdbarch *gdbarch = get_objfile_arch (objfile);
   struct context_stack *new;
   /* This remembers the address of the start of a function.  It is
      used because in Solaris 2, N_LBRAC, N_RBRAC, and N_SLINE entries
@@ -2767,7 +2772,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
 
       /* Relocate for dynamic loading.  */
       valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
-      valu = gdbarch_smash_text_address (current_gdbarch, valu);
+      valu = gdbarch_smash_text_address (gdbarch, valu);
       last_function_start = valu;
 
       goto define_a_symbol;
@@ -3107,7 +3112,7 @@ no enclosing block"));
              if (type == N_FUN
                  && valu == ANOFFSET (section_offsets,
                                       SECT_OFF_TEXT (objfile))
-                 && gdbarch_sofun_address_maybe_missing (current_gdbarch))
+                 && gdbarch_sofun_address_maybe_missing (gdbarch))
                {
                  CORE_ADDR minsym_valu = 
                    find_stab_function_addr (name, last_source_file, objfile);
This page took 0.041035 seconds and 4 git commands to generate.