signame.c, sparc-xdep.c: Prototypes for all static functions. Lint.
/* Work with core dump and executable files, for GDB.
- Copyright 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 "target.h"
#include "gdbcore.h"
-extern int xfer_memory ();
-extern void child_attach (), child_create_inferior ();
-extern void print_section_info ();
+#ifdef SOLIB_ADD
+static int
+solib_add_stub PARAMS ((char *));
+#endif
+
+static void
+core_close PARAMS ((int));
+
+static void
+core_open PARAMS ((char *, int));
+
+static void
+core_detach PARAMS ((char *, int));
+
+static void
+get_core_registers PARAMS ((int));
+
+static void
+core_files_info PARAMS ((struct target_ops *));
extern int sys_nerr;
extern char *sys_errlist[];
/* Hook for `exec_file_command' command to call. */
-void (*exec_file_display_hook) () = NULL;
+void (*exec_file_display_hook) PARAMS ((char *)) = NULL;
/* Binary file diddling handle for the core file. */
and mark data and stack spaces as empty. */
/* ARGSUSED */
-void
+static void
core_close (quitting)
int quitting;
{
#ifdef CLEAR_SOLIB
CLEAR_SOLIB ();
#endif
- if (core_ops.sections) {
- free (core_ops.sections);
- core_ops.sections = NULL;
- core_ops.sections_end = NULL;
+ if (core_ops.to_sections) {
+ free (core_ops.to_sections);
+ core_ops.to_sections = NULL;
+ core_ops.to_sections_end = NULL;
}
}
}
#ifdef SOLIB_ADD
/* Stub function for catch_errors around shared library hacking. */
-int
+static int
solib_add_stub (from_tty)
char *from_tty;
{
/* This routine opens and sets up the core file bfd */
-void
+static void
core_open (filename, from_tty)
char *filename;
int from_tty;
if (!bfd_check_format (temp_bfd, bfd_core))
{
- make_cleanup (bfd_close, temp_bfd); /* Do it after the err msg */
+ /* Do it after the err msg */
+ make_cleanup (bfd_close, temp_bfd);
error ("\"%s\" is not a core dump: %s", filename, bfd_errmsg(bfd_error));
}
validate_files ();
/* Find the data section */
- if (build_section_table (core_bfd, &core_ops.sections,
- &core_ops.sections_end))
+ if (build_section_table (core_bfd, &core_ops.to_sections,
+ &core_ops.to_sections_end))
error ("Can't find sections in `%s': %s", bfd_get_filename(core_bfd),
bfd_errmsg (bfd_error));
}
}
-void
+static void
core_detach (args, from_tty)
char *args;
int from_tty;
void
specify_exec_file_hook (hook)
- void (*hook) ();
+ void (*hook) PARAMS ((char *));
{
exec_file_display_hook = hook;
}
print_section_info (t, core_bfd);
}
\f
+/* Report a memory error with error(). */
+
void
memory_error (status, memaddr)
int status;
xfer_memory, core_files_info,
0, 0, /* core_insert_breakpoint, core_remove_breakpoint, */
0, 0, 0, 0, 0, /* terminal stuff */
- 0, 0, 0, 0, /* kill, load, call fn, lookup sym */
+ 0, 0, 0, /* kill, load, lookup sym */
child_create_inferior, 0, /* mourn_inferior */
core_stratum, 0, /* next */
0, 1, 1, 1, 0, /* all mem, mem, stack, regs, exec */
/* Multiple source language support for GDB.
- Copyright 1991 Free Software Foundation, Inc.
+ Copyright 1991, 1992 Free Software Foundation, Inc.
Contributed by the Department of Computer Science at the State University
of New York at Buffalo.
#include "value.h"
#include "gdbcmd.h"
#include "frame.h"
-#include "language.h"
#include "expression.h"
+#include "language.h"
#include "target.h"
#include "parser-defs.h"
-extern volatile void return_to_top_level ();
+static void
+show_language_command PARAMS ((char *, int));
+
+static void
+set_language_command PARAMS ((char *, int));
+
+static void
+show_type_command PARAMS ((char *, int));
-/* Forward function declarations */
-static void set_type_range ();
+static void
+set_type_command PARAMS ((char *, int));
+
+static void
+show_range_command PARAMS ((char *, int));
+
+static void
+set_range_command PARAMS ((char *, int));
+
+static void
+set_range_str PARAMS ((void));
+
+static void
+set_type_str PARAMS ((void));
+
+static void
+set_lang_str PARAMS ((void));
+
+static void
+unk_lang_error PARAMS ((char *));
+
+static int
+unk_lang_parser PARAMS ((void));
+
+static void
+show_check PARAMS ((char *, int));
+
+static void
+set_check PARAMS ((char *, int));
+
+static void
+set_type_range PARAMS ((void));
/* Forward declaration */
extern const struct language_defn unknown_language_defn;
-
+
/* The current (default at startup) state of type and range checking.
(If the modes are set to "auto", though, these are changed based
on the default language at startup, and then again based on the
/* The list of supported languages. The list itself is malloc'd. */
-static struct language_defn **languages;
+static const struct language_defn **languages;
static unsigned languages_size;
static unsigned languages_allocsize;
#define DEFAULT_ALLOCSIZE 3
char lang_frame_mismatch_warn[] =
"Warning: the current language does not match this frame.";
-void set_lang_str();
-void set_type_str();
-void set_range_str();
\f
/* This page contains the functions corresponding to GDB commands
and their helpers. */
/* Show command. Display a warning if the language set
does not match the frame. */
-void
+static void
show_language_command (ignore, from_tty)
char *ignore;
int from_tty;
}
/* Set command. Change the current working language. */
-void
+static void
set_language_command (ignore, from_tty)
char *ignore;
int from_tty;
/* Show command. Display a warning if the type setting does
not match the current language. */
-void
+static void
show_type_command(ignore, from_tty)
char *ignore;
int from_tty;
}
/* Set command. Change the setting for type checking. */
-void
+static void
set_type_command(ignore, from_tty)
char *ignore;
int from_tty;
/* Show command. Display a warning if the range setting does
not match the current language. */
-void
+static void
show_range_command(ignore, from_tty)
char *ignore;
int from_tty;
}
/* Set command. Change the setting for range checking. */
-void
+static void
set_range_command(ignore, from_tty)
char *ignore;
int from_tty;
\f
/* This page contains functions that update the global vars
language, type and range. */
-void
+static void
set_lang_str()
{
char *prefix = "";
language = concat(prefix, current_language->la_name, NULL);
}
-void
+static void
set_type_str()
{
char *tmp, *prefix = "";
type = concat(prefix,tmp,NULL);
}
-void
+static void
set_range_str()
{
char *tmp, *pref = "";
/* Print out the current language settings: language, range and
- type checking. */
+ type checking. If QUIETLY, print only what has changed. */
void
-language_info ()
+language_info (quietly)
+ int quietly;
{
+ /* FIXME: quietly is ignored at the moment. */
printf("Current Language: %s\n",language);
show_language_command((char *)0, 1);
printf("Type checking: %s\n",type);
}
\f
/* Return the result of a binary operation. */
+
+#if 0 /* Currently unused */
+
struct type *
binop_result_type(v1,v2)
value v1,v2;
abort();
return (struct type *)0; /* For lint */
}
+
+#endif /* 0 */
+
\f
/* This page contains functions that return format strings for
printf for printing out numbers in different formats */
TYPE_LENGTH(type) == sizeof(char)
? 1 : 0;
}
+ return (0);
}
/* Returns non-zero if the value is a boolean type */
case language_cplus:
return TYPE_CODE(type) != TYPE_CODE_INT ? 0 : 1;
}
+ return (0);
}
/* Returns non-zero if the value is a floating-point type */
(TYPE_CODE(type) == TYPE_CODE_SET) ||
(TYPE_CODE(type) == TYPE_CODE_ARRAY);
}
+ return (0);
}
\f
/* This page contains functions that return info about
\f
/* Returns non-zero if the operator OP is defined on
the values ARG1 and ARG2. */
+
+#if 0 /* Currently unused */
+
void
binop_type_check(arg1,arg2,op)
value arg1,arg2;
}
}
}
+
+#endif /* 0 */
+
\f
/* This page contains functions for the printing out of
error messages that occur during type- and range-
[type|range]_check is [type|range]_check_on, then return_to_top_level()
is called in the style of error (). Otherwise, the message is prefixed
by "warning: " and we do not return to the top level. */
+
void
type_error (va_alist)
- va_dcl
+ va_dcl
{
va_list args;
char *string;
void
range_error (va_alist)
- va_dcl
+ va_dcl
{
va_list args;
char *string;
void
add_language (lang)
- struct language_defn *lang;
+ const struct language_defn *lang;
{
if (lang->la_magic != LANG_MAGIC)
{
if (!languages)
{
languages_allocsize = DEFAULT_ALLOCSIZE;
- languages = (struct language_defn **) xmalloc
+ languages = (const struct language_defn **) xmalloc
(languages_allocsize * sizeof (*languages));
}
if (languages_size >= languages_allocsize)
{
languages_allocsize *= 2;
- languages = (struct language_defn **) xrealloc (languages,
+ languages = (const struct language_defn **) xrealloc ((char *) languages,
languages_allocsize * sizeof (*languages));
}
languages[languages_size++] = lang;
/* Define the language that is no language. */
-int
+static int
unk_lang_parser ()
{
return 1;
}
-void
-unk_lang_error ()
+static void
+unk_lang_error (msg)
+ char *msg;
{
error ("Attempted to parse an expression with unknown language");
}
/* Convert between signal names and numbers, for GDB.
- Copyright 1990, 1991 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
This file is part of GDB.
#include <stdio.h>
#include <signal.h>
-#include "signame.h"
-
/* GDB-specific, FIXME. (This is for the SYS_SIGLIST_MISSING define). */
#include "defs.h"
+#include "signame.h"
-#ifdef __STDC__
-#define CONST const
-#else
-#define CONST
-#endif
+static void
+init_sig PARAMS ((int, const char *, const char *));
+
+static void
+init_sigs PARAMS ((void));
#if SYS_SIGLIST_MISSING
/* There is too much variation in Sys V signal numbers and names, so
we must initialize them at runtime. */
-static CONST char undoc[] = "unknown signal";
+static const char undoc[] = "unknown signal";
/* We'd like to make this const char*[], but whoever's using it might
want to assign from it to a char*. */
typedef struct
{
int number;
- CONST char *abbrev;
+ const char *abbrev;
} num_abbrev;
static num_abbrev sig_table[NSIG*2];
/* Number of elements of sig_table used. */
static void
init_sig (number, abbrev, name)
int number;
- CONST char *abbrev;
- CONST char *name;
+ const char *abbrev;
+ const char *name;
{
#if SYS_SIGLIST_MISSING
sys_siglist[number] = (char *) name;
signal by that name. */
int
sig_number (abbrev)
- CONST char *abbrev;
+ const char *abbrev;
{
int i;
void
psignal (signal, message)
unsigned signal;
- CONST char *message;
+ const char *message;
{
if (signal <= 0 || signal >= NSIG)
fprintf (stderr, "%s: unknown signal", message);
/* Host-dependent code for SPARC host systems, for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1990, 1991 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
This file is part of GDB.
If REGNO is -1, do this for all registers.
Otherwise, REGNO specifies which register (so we can save time). */
-int
+void
store_inferior_registers (regno)
int regno;
{
else
{
deferred_stores |= wanna_store;
- return 0;
+ return;
}
}
ptrace (PTRACE_SETFPREGS, inferior_pid, &inferior_fp_registers))
perror("ptrace_setfpregs");
}
- return 0;
}
\f
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 */
{
if (which == 0) {