* gdbarch.sh (GET_LONGJMP_TARGET): Add rule.
[deliverable/binutils-gdb.git] / gdb / os9kread.c
index d3e782f9ae1711ba86d7cd8ce83371c0f8852004..498498ba2b5176a0db82a0ac41c440337836e50c 100644 (file)
@@ -1,5 +1,6 @@
 /* Read os9/os9k symbol tables and convert to internal format, for GDB.
-   Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 96, 1998
+   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+   1996, 1997, 1998, 1999, 2000, 2001
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -35,6 +36,7 @@
 
 #include "defs.h"
 #include "gdb_string.h"
+#include "gdb_assert.h"
 #include <stdio.h>
 
 #if defined(USG) || defined(__CYGNUSCLIB__)
@@ -44,7 +46,6 @@
 
 #include "obstack.h"
 #include "gdb_stat.h"
-#include <ctype.h>
 #include "symtab.h"
 #include "breakpoint.h"
 #include "command.h"
@@ -94,9 +95,6 @@ static int psymfile_depth = 0;
 /* keep symbol table file nested depth */
 static int symfile_depth = 0;
 
-/* Nonzero means give verbose info on gdb action.  From main.c.  */
-extern int info_verbose;
-
 extern int previous_stab_code;
 
 /* Name of last function encountered.  Used in Solaris to approximate
@@ -186,11 +184,8 @@ static void record_minimal_symbol (char *, CORE_ADDR, int, struct objfile *);
 #define N_ABS 6
 
 static void
-record_minimal_symbol (name, address, type, objfile)
-     char *name;
-     CORE_ADDR address;
-     int type;
-     struct objfile *objfile;
+record_minimal_symbol (char *name, CORE_ADDR address, int type,
+                      struct objfile *objfile)
 {
   enum minimal_symbol_type ms_type;
 
@@ -244,8 +239,7 @@ struct stbsymbol
 #define STBSYMSIZE 10
 
 static void
-read_minimal_symbols (objfile)
-     struct objfile *objfile;
+read_minimal_symbols (struct objfile *objfile)
 {
   FILE *fp;
   bfd *abfd;
@@ -316,17 +310,16 @@ read_minimal_symbols (objfile)
    table (as opposed to a shared lib or dynamically loaded file).  */
 
 static void
-os9k_symfile_read (objfile, mainline)
-     struct objfile *objfile;
-     int mainline;             /* FIXME comments above */
+os9k_symfile_read (struct objfile *objfile, int mainline)
 {
   bfd *sym_bfd;
   struct cleanup *back_to;
 
   sym_bfd = objfile->obfd;
   /* If we are reinitializing, or if we have never loaded syms yet, init */
-  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, DBX_SYMCOUNT (objfile));
 
   free_pending_blocks ();
@@ -349,8 +342,7 @@ os9k_symfile_read (objfile, mainline)
    file, e.g. a shared library).  */
 
 static void
-os9k_new_init (ignore)
-     struct objfile *ignore;
+os9k_new_init (struct objfile *ignore)
 {
   stabsread_new_init ();
   buildsym_new_init ();
@@ -371,8 +363,7 @@ os9k_new_init (ignore)
    FIXME, there should be a cleaner peephole into the BFD environment here.  */
 
 static void
-os9k_symfile_init (objfile)
-     struct objfile *objfile;
+os9k_symfile_init (struct objfile *objfile)
 {
   bfd *sym_bfd = objfile->obfd;
   char *name = bfd_get_filename (sym_bfd);
@@ -420,12 +411,11 @@ os9k_symfile_init (objfile)
    objfile struct from the global list of known objfiles. */
 
 static void
-os9k_symfile_finish (objfile)
-     struct objfile *objfile;
+os9k_symfile_finish (struct objfile *objfile)
 {
   if (objfile->sym_stab_info != NULL)
     {
-      mfree (objfile->md, objfile->sym_stab_info);
+      xmfree (objfile->md, objfile->sym_stab_info);
     }
 /*
    free_header_files ();
@@ -476,9 +466,7 @@ static short cmplrid;
 #define VER_ULTRAC     ((short)5)
 
 static int
-fill_sym (dbg_file, abfd)
-     FILE *dbg_file;
-     bfd *abfd;
+fill_sym (FILE *dbg_file, bfd *abfd)
 {
   short si, nmask;
   long li;
@@ -552,10 +540,7 @@ fill_sym (dbg_file, abfd)
    SYMFILE_NAME is the name of the file we are reading from. */
 
 static void
-read_os9k_psymtab (objfile, text_addr, text_size)
-     struct objfile *objfile;
-     CORE_ADDR text_addr;
-     int text_size;
+read_os9k_psymtab (struct objfile *objfile, CORE_ADDR text_addr, int text_size)
 {
   register struct internal_symstruct *bufp = 0;                /* =0 avoids gcc -Wall glitch */
   register char *namestring;
@@ -973,15 +958,10 @@ read_os9k_psymtab (objfile, text_addr, text_size)
 
 
 static struct partial_symtab *
-os9k_start_psymtab (objfile,
-           filename, textlow, ldsymoff, ldsymcnt, global_syms, static_syms)
-     struct objfile *objfile;
-     char *filename;
-     CORE_ADDR textlow;
-     int ldsymoff;
-     int ldsymcnt;
-     struct partial_symbol **global_syms;
-     struct partial_symbol **static_syms;
+os9k_start_psymtab (struct objfile *objfile, char *filename, CORE_ADDR textlow,
+                   int ldsymoff, int ldsymcnt,
+                   struct partial_symbol **global_syms,
+                   struct partial_symbol **static_syms)
 {
   struct partial_symtab *result =
   start_psymtab_common (objfile, objfile->section_offsets,
@@ -1004,16 +984,11 @@ os9k_start_psymtab (objfile,
    FIXME:  List variables and peculiarities of same.  */
 
 static struct partial_symtab *
-os9k_end_psymtab (pst, include_list, num_includes, capping_symbol_cnt,
-                 capping_text, dependency_list, number_dependencies)
-     struct partial_symtab *pst;
-     char **include_list;
-     int num_includes;
-     int capping_symbol_cnt;
-     CORE_ADDR capping_text;
-     struct partial_symtab **dependency_list;
-     int number_dependencies;
-     /* struct partial_symbol *capping_global, *capping_static; */
+os9k_end_psymtab (struct partial_symtab *pst, char **include_list,
+                 int num_includes, int capping_symbol_cnt,
+                 CORE_ADDR capping_text,
+                 struct partial_symtab **dependency_list,
+                 int number_dependencies)
 {
   int i;
   struct partial_symtab *p1;
@@ -1188,8 +1163,7 @@ os9k_end_psymtab (pst, include_list, num_includes, capping_symbol_cnt,
 }
 \f
 static void
-os9k_psymtab_to_symtab_1 (pst)
-     struct partial_symtab *pst;
+os9k_psymtab_to_symtab_1 (struct partial_symtab *pst)
 {
   struct cleanup *old_chain;
   int i;
@@ -1242,8 +1216,7 @@ os9k_psymtab_to_symtab_1 (pst)
    Be verbose about it if the user wants that.  */
 
 static void
-os9k_psymtab_to_symtab (pst)
-     struct partial_symtab *pst;
+os9k_psymtab_to_symtab (struct partial_symtab *pst)
 {
   bfd *sym_bfd;
 
@@ -1282,8 +1255,7 @@ os9k_psymtab_to_symtab (pst)
 
 /* Read in a defined section of a specific object file's symbols. */
 static void
-os9k_read_ofile_symtab (pst)
-     struct partial_symtab *pst;
+os9k_read_ofile_symtab (struct partial_symtab *pst)
 {
   register struct internal_symstruct *bufp;
   unsigned char type;
@@ -1433,12 +1405,9 @@ os9k_read_ofile_symtab (pst)
    It is used in end_symtab.  */
 
 static void
-os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
-     int type, desc;
-     CORE_ADDR valu;
-     char *name;
-     struct section_offsets *section_offsets;
-     struct objfile *objfile;
+os9k_process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
+                        struct section_offsets *section_offsets,
+                        struct objfile *objfile)
 {
   register struct context_stack *new;
   /* The stab type used for the definition of the last function.
@@ -1539,6 +1508,7 @@ os9k_process_one_symbol (type, desc, valu, name, section_offsets, objfile)
       /* Relocate for dynamic loading and for ELF acc fn-relative syms.  */
       valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
       /* FIXME: loses if sizeof (char *) > sizeof (int) */
+      gdb_assert (sizeof (name) <= sizeof (int));
       record_line (current_subfile, (int) name, valu);
       break;
 
@@ -1645,7 +1615,7 @@ static struct sym_fns os9k_sym_fns =
 };
 
 void
-_initialize_os9kread ()
+_initialize_os9kread (void)
 {
   add_symtab_fns (&os9k_sym_fns);
 }
This page took 0.025911 seconds and 4 git commands to generate.