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 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,
--- /dev/null
+/* 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 */
+
opcodes_sorted = 1;
}
- read_memory (memaddr, &insn, sizeof (insn));
+ read_memory (memaddr, (char *) &insn, sizeof (insn));
for (i = 0; i < NUMOPCODES; ++i)
{
return "run";
}
+/* Nonzero if there is a core file. */
+
have_core_file_p ()
{
return 0;
#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
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;
{
/* 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;
#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;
{
/* 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. */
#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;
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;
{
/* 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;
{
/* 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 */
{
}
/* 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.
#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;
{
}
void
-fetch_inferior_registers()
+fetch_inferior_registers (regno)
+ int regno;
{
int i;
struct pt_regset regs;
/* 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;
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
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);
current_target->to_shortname);
}
-static int
+static void
noprocess ()
{
error ("You can't do that without a process to debug");
/* 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);
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);
/* 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.
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. */
* NOTE: Assumes AMD's binary compatibility standard.
*/
-int
+void
store_inferior_registers (regno)
int 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));
{
sprintf (buf, "writing all special registers");
perror_with_name (buf);
- return -1;
+ return;
}
#else
store_inferior_registers(GR1_REGNUM);
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 ()
{
/* 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.
#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. */
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));
and the remaining args are passed as arguments to it. */
/* VARARGS */
-volatile void
+NORETURN void
error (va_alist)
va_dcl
{
/* 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
{
/* 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
{
/* We should never get here, but just in case... */
exit (1);
}
+
\f
/* Memory management stuff (malloc friends). */
void
init_malloc ()
{
+ extern PTR (*__morecore) PARAMS ((long));
+
mcheck (malloc_botch);
mtrace ();
}
/* 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;
/* Like realloc but get error if no storage available. */
-#ifdef __STDC__
-void *
-#else
-char *
-#endif
+PTR
xrealloc (ptr, size)
char *ptr;
long size;
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
const char *linebuffer;
FILE *stream;
{
- char *lineptr;
+ const char *lineptr;
if (linebuffer == 0)
return;
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) \
(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;
fprintf_filtered (va_alist)
va_dcl
{
- va_list args;
FILE *stream;
char *format;
+ va_list args;
va_start (args);
stream = va_arg (args, FILE *);
/* 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);
}
va_start (args);
format = va_arg (args, char *);
- (void) vfprintf_filtered (stdout, format, args);
+ vfprintf_filtered (stdout, format, args);
va_end (args);
}
}
\f
/* C++ demangler stuff. */
-char *cplus_demangle ();
/* Print NAME on STREAM, demangling if necessary. */
void
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. */
int
check_field (arg1, name)
- register value arg1;
- char *name;
+ register const value arg1;
+ const char *name;
{
register struct type *t;