Lint.
authorJohn Gilmore <gnu@cygnus>
Thu, 2 Apr 1992 10:35:19 +0000 (10:35 +0000)
committerJohn Gilmore <gnu@cygnus>
Thu, 2 Apr 1992 10:35:19 +0000 (10:35 +0000)
* symfile.c (add_symbol_file_command):  Initialize mapped/readnow.

gdb/ChangeLog
gdb/c-exp.y
gdb/command.c
gdb/dbxread.c
gdb/gdbtypes.c
gdb/m2-exp.y
gdb/symfile.c
gdb/tm-sun4os4.h
gdb/tm-sun4os5.h
gdb/values.c

index a25d9d3..cebeb96 100644 (file)
@@ -1,3 +1,11 @@
+Thu Apr  2 00:55:56 1992  John Gilmore  (gnu at cygnus.com)
+
+       * c-exp.y, coffread.c, command.c, command.h, copying.awk,
+       dbxread.c, gdbtypes.c, infcmd.c, inferior.h, infrun.c,
+       m2-exp.y, printcmd.c, remote.c, solib.c, source.c, stack.c,
+       symtab.c, tm-sun4os4.h, tm-sun4os5.h, values.c:  Lint.
+       * symfile.c (add_symbol_file_command):  Initialize mapped/readnow.
+
 Wed Apr  1 11:39:52 1992  Fred Fish  (fnf@cygnus.com)
 
        * breakpoint.h (bpdisp, bptype):  Remove trailing comma.
index 7d197b9..b3bf309 100644 (file)
@@ -38,6 +38,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "parser-defs.h"
 #include "value.h"
 #include "language.h"
+#include "bfd.h"
+#include "symfile.h"
+#include "objfiles.h"
 
 /* Ensure that if the generated parser contains any calls to malloc/realloc,
    that they get mapped to xmalloc/xrealloc. */
index f5e0cec..3d91010 100644 (file)
@@ -45,6 +45,9 @@ parse_binary_operation PARAMS ((char *));
 static void
 print_doc_line PARAMS ((FILE *, char *));
 
+extern void
+not_just_help_class_command PARAMS ((char *, int));
+
 /* Add element named NAME to command list *LIST.
    FUN should be the function to execute the command;
    it will get a character string as argument, with leading
@@ -186,10 +189,9 @@ add_abbrev_prefix_cmd (name, class, fun, doc, prefixlist, prefixname,
 
 /* ARGSUSED */
 void
-not_just_help_class_command (args, from_tty, c)
+not_just_help_class_command (args, from_tty)
      char *args;
      int from_tty;
-     struct cmd_list_element *c;
 {
 }
 
index 999e0f7..a69f39e 100644 (file)
@@ -53,6 +53,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "command.h"
 #include "target.h"
 #include "gdbcore.h"           /* for bfd stuff */
+#include "libbfd.h"            /* FIXME Secret internal BFD stuff (bfd_read) */
 #include "libaout.h"           /* FIXME Secret internal BFD stuff for a.out */
 #include "symfile.h"
 #include "objfiles.h"
@@ -260,13 +261,13 @@ free_header_files ()
        {
          free (header_files[i].name);
        }
-      free (header_files);
+      free ((PTR)header_files);
       header_files = NULL;
       n_header_files = 0;
     }
   if (this_object_header_files)
     {
-      free (this_object_header_files);
+      free ((PTR)this_object_header_files);
       this_object_header_files = NULL;
     }
   n_allocated_header_files = 0;
@@ -475,8 +476,8 @@ dbx_symfile_read (objfile, addr, mainline)
    file, e.g. a shared library).  */
 
 static void
-dbx_new_init (objfile)
-     struct objfile *objfile;
+dbx_new_init (ignore)
+     struct objfile *ignore;
 {
   buildsym_new_init ();
   init_header_files ();
@@ -506,7 +507,7 @@ dbx_symfile_init (objfile)
   unsigned char size_temp[4];
 
   /* Allocate struct to keep track of the symfile */
-  DBX_SYMFILE_INFO (objfile) = (struct dbx_symfile_info *)
+  objfile->sym_private = (PTR)
     xmmalloc (objfile -> md, sizeof (struct dbx_symfile_info));
 
   /* FIXME POKING INSIDE BFD DATA STRUCTURES */
@@ -535,7 +536,7 @@ dbx_symfile_init (objfile)
   if (val < 0)
     perror_with_name (name);
 
-  val = bfd_read (size_temp, sizeof (long), 1, sym_bfd);
+  val = bfd_read ((PTR)size_temp, sizeof (long), 1, sym_bfd);
   if (val < 0)
     perror_with_name (name);
 
@@ -572,9 +573,9 @@ static void
 dbx_symfile_finish (objfile)
      struct objfile *objfile;
 {
-  if (DBX_SYMFILE_INFO (objfile) != NULL)
+  if (objfile->sym_private != NULL)
     {
-      mfree (objfile -> md, DBX_SYMFILE_INFO (objfile));
+      mfree (objfile -> md, objfile->sym_private);
     }
   free_header_files ();
 }
@@ -602,7 +603,7 @@ static void
 fill_symbuf (sym_bfd)
      bfd *sym_bfd;
 {
-  int nbytes = bfd_read (symbuf, sizeof (symbuf), 1, sym_bfd);
+  int nbytes = bfd_read ((PTR)symbuf, sizeof (symbuf), 1, sym_bfd);
   if (nbytes < 0)
     perror_with_name (bfd_get_filename (sym_bfd));
   else if (nbytes == 0)
@@ -649,9 +650,9 @@ init_psymbol_list (objfile)
 {
   /* Free any previously allocated psymbol lists.  */
   if (objfile -> global_psymbols.list)
-    mfree (objfile -> md, objfile -> global_psymbols.list);
+    mfree (objfile -> md, (PTR)objfile -> global_psymbols.list);
   if (objfile -> static_psymbols.list)
-    mfree (objfile -> md, objfile -> static_psymbols.list);
+    mfree (objfile -> md, (PTR)objfile -> static_psymbols.list);
 
   /* Current best guess is that there are approximately a twentieth
      of the total symbols (in a debugging file) are global or static
@@ -724,7 +725,7 @@ static void
 free_bincl_list (objfile)
      struct objfile *objfile;
 {
-  mfree (objfile -> md, bincl_list);
+  mfree (objfile -> md, (PTR)bincl_list);
   bincls_allocated = 0;
 }
 
@@ -741,7 +742,7 @@ read_dbx_symtab (addr, objfile, text_addr, text_size)
      CORE_ADDR text_addr;
      int text_size;
 {
-  register struct internal_nlist *bufp;
+  register struct internal_nlist *bufp = 0;    /* =0 avoids gcc -Wall glitch */
   register char *namestring;
   int nsl;
   int past_first_source_file = 0;
@@ -1064,17 +1065,14 @@ psymtab_to_symtab_1 (pst, sym_offset)
   pst->readin = 1;
 }
 
-/*
- * Read in all of the symbols for a given psymtab for real.
- * Be verbose about it if the user wants that.
- */
+/* Read in all of the symbols for a given psymtab for real.
+   Be verbose about it if the user wants that.  */
+
 static void
 dbx_psymtab_to_symtab (pst)
      struct partial_symtab *pst;
 {
-  int val;
   bfd *sym_bfd;
-  long st_temp;
 
   if (!pst)
     return;
index 788fda8..19dd66a 100644 (file)
@@ -317,6 +317,8 @@ type_name_no_tag (type)
                name += 5;
              }
            break;
+         default:              /* To avoid -Wall warnings */
+           break;
        }
     }
   return (name);
index 2657eb9..a1bf96f 100644 (file)
@@ -39,6 +39,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "language.h"
 #include "value.h"
 #include "parser-defs.h"
+#include "bfd.h"
+#include "symfile.h"
+#include "objfiles.h"
 
 /* Ensure that if the generated parser contains any calls to malloc/realloc,
    that they get mapped to xmalloc/xrealloc. */
index 3cfe4ea..8ef5ed9 100644 (file)
@@ -446,7 +446,6 @@ symbol_file_add (name, from_tty, addr, mainline, mapped, readnow)
   struct objfile *objfile;
   struct partial_symtab *psymtab;
   bfd *abfd;
-  int mapped_it;
 
   /* Open a bfd for the file and then check to see if the file has a
      symbol table.  There is a distinction between having no symbol table
@@ -550,7 +549,6 @@ symbol_file_command (args, from_tty)
   char **argv;
   char *name = NULL;
   struct cleanup *cleanups;
-  struct objfile *objfile;
   int mapped = 0;
   int readnow = 0;
 
@@ -603,7 +601,7 @@ symbol_file_command (args, from_tty)
          /* Getting new symbols may change our opinion about what is
             frameless.  */
          reinit_frame_cache ();
-         objfile = symbol_file_add (name, from_tty, (CORE_ADDR)0, 1,
+         (void) symbol_file_add (name, from_tty, (CORE_ADDR)0, 1,
                                     mapped, readnow);
        }
       do_cleanups (cleanups);
@@ -678,7 +676,7 @@ static void
 find_sym_fns (objfile)
      struct objfile *objfile;
 {
-  struct sym_fns *sf, *sf2;
+  struct sym_fns *sf;
 
   for (sf = symtab_fns; sf != NULL; sf = sf -> next)
     {
@@ -715,8 +713,8 @@ add_symbol_file_command (args, from_tty)
   char *name = NULL;
   CORE_ADDR text_addr;
   char *arg;
-  int readnow;
-  int mapped;
+  int readnow = 0;
+  int mapped = 0;
   
   dont_repeat ();
 
@@ -1127,18 +1125,21 @@ int
 free_named_symtabs (name)
      char *name;
 {
-  register struct symtab *s;
-  register struct symtab *prev;
-  register struct partial_symtab *ps;
-  struct blockvector *bv;
-  int blewit = 0;
-
 #if 0
   /* FIXME:  With the new method of each objfile having it's own
      psymtab list, this function needs serious rethinking.  In particular,
      why was it ever necessary to toss psymtabs with specific compilation
      unit filenames, as opposed to all psymtabs from a particular symbol
-     file. */
+     file?  -- fnf
+     Well, the answer is that some systems permit reloading of particular
+     compilation units.  We want to blow away any old info about these
+     compilation units, regardless of which objfiles they arrived in. --gnu.  */
+
+  register struct symtab *s;
+  register struct symtab *prev;
+  register struct partial_symtab *ps;
+  struct blockvector *bv;
+  int blewit = 0;
 
   /* We only wack things if the symbol-reload switch is set.  */
   if (!symbol_reloading)
index 309720a..6fec921 100644 (file)
@@ -44,4 +44,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
    extract the pc (JB_PC) that we will land at.  The pc is copied into ADDR.
    This routine returns true on success */
 
+extern int
+get_longjmp_target PARAMS ((CORE_ADDR *));
+
 #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
index e241bbd..942fb87 100644 (file)
@@ -47,6 +47,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
    extract the pc (JB_PC) that we will land at.  The pc is copied into ADDR.
    This routine returns true on success */
 
-#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
+extern int
+get_longjmp_target PARAMS ((CORE_ADDR *));
 
+#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
 #endif  /* 0 */
index 998c42e..512cc64 100644 (file)
@@ -26,6 +26,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "frame.h"
 #include "command.h"
 #include "gdbcmd.h"
+#include "target.h"
 
 /* Local function prototypes. */
 
@@ -36,7 +37,7 @@ static void
 show_values PARAMS ((char *, int));
 
 static void
-show_convenience PARAMS ((void));
+show_convenience PARAMS ((char *, int));
 
 /* The value-history records all the values printed
    by print commands during this session.  Each chunk
@@ -481,7 +482,9 @@ clear_internalvars ()
 }
 
 static void
-show_convenience ()
+show_convenience (ignore, from_tty)
+     char *ignore;
+     int from_tty;
 {
   register struct internalvar *var;
   int varseen = 0;
@@ -494,10 +497,6 @@ show_convenience ()
 #endif
       if (!varseen)
        {
-#if 0
-         /* Useless noise.  */
-         printf ("Debugger convenience variables:\n\n");
-#endif
          varseen = 1;
        }
       printf_filtered ("$%s = ", var->name);