daily update
[deliverable/binutils-gdb.git] / gdb / xcoffread.c
index 915bb1c85a3d6da1cfb6aced7ecc4636cc172cf3..1aeddbc8d833054f58fec9f4f908de15ef1552b3 100644 (file)
@@ -1,6 +1,6 @@
 /* Read AIX xcoff 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, 2007
    Free Software Foundation, Inc.
    Derived from coffread.c, dbxread.c, and a lot of hacking.
    Contributed by IBM Corporation.
@@ -9,7 +9,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -18,9 +18,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "bfd.h"
@@ -729,7 +727,7 @@ return_after_cleanup:
   memset (&main_subfile, '\0', sizeof (struct subfile));
 }
 
-void
+static void
 aix_process_linenos (void)
 {
   /* process line numbers and enter them into line vector */
@@ -1432,9 +1430,6 @@ read_xcoff_symtab (struct partial_symtab *pst)
   (ALLOCED) ? (NAME) : obsavestring ((NAME), strlen (NAME), &objfile->objfile_obstack);
 
 
-static struct type *func_symbol_type;
-static struct type *var_symbol_type;
-
 /* process one xcoff symbol. */
 
 static struct symbol *
@@ -1479,7 +1474,7 @@ process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
          patch_block_stabs (), unless the file was compiled without -g.  */
 
       DEPRECATED_SYMBOL_NAME (sym) = SYMNAME_ALLOC (name, symname_alloced);
-      SYMBOL_TYPE (sym) = func_symbol_type;
+      SYMBOL_TYPE (sym) = builtin_type (current_gdbarch)->nodebug_text_symbol;
 
       SYMBOL_CLASS (sym) = LOC_BLOCK;
       SYMBOL_DUP (sym, sym2);
@@ -1492,7 +1487,7 @@ process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
   else
     {
       /* In case we can't figure out the type, provide default. */
-      SYMBOL_TYPE (sym) = var_symbol_type;
+      SYMBOL_TYPE (sym) = builtin_type (current_gdbarch)->nodebug_data_symbol;
 
       switch (cs->c_sclass)
        {
@@ -2586,9 +2581,11 @@ scan_xcoff_symtab (struct objfile *objfile)
              {
              case 'S':
                symbol.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
-#ifdef STATIC_TRANSFORM_NAME
-               namestring = STATIC_TRANSFORM_NAME (namestring);
-#endif
+
+               if (gdbarch_static_transform_name_p (current_gdbarch))
+                 namestring = gdbarch_static_transform_name
+                                (current_gdbarch, namestring);
+
                add_psymbol_to_list (namestring, p - namestring,
                                     VAR_DOMAIN, LOC_STATIC,
                                     &objfile->static_psymbols,
@@ -3015,6 +3012,9 @@ static struct sym_fns xcoff_sym_fns =
   xcoff_initial_scan,          /* sym_read: read a symbol file into symtab */
   xcoff_symfile_finish,                /* sym_finish: finished with file, cleanup */
   xcoff_symfile_offsets,       /* sym_offsets: xlate offsets ext->int form */
+  default_symfile_segments,    /* sym_segments: Get segment information from
+                                  a file.  */
+  aix_process_linenos,          /* sym_read_linetable */
   NULL                         /* next: pointer to next struct sym_fns */
 };
 
@@ -3022,11 +3022,4 @@ void
 _initialize_xcoffread (void)
 {
   add_symtab_fns (&xcoff_sym_fns);
-
-  func_symbol_type = init_type (TYPE_CODE_FUNC, 1, 0,
-                               "<function, no debug info>", NULL);
-  TYPE_TARGET_TYPE (func_symbol_type) = builtin_type_int;
-  var_symbol_type =
-    init_type (TYPE_CODE_INT, TARGET_INT_BIT / HOST_CHAR_BIT, 0,
-              "<variable, no debug info>", NULL);
 }
This page took 0.036524 seconds and 4 git commands to generate.