2007-06-18 Markus Deuling <deuling@de.ibm.com>
[deliverable/binutils-gdb.git] / gdb / xcoffread.c
index 08e1a2c5f925f2e1cde52286f446b82e12d9f5ee..e5c2e08bbdf518452cecc675e7832a3131491e74 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.
@@ -868,7 +868,8 @@ xcoff_next_symbol_text (struct objfile *objfile)
   struct internal_syment symbol;
   char *retval;
   /* FIXME: is this the same as the passed arg? */
-  objfile = this_symtab_psymtab->objfile;
+  if (this_symtab_psymtab)
+    objfile = this_symtab_psymtab->objfile;
 
   bfd_coff_swap_sym_in (objfile->obfd, raw_symbol, &symbol);
   if (symbol.n_zeroes)
@@ -924,7 +925,7 @@ read_xcoff_symtab (struct partial_symtab *pst)
   int depth = 0;
   int fcn_start_addr = 0;
 
-  struct coff_symbol fcn_stab_saved;
+  struct coff_symbol fcn_stab_saved = { 0 };
 
   /* fcn_cs_saved is global because process_xcoff_symbol needs it. */
   union internal_auxent fcn_aux_saved;
@@ -2170,6 +2171,7 @@ scan_xcoff_symtab (struct objfile *objfile)
   last_source_file = NULL;
 
   abfd = objfile->obfd;
+  next_symbol_text_func = xcoff_next_symbol_text;
 
   sraw_symbol = ((struct coff_symfile_info *) objfile->deprecated_sym_private)->symtbl;
   nsyms = ((struct coff_symfile_info *) objfile->deprecated_sym_private)->symtbl_num_syms;
@@ -3013,6 +3015,8 @@ 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.  */
   NULL                         /* next: pointer to next struct sym_fns */
 };
 
@@ -3025,6 +3029,7 @@ _initialize_xcoffread (void)
                                "<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,
+    init_type (TYPE_CODE_INT, 
+              gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT, 0,
               "<variable, no debug info>", NULL);
 }
This page took 0.026035 seconds and 4 git commands to generate.