* tm-sparc.h, tm-sysv4.h, solib.h: Move shared lib definitions
authorJohn Gilmore <gnu@cygnus>
Fri, 21 Feb 1992 03:35:37 +0000 (03:35 +0000)
committerJohn Gilmore <gnu@cygnus>
Fri, 21 Feb 1992 03:35:37 +0000 (03:35 +0000)
into solib.h.
* sparc-pinsn.c, sparc-tdep.c, standalonec, sun3-xdep.c,
sun386-xdep.c, symm-xdep.c, target.c, ultra3-xdep.c, utils.c,
value.h: Prototypes for static functions; lint.
* gdbtypes.h:  Empty file to ease transition.

13 files changed:
gdb/ChangeLog
gdb/gdbtypes.h [new file with mode: 0644]
gdb/solib.h [new file with mode: 0644]
gdb/sparc-pinsn.c
gdb/standalone.c
gdb/sun3-xdep.c
gdb/sun386-xdep.c
gdb/symm-xdep.c
gdb/target.c
gdb/tm-sysv4.h
gdb/ultra3-xdep.c
gdb/utils.c
gdb/valops.c

index 059ae53a4aad466d49e37ca41ef16d9e697736bd..536e2717905ef8e2632c95c725c9c7b06763dbf2 100644 (file)
@@ -1,3 +1,12 @@
+Thu Feb 20 18:10:17 1992  Fred Fish  (fnf at cygnus.com)
+
+       * tm-sparc.h, tm-sysv4.h, solib.h:  Move shared lib definitions
+       into solib.h.
+       * sparc-pinsn.c, sparc-tdep.c, standalonec, sun3-xdep.c,
+       sun386-xdep.c, symm-xdep.c, target.c, ultra3-xdep.c, utils.c,
+       value.h: Prototypes for static functions; lint.
+       * gdbtypes.h:  Empty file to ease transition.
+
 Thu Feb 20 16:43:13 1992  Fred Fish  (fnf at cygnus.com)
 
        * environ.h, expression.h, frame.h, gdbcmd.h, gdbcore.h,
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/gdb/solib.h b/gdb/solib.h
new file mode 100644 (file)
index 0000000..b0c6afc
--- /dev/null
@@ -0,0 +1,57 @@
+/* Shared library declarations for GDB, the GNU Debugger.
+   Copyright (C) 1992 Free Software Foundation, Inc.
+
+This file is part of GDB.
+
+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
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+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., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+#ifdef __STDC__                /* Forward decl's for prototypes */
+struct target_ops;
+#endif
+
+/* Called when we free all symtabs, to free the shared library information
+   as well. */
+
+#define CLEAR_SOLIB                    clear_solib
+
+extern void
+clear_solib PARAMS ((void));
+
+/* Called to add symbols from a shared library to gdb's symbol table. */
+
+#define SOLIB_ADD(filename, from_tty, targ) \
+    solib_add (filename, from_tty, targ)
+
+extern void
+solib_add PARAMS ((char *, int, struct target_ops *));
+
+/* Function to be called when the inferior starts up, to discover the names
+   of shared libraries that are dynamically linked, the base addresses to
+   which they are linked, and sufficient information to read in their symbols
+   at a later time. */
+
+#define SOLIB_CREATE_INFERIOR_HOOK     solib_create_inferior_hook
+
+extern void
+solib_create_inferior_hook PARAMS((void));     /* solib.c */
+
+/* If we can't set a breakpoint, and it's in a shared library, just
+   disable it.  */
+
+#define DISABLE_UNSETTABLE_BREAK(addr) solib_address(addr)
+
+extern int
+solib_address PARAMS ((CORE_ADDR));            /* solib.c */
+
index 332b0ad9644cabfeafb1df4167d05bef4a886cb5..cb4b5d29707ded89a7903742e1006b73903f6040 100644 (file)
@@ -116,7 +116,7 @@ print_insn (memaddr, stream)
       opcodes_sorted = 1;
     }
 
-  read_memory (memaddr, &insn, sizeof (insn));
+  read_memory (memaddr, (char *) &insn, sizeof (insn));
 
   for (i = 0; i < NUMOPCODES; ++i)
     {
index b91a1f82222e04f080b31eef9ea5d2b9adc818a0..163a6399b6a76ba85cd40d115aac684320bde1e3 100644 (file)
@@ -338,6 +338,8 @@ get_exec_file (err)
   return "run";
 }
 
+/* Nonzero if there is a core file.  */
+
 have_core_file_p ()
 {
   return 0;
index 295dff83dbaa42fd38452868181c721b277ddfdd..2a3a4a19931bc105f1b9d61ec5110c2fb70430d8 100644 (file)
@@ -31,7 +31,8 @@ extern int errno;
 #if defined (GDB_TARGET_IS_SUN3)
 /* All of this stuff is only relevant if both host and target are sun3.  */
 void
-fetch_inferior_registers ()
+fetch_inferior_registers (regno)
+     int regno;
 {
   struct regs inferior_registers;
 #ifdef FP0_REGNUM
@@ -64,6 +65,7 @@ fetch_inferior_registers ()
    If REGNO is -1, do this for all registers.
    Otherwise, REGNO specifies which register (so we can save time).  */
 
+void
 store_inferior_registers (regno)
      int regno;
 {
@@ -96,10 +98,11 @@ store_inferior_registers (regno)
 /* Machine-dependent code for pulling registers out of a Sun-3 core file. */
 
 void
-fetch_core_registers (core_reg_sect, core_reg_size, which)
+fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
      char *core_reg_sect;
      unsigned core_reg_size;
      int which;
+     unsigned int reg_addr;    /* Unused in this version */
 {
   extern char registers[];
   struct regs *regs = (struct regs *) core_reg_sect;
@@ -135,12 +138,15 @@ fetch_core_registers (core_reg_sect, core_reg_size, which)
 #else /* Not sun3 target.  */
 /* These functions shouldn't be called when we're cross-debugging.  */
 
+/* ARGSUSED */
 void
-fetch_inferior_registers ()
+fetch_inferior_registers (regno)
+     int regno;
 {
 }
 
 /* ARGSUSED */
+void
 store_inferior_registers (regno)
      int regno;
 {
@@ -148,10 +154,11 @@ store_inferior_registers (regno)
 
 /* ARGSUSED */
 void
-fetch_core_registers (core_reg_sect, core_reg_size, which)
+fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
      char *core_reg_sect;
      unsigned core_reg_size;
      int which;
+     unsigned int reg_addr;    /* Unused in this version */
 {
 }
 #endif /* Not sun3 target.  */
index 0a356477b48d129fed9783f08e8d4680fbda7112..b56a159135f5aa9973498c124280a65dafa01127 100644 (file)
@@ -41,9 +41,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <sys/file.h>
 #include <sys/stat.h>
 #include <sys/core.h>
+
 \f
 void
-fetch_inferior_registers ()
+fetch_inferior_registers (regno)
+     int regno;
 {
   struct regs inferior_registers;
   struct fp_state inferior_fp_registers;
@@ -67,6 +69,7 @@ fetch_inferior_registers ()
    If REGNO is -1, do this for all registers.
    Otherwise, REGNO specifies which register (so we can save time).  */
 
+void
 store_inferior_registers (regno)
      int regno;
 {
@@ -255,12 +258,15 @@ double_to_i387 (from, to)
 
 /* These functions shouldn't be called when we're cross-debugging.  */
 
+/* ARGSUSED */
 void
-fetch_inferior_registers ()
+fetch_inferior_registers (regno)
+     int regno;
 {
 }
 
 /* ARGSUSED */
+void
 store_inferior_registers (regno)
      int regno;
 {
@@ -268,10 +274,11 @@ store_inferior_registers (regno)
 
 /* ARGSUSED */
 void
-fetch_core_registers (core_reg_sect, core_reg_size, which)
+fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
      char *core_reg_sect;
      unsigned core_reg_size;
      int which;
+     unsigned int reg_addr;    /* Unused in this version */
 {
 }
 
index a0508a9f3d16a3bc1581ed0764eabe325af2b490..0d20c53ebfed8535d0c7c89e9c191207ab819ed4 100644 (file)
@@ -1,5 +1,5 @@
 /* Sequent Symmetry host interface, for GDB when running under Unix.
-   Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
+   Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -37,10 +37,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <sgtty.h>
 #define TERMINAL struct sgttyb
 
-extern void print_387_control_word ();
-extern void print_387_status_word ();
-extern void i387_to_double (from, to);
+#include "gdbcore.h"
 
+void
 store_inferior_registers(regno)
 int regno;
 {
@@ -112,7 +111,8 @@ int regno;
 }
 
 void
-fetch_inferior_registers()
+fetch_inferior_registers (regno)
+     int regno;
 {
     int i;
     struct pt_regset regs;
@@ -148,8 +148,6 @@ fetch_inferior_registers()
 /* Work with core dump and executable files, for GDB. 
    This code would be in core.c if it weren't machine-dependent. */
 
-#include "gdbcore.h"
-
 void
 core_file_command (filename, from_tty)
      char *filename;
index eefdbea26491eada005a8c3f7a2d6000436a103f..c78eecb3583705d90e30999bc3667456f8ff9fda 100644 (file)
@@ -31,10 +31,41 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 extern int errno;
 
-extern int memory_insert_breakpoint(), memory_remove_breakpoint();
-extern void host_convert_to_virtual(), host_convert_from_virtual();
+static void
+target_info PARAMS ((char *, int));
+
+static void
+cleanup_target PARAMS ((struct target_ops *));
+
+static void
+maybe_kill_then_create_inferior PARAMS ((char *, char *, char **));
+
+static void
+maybe_kill_then_attach PARAMS ((char *, int));
+
+static void
+kill_or_be_killed PARAMS ((int));
+
+static void
+default_terminal_info PARAMS ((char *, int));
+
+static int
+nosymbol PARAMS ((char *, CORE_ADDR *));
+
+static void
+noprocess PARAMS ((void));
+
+static void
+tcomplain PARAMS ((void));
+
+static int
+nomemory PARAMS ((CORE_ADDR, char *, int, int));
+
+static void
+ignore PARAMS ((void));
 
-static void cleanup_target ();
+static void
+target_command PARAMS ((char *, int));
 
 /* Pointer to array of target architecture structures; the size of the
    array; the current index into the array; the allocated size of the 
@@ -110,8 +141,9 @@ add_target (t)
   if (target_struct_size >= target_struct_allocsize)
     {
       target_struct_allocsize *= 2;
-      target_structs = (struct target_ops **) xrealloc (target_structs, 
-       target_struct_allocsize * sizeof (*target_structs));
+      target_structs = (struct target_ops **)
+         xrealloc ((char *) target_structs, 
+                   target_struct_allocsize * sizeof (*target_structs));
     }
   target_structs[target_struct_size++] = t;
   cleanup_target (t);
@@ -152,7 +184,7 @@ tcomplain ()
         current_target->to_shortname);
 }
 
-static int
+static void
 noprocess ()
 {
   error ("You can't do that without a process to debug");
@@ -271,19 +303,19 @@ cleanup_target (t)
 
   /*        FIELD                      DEFAULT VALUE        */
 
-  de_fault (to_open,                   tcomplain);
+  de_fault (to_open,                   (void (*)())tcomplain);
   de_fault (to_close,                  (void (*)())ignore);
   de_fault (to_attach,                         maybe_kill_then_attach);
   de_fault (to_detach,                         (void (*)())ignore);
   de_fault (to_resume,                         (void (*)())noprocess);
-  de_fault (to_wait,                   noprocess);
-  de_fault (to_fetch_registers,        ignore);
+  de_fault (to_wait,                   (int (*)())noprocess);
+  de_fault (to_fetch_registers,        (void (*)())ignore);
   de_fault (to_store_registers,                (void (*)())noprocess);
   de_fault (to_prepare_to_store,       (void (*)())noprocess);
   de_fault (to_convert_to_virtual,     host_convert_to_virtual);
   de_fault (to_convert_from_virtual,   host_convert_from_virtual);
-  de_fault (to_xfer_memory,            nomemory);
-  de_fault (to_files_info,             ignore);
+  de_fault (to_xfer_memory,            (int (*)())nomemory);
+  de_fault (to_files_info,             (void (*)())ignore);
   de_fault (to_insert_breakpoint,      memory_insert_breakpoint);
   de_fault (to_remove_breakpoint,      memory_remove_breakpoint);
   de_fault (to_terminal_init,          ignore);
@@ -292,7 +324,7 @@ cleanup_target (t)
   de_fault (to_terminal_ours,          ignore);
   de_fault (to_terminal_info,          default_terminal_info);
   de_fault (to_kill,                   (void (*)())noprocess);
-  de_fault (to_load,                   tcomplain);
+  de_fault (to_load,                   (void (*)())tcomplain);
   de_fault (to_lookup_symbol,          nosymbol);
   de_fault (to_create_inferior,                maybe_kill_then_create_inferior);
   de_fault (to_mourn_inferior,         (void (*)())noprocess);
index f1eea2057ce5512c7f076bdd9c3ac50214fd4131..4d95ea0502e78446847446b7ebcf520ba0ba99fa 100644 (file)
@@ -1,6 +1,6 @@
 /* Macro definitions for GDB on all SVR4 target systems.
-   Copyright (C) 1991, Free Software Foundation, Inc.
-   Written by Fred Fish at Cygnus Support (fnf@cygint)
+   Copyright (C) 1991, 1992, Free Software Foundation, Inc.
+   Written by Fred Fish at Cygnus Support (fnf@cygnus.com).
 
 This file is part of GDB.
 
@@ -18,20 +18,4 @@ 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., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
-/* Support for SVR4 shared libraries. */
-
-#define CLEAR_SOLIB                    clear_solib
-extern void clear_solib ();                    /* solib.c */
-
-#define SOLIB_ADD(filename, from_tty, targ) solib_add (filename, from_tty, targ)
-extern void solib_add ();                      /* solib.c */
-
-#define SOLIB_CREATE_INFERIOR_HOOK     solib_create_inferior_hook
-extern void solib_create_inferior_hook();      /* solib.c */
-
-/* If we can't set a breakpoint, and it's in a shared library, just
-   disable it.  */
-
-#define DISABLE_UNSETTABLE_BREAK(addr) solib_address(addr)
-extern int solib_address ();                   /* solib.c */
-
+#include "solib.h"     /* Support for shared libraries. */
index 35eff11691c7ca8aeb1de46c641e63ac3e6872b1..505df6aca053c031e43cf4d6092d2de75763bf54 100644 (file)
@@ -156,7 +156,7 @@ fetch_inferior_registers (regno)
  * NOTE: Assumes AMD's binary compatibility standard. 
  */
 
-int
+void
 store_inferior_registers (regno)
      int regno;
 {
@@ -166,7 +166,7 @@ store_inferior_registers (regno)
   if (regno >= 0)
     {
       if (CANNOT_STORE_REGISTER(regno)) 
-       return 0;                       /*  Pretend success */
+       return;
       regaddr = register_addr (regno, 0);
       errno = 0;
       ptrace (PT_WRITE_U, inferior_pid,(int*)regaddr,read_register(regno));
@@ -209,7 +209,7 @@ store_inferior_registers (regno)
        {
           sprintf (buf, "writing all special registers");
           perror_with_name (buf);
-          return -1;
+          return;
        }
 #else
       store_inferior_registers(GR1_REGNUM);
@@ -229,13 +229,13 @@ store_inferior_registers (regno)
       store_inferior_registers(FC_REGNUM);
 #endif /* ULTRA3 */
     }
-  return 0;
 }
 
 /* 
  * Read AMD's Binary Compatibilty Standard conforming core file.
  * struct ptrace_user is the first thing in the core file
  */
+
 void
 fetch_core_registers ()
 {
index 3fba8bf58629e44479519da6f6b2cb1882127af1..0f7b2f841c9b5a8fe01bbcc4a316f6d9f4aa1e40 100644 (file)
@@ -1,5 +1,5 @@
 /* General utility routines for GDB, the GNU debugger.
-   Copyright (C) 1986, 1989, 1990, 1991 Free Software Foundation, Inc.
+   Copyright 1986, 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -32,10 +32,24 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "bfd.h"
 #include "target.h"
 
-extern volatile void return_to_top_level ();
-extern volatile void exit ();
-extern char *gdb_readline ();
-extern char *getenv();
+/* Prototypes for local functions */
+
+#if !defined (NO_MALLOC_CHECK)
+static void
+malloc_botch PARAMS ((void));
+#endif /* NO_MALLOC_CHECK  */
+
+static void
+fatal_dump_core ();    /* Can't prototype with <varargs.h> usage... */
+
+static void
+prompt_for_continue PARAMS ((void));
+
+static void 
+set_width_command PARAMS ((char *, int, struct cmd_list_element *));
+
+static void
+vfprintf_filtered PARAMS ((FILE *, char *, va_list));
 
 /* If this definition isn't overridden by the header files, assume
    that isatty and fileno exist on this system.  */
@@ -86,8 +100,8 @@ char *warning_pre_print;
 
 struct cleanup *
 make_cleanup (function, arg)
-     void (*function) ();
-     int arg;
+     void (*function) PARAMS ((PTR));
+     PTR arg;
 {
   register struct cleanup *new
     = (struct cleanup *) xmalloc (sizeof (struct cleanup));
@@ -223,7 +237,7 @@ warning (va_alist)
    and the remaining args are passed as arguments to it.  */
 
 /* VARARGS */
-volatile void
+NORETURN void
 error (va_alist)
      va_dcl
 {
@@ -245,10 +259,13 @@ error (va_alist)
 
 /* Print an error message and exit reporting failure.
    This is for a error that we cannot continue from.
-   The arguments are printed a la printf.  */
+   The arguments are printed a la printf.
+
+   This function cannot be declared volatile (NORETURN) in an
+   ANSI environment because exit() is not declared volatile. */
 
 /* VARARGS */
-volatile void
+NORETURN void
 fatal (va_alist)
      va_dcl
 {
@@ -266,8 +283,9 @@ fatal (va_alist)
 
 /* Print an error message and exit, dumping core.
    The arguments are printed a la printf ().  */
+
 /* VARARGS */
-void
+static void
 fatal_dump_core (va_alist)
      va_dcl
 {
@@ -288,6 +306,7 @@ fatal_dump_core (va_alist)
   /* We should never get here, but just in case...  */
   exit (1);
 }
+
 \f
 /* Memory management stuff (malloc friends).  */
 
@@ -305,6 +324,8 @@ malloc_botch ()
 void
 init_malloc ()
 {
+  extern PTR (*__morecore) PARAMS ((long));
+
   mcheck (malloc_botch);
   mtrace ();
 }
@@ -312,18 +333,13 @@ init_malloc ()
 
 /* Like malloc but get error if no storage available.  */
 
-#ifdef __STDC__
-void *
-#else
-char *
-#endif
+PTR
 xmalloc (size)
      long size;
 {
   register char *val;
 
-  /* At least one place (dbxread.c:condense_misc_bunches where misc_count == 0)
-     GDB wants to allocate zero bytes.  */
+  /* Protect against gdb wanting to allocate zero bytes. */
   if (size == 0)
     return NULL;
   
@@ -335,11 +351,7 @@ xmalloc (size)
 
 /* Like realloc but get error if no storage available.  */
 
-#ifdef __STDC__
-void *
-#else
-char *
-#endif
+PTR
 xrealloc (ptr, size)
      char *ptr;
      long size;
@@ -550,6 +562,7 @@ query (va_alist)
       printf ("Please answer y or n.\n");
     }
 }
+
 \f
 /* Parse a C escape sequence.  STRING_PTR points to a variable
    containing a pointer to the string to parse.  That pointer
@@ -804,7 +817,7 @@ fputs_filtered (linebuffer, stream)
      const char *linebuffer;
      FILE *stream;
 {
-  char *lineptr;
+  const char *lineptr;
 
   if (linebuffer == 0)
     return;
@@ -912,11 +925,6 @@ fputs_demangled (linebuffer, stream, arg_mode)
      FILE *stream;
      int arg_mode;
 {
-#ifdef __STDC__
-  extern char *cplus_demangle (const char *, int);
-#else
-  extern char *cplus_demangle ();
-#endif
 #define SYMBOL_MAX 1024
 
 #define SYMBOL_CHAR(c) (isascii(c) \
@@ -998,12 +1006,11 @@ fputs_demangled (linebuffer, stream, arg_mode)
    (since prompt_for_continue may do so) so this routine should not be
    called when cleanups are not in place.  */
 
-/* VARARGS */
-void
+static void
 vfprintf_filtered (stream, format, args)
-     va_list args;
      FILE *stream;
      char *format;
+     va_list args;
 {
   static char *linebuffer = (char *) 0;
   static int line_size;
@@ -1041,9 +1048,9 @@ void
 fprintf_filtered (va_alist)
      va_dcl
 {
-  va_list args;
   FILE *stream;
   char *format;
+  va_list args;
 
   va_start (args);
   stream = va_arg (args, FILE *);
@@ -1051,7 +1058,7 @@ fprintf_filtered (va_alist)
 
   /* This won't blow up if the restrictions described above are
      followed.   */
-  (void) vfprintf_filtered (stream, format, args);
+  vfprintf_filtered (stream, format, args);
   va_end (args);
 }
 
@@ -1066,7 +1073,7 @@ printf_filtered (va_alist)
   va_start (args);
   format = va_arg (args, char *);
 
-  (void) vfprintf_filtered (stdout, format, args);
+  vfprintf_filtered (stdout, format, args);
   va_end (args);
 }
 
@@ -1113,7 +1120,6 @@ print_spaces_filtered (n, stream)
 }
 \f
 /* C++ demangler stuff.  */
-char *cplus_demangle ();
 
 /* Print NAME on STREAM, demangling if necessary.  */
 void
index c340932a043665f8254588a41613f1584abe8f5b..83d6ec89c9367aafe33b9cf94a4d36f9609f2b09 100644 (file)
@@ -1211,8 +1211,8 @@ value_struct_elt (argp, args, name, static_memfuncp, err)
    if NAME is inappropriate for TYPE, an error is signaled.  */
 int
 destructor_name_p (name, type)
-     char *name;
-     struct type *type;
+     const char *name;
+     const struct type *type;
 {
   /* destructors are a special case.  */
 
@@ -1272,8 +1272,8 @@ check_field_in (type, name)
 
 int
 check_field (arg1, name)
-     register value arg1;
-     char *name;
+     register const value arg1;
+     const char *name;
 {
   register struct type *t;
 
This page took 0.034851 seconds and 4 git commands to generate.