Completed function declarations and/or added prototypes and/or #includes

to get the prototypes.

Changed some `int's to `boolean_t's.  boolean_t's are ints so they are
hard to distinguish from ints.

Converted function headers to old-style.  ddb is written in K&R1 C
except where we broke it.
This commit is contained in:
Bruce Evans 1995-11-24 14:13:42 +00:00
parent 4753168fae
commit 058284fceb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12473
14 changed files with 98 additions and 68 deletions

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_access.c,v 1.6 1994/08/18 22:34:18 wollman Exp $
* $Id: db_access.c,v 1.7 1995/05/30 07:56:46 rgrimes Exp $
*/
/*
@ -34,6 +34,7 @@
#include <sys/systm.h>
#include <sys/proc.h>
#include <ddb/ddb.h>
#include <ddb/db_access.h>
/*
* Access unaligned data items on aligned (longword)

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_aout.c,v 1.10 1995/01/25 21:37:04 bde Exp $
* $Id: db_aout.c,v 1.11 1995/05/30 07:56:49 rgrimes Exp $
*/
/*
@ -116,7 +116,8 @@ X_db_sym_init(symtab, esymtab, name)
}
}
db_add_symbol_table(sym_start, sym_end, name, (char *)symtab);
db_add_symbol_table((char *)sym_start, (char *)sym_end, name,
(char *)symtab);
}
db_sym_t

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_break.c,v 1.5 1994/08/18 22:34:19 wollman Exp $
* $Id: db_break.c,v 1.6 1995/05/30 07:56:50 rgrimes Exp $
*/
/*
@ -42,7 +42,6 @@
#include <ddb/db_break.h>
#include <ddb/db_access.h>
#include <ddb/db_sym.h>
#include <ddb/db_break.h>
#define NBREAKPOINTS 100
struct db_breakpoint db_break_table[NBREAKPOINTS];
@ -264,7 +263,7 @@ db_list_breakpoints()
void
db_delete_cmd(addr, have_addr, count, modif)
db_expr_t addr;
int have_addr;
boolean_t have_addr;
db_expr_t count;
char * modif;
{
@ -276,7 +275,7 @@ db_delete_cmd(addr, have_addr, count, modif)
void
db_breakpoint_cmd(addr, have_addr, count, modif)
db_expr_t addr;
int have_addr;
boolean_t have_addr;
db_expr_t count;
char * modif;
{
@ -288,7 +287,11 @@ db_breakpoint_cmd(addr, have_addr, count, modif)
/* list breakpoints */
void
db_listbreak_cmd(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummy4)
db_listbreak_cmd(dummy1, dummy2, dummy3, dummy4)
db_expr_t dummy1;
boolean_t dummy2;
db_expr_t dummy3;
char * dummy4;
{
db_list_breakpoints();
}

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_command.c,v 1.13 1995/05/30 07:56:52 rgrimes Exp $
* $Id: db_command.c,v 1.14 1995/08/27 02:39:39 bde Exp $
*/
/*
@ -39,6 +39,7 @@
#include <sys/proc.h>
#include <ddb/ddb.h>
#include <ddb/db_command.h>
#include <ddb/db_lex.h>
#include <ddb/db_output.h>
@ -61,10 +62,6 @@ db_addr_t db_next;
*/
boolean_t db_ed_style = TRUE;
void db_help_cmd __P((void));
void db_fncall __P((db_expr_t, boolean_t, db_expr_t, char *));
/*
* Utility routine - discard tokens through end-of-line.
*/
@ -82,7 +79,7 @@ db_skip_to_eol()
*/
struct command {
char * name; /* command name */
void (*fcn)(); /* function to call */
db_cmdfcn_t *fcn; /* function to call */
int flag; /* extra info: */
#define CS_OWN 0x1 /* non-standard syntax */
#define CS_MORE 0x2 /* standard syntax, but may have other
@ -100,6 +97,12 @@ struct command {
#define CMD_AMBIGUOUS 3
#define CMD_HELP 4
extern void db_cmd_list __P((struct command *table));
extern int db_cmd_search __P((char *name, struct command *table,
struct command **cmdp));
extern void db_command __P((struct command **last_cmdp,
struct command *cmd_table));
/*
* Search for command prefix.
*/
@ -306,15 +309,6 @@ db_command(last_cmdp, cmd_table)
* 'show' commands
*/
extern void db_show_one_thread(), db_show_all_threads();
extern void vm_page_print();
extern void db_ps();
extern void ipc_port_print();
#if 0
void db_show_help();
#endif
void db_panic();
struct command db_show_all_cmds[] = {
#if 0
{ "threads", db_show_all_threads, 0, 0 },
@ -443,11 +437,15 @@ db_fncall(dummy1, dummy2, dummy3, dummy4)
char * dummy4;
{
db_expr_t fn_addr;
#define MAXARGS 11
#define MAXARGS 11 /* XXX only 10 are passed */
db_expr_t args[MAXARGS];
int nargs = 0;
db_expr_t retval;
db_expr_t (*func)();
typedef db_expr_t fcn_10args_t __P((db_expr_t, db_expr_t, db_expr_t,
db_expr_t, db_expr_t, db_expr_t,
db_expr_t, db_expr_t, db_expr_t,
db_expr_t));
fcn_10args_t *func;
int t;
if (!db_expression(&fn_addr)) {
@ -455,7 +453,7 @@ db_fncall(dummy1, dummy2, dummy3, dummy4)
db_flush_lex();
return;
}
func = (db_expr_t (*) ()) fn_addr;
func = (fcn_10args_t *)fn_addr; /* XXX */
t = db_read_token();
if (t == tLPAREN) {

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_examine.c,v 1.7 1995/05/22 13:07:11 davidg Exp $
* $Id: db_examine.c,v 1.8 1995/05/30 07:56:55 rgrimes Exp $
*/
/*
@ -54,7 +54,7 @@ static void db_search(db_addr_t, int, db_expr_t, db_expr_t, u_int);
void
db_examine_cmd(addr, have_addr, count, modif)
db_expr_t addr;
int have_addr;
boolean_t have_addr;
db_expr_t count;
char * modif;
{
@ -192,7 +192,7 @@ char db_print_format = 'x';
void
db_print_cmd(addr, have_addr, count, modif)
db_expr_t addr;
int have_addr;
boolean_t have_addr;
db_expr_t count;
char * modif;
{
@ -248,7 +248,11 @@ db_print_loc_and_inst(loc)
* Syntax: search [/bhl] addr value [mask] [,count]
*/
void
db_search_cmd(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummy4)
db_search_cmd(dummy1, dummy2, dummy3, dummy4)
db_expr_t dummy1;
boolean_t dummy2;
db_expr_t dummy3;
char * dummy4;
{
int t;
db_addr_t addr;

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_expr.c,v 1.4 1994/08/13 03:49:18 wollman Exp $
* $Id: db_expr.c,v 1.5 1995/05/30 07:56:56 rgrimes Exp $
*/
/*
@ -38,6 +38,12 @@
#include <ddb/db_access.h>
#include <ddb/db_command.h>
extern boolean_t db_add_expr __P((db_expr_t *valuep));
extern boolean_t db_mult_expr __P((db_expr_t *valuep));
extern boolean_t db_shift_expr __P((db_expr_t *valuep));
extern boolean_t db_term __P((db_expr_t *valuep));
extern boolean_t db_unary __P((db_expr_t *valuep));
boolean_t
db_term(valuep)
db_expr_t *valuep;

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_input.c,v 1.6 1994/08/18 22:34:23 wollman Exp $
* $Id: db_input.c,v 1.7 1995/05/30 07:56:58 rgrimes Exp $
*/
/*
@ -57,6 +57,12 @@ char * db_le; /* one past last character */
#define BLANK ' '
#define BACKUP '\b'
extern int cnmaygetc __P((void));
extern void db_delete __P((int n, int bwd));
extern int db_inputchar __P((int c));
extern void db_putnchars __P((int c, int count));
extern void db_putstring __P((char *s, int count));
void
db_putstring(s, count)
char *s;
@ -194,7 +200,7 @@ db_inputchar(c)
}
int
cnmaygetc (void)
cnmaygetc()
{
return (-1);
}

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_lex.c,v 1.5 1994/08/18 22:34:23 wollman Exp $
* $Id: db_lex.c,v 1.6 1995/05/30 07:57:00 rgrimes Exp $
*/
/*
@ -41,7 +41,7 @@
char db_line[120];
char * db_lp, *db_endlp;
static int db_lex(void);
static int db_lex __P((void));
int
db_read_line()

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_output.c,v 1.10 1994/10/30 20:55:44 bde Exp $
* $Id: db_output.c,v 1.11 1995/05/30 07:57:02 rgrimes Exp $
*/
/*
@ -39,6 +39,7 @@
#include <sys/systm.h>
#include <machine/stdarg.h>
#include <ddb/ddb.h>
#include <ddb/db_output.h>
#include <machine/cons.h>
/*
@ -60,8 +61,8 @@ int db_tab_stop_width = 8; /* how wide are tab stops? */
((((i) + db_tab_stop_width) / db_tab_stop_width) * db_tab_stop_width)
int db_max_width = 80; /* output line width */
static void db_printf_guts(const char *, va_list);
static char *db_ksprintn __P((u_long ul, int base, int *lenp));
static void db_printf_guts __P((const char *, va_list));
/*
* Force pending whitespace.
@ -160,7 +161,7 @@ db_printf(const char *fmt, ...)
/*VARARGS1*/
void
kdbprintf(char *fmt, ...)
kdbprintf(const char *fmt, ...)
{
va_list listp;
va_start(listp, fmt);
@ -377,4 +378,3 @@ number: p = (char *)db_ksprintn(ul, base, &tmp);
}
}
}

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_print.c,v 1.6 1994/09/27 03:34:56 phk Exp $
* $Id: db_print.c,v 1.7 1995/05/30 07:57:06 rgrimes Exp $
*/
/*
@ -45,7 +45,11 @@
#include <ddb/db_sym.h>
void
db_show_regs(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummy4)
db_show_regs(dummy1, dummy2, dummy3, dummy4)
db_expr_t dummy1;
boolean_t dummy2;
db_expr_t dummy3;
char * dummy4;
{
register struct db_variable *regp;
db_expr_t value, offset;

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_run.c,v 1.4 1994/08/13 03:49:22 wollman Exp $
* $Id: db_run.c,v 1.5 1995/05/30 07:57:08 rgrimes Exp $
*/
/*
@ -61,10 +61,10 @@ int db_load_count;
int db_store_count;
#ifndef db_set_single_step
void db_set_single_step(/* db_regs_t *regs */); /* forward */
extern void db_set_single_step __P((db_regs_t *regs);
#endif
#ifndef db_clear_single_step
void db_clear_single_step(/* db_regs_t *regs */);
extern void db_clear_single_step __P((db_regs_t *regs));
#endif
boolean_t
@ -302,7 +302,7 @@ extern int db_cmd_loop_done;
void
db_single_step_cmd(addr, have_addr, count, modif)
db_expr_t addr;
int have_addr;
boolean_t have_addr;
db_expr_t count;
char * modif;
{
@ -329,7 +329,7 @@ db_single_step_cmd(addr, have_addr, count, modif)
void
db_trace_until_call_cmd(addr, have_addr, count, modif)
db_expr_t addr;
int have_addr;
boolean_t have_addr;
db_expr_t count;
char * modif;
{
@ -351,7 +351,7 @@ db_trace_until_call_cmd(addr, have_addr, count, modif)
void
db_trace_until_matching_cmd(addr, have_addr, count, modif)
db_expr_t addr;
int have_addr;
boolean_t have_addr;
db_expr_t count;
char * modif;
{
@ -375,7 +375,7 @@ db_trace_until_matching_cmd(addr, have_addr, count, modif)
void
db_continue_cmd(addr, have_addr, count, modif)
db_expr_t addr;
int have_addr;
boolean_t have_addr;
db_expr_t count;
char * modif;
{

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_sym.c,v 1.8 1995/05/22 13:07:12 davidg Exp $
* $Id: db_sym.c,v 1.9 1995/05/30 07:57:10 rgrimes Exp $
*/
/*
@ -36,14 +36,6 @@
#include <ddb/ddb.h>
#include <ddb/db_sym.h>
/*
* We import from the symbol-table dependent routines:
*/
extern db_sym_t X_db_lookup();
extern db_sym_t X_db_search_symbol();
extern boolean_t X_db_line_at_pc();
extern void X_db_symbol_values();
/*
* Multiple symbol tables
*/
@ -56,7 +48,9 @@ int db_nsymtab = 0;
db_symtab_t *db_last_symtab;
db_sym_t db_lookup(); /* forward */
extern db_sym_t db_lookup __P(( char *symstr));
static char *db_qualify __P((db_sym_t sym, char *symtabname));
extern boolean_t db_symbol_is_ambiguous __P((db_sym_t sym));
/*
* Add symbol table, with given name, to list of symbol tables.

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_variables.c,v 1.6 1994/09/27 03:34:58 phk Exp $
* $Id: db_variables.c,v 1.7 1995/05/30 07:57:17 rgrimes Exp $
*/
/*
@ -39,7 +39,9 @@
#include <ddb/db_lex.h>
#include <ddb/db_variables.h>
static void db_write_variable(struct db_variable *, db_expr_t *);
extern int db_find_variable __P((struct db_variable **varp));
extern int db_set_variable __P((db_expr_t value));
static void db_write_variable __P((struct db_variable *, db_expr_t *));
struct db_variable db_vars[] = {
{ "radix", &db_radix, FCN_NULL },
@ -109,7 +111,7 @@ db_read_variable(vp, valuep)
struct db_variable *vp;
db_expr_t *valuep;
{
int (*func)() = vp->fcn;
db_varfcn_t *func = vp->fcn;
if (func == FCN_NULL)
*valuep = *(vp->valuep);
@ -122,7 +124,7 @@ db_write_variable(vp, valuep)
struct db_variable *vp;
db_expr_t *valuep;
{
int (*func)() = vp->fcn;
db_varfcn_t *func = vp->fcn;
if (func == FCN_NULL)
*(vp->valuep) = *valuep;
@ -131,7 +133,11 @@ db_write_variable(vp, valuep)
}
void
db_set_cmd(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummy4)
db_set_cmd(dummy1, dummy2, dummy3, dummy4)
db_expr_t dummy1;
boolean_t dummy2;
db_expr_t dummy3;
char * dummy4;
{
db_expr_t value;
struct db_variable *vp;

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_watch.c,v 1.5 1994/08/18 22:34:28 wollman Exp $
* $Id: db_watch.c,v 1.6 1995/05/30 07:57:20 rgrimes Exp $
*/
/*
@ -54,6 +54,9 @@ db_watchpoint_t db_next_free_watchpoint = &db_watch_table[0];
db_watchpoint_t db_free_watchpoints = 0;
db_watchpoint_t db_watchpoint_list = 0;
extern db_watchpoint_t db_watchpoint_alloc __P((void));
extern void db_watchpoint_free __P((db_watchpoint_t watch));
db_watchpoint_t
db_watchpoint_alloc()
{
@ -171,7 +174,7 @@ db_list_watchpoints()
void
db_deletewatch_cmd(addr, have_addr, count, modif)
db_expr_t addr;
int have_addr;
boolean_t have_addr;
db_expr_t count;
char * modif;
{
@ -183,7 +186,7 @@ db_deletewatch_cmd(addr, have_addr, count, modif)
void
db_watchpoint_cmd(addr, have_addr, count, modif)
db_expr_t addr;
int have_addr;
boolean_t have_addr;
db_expr_t count;
char * modif;
{
@ -201,7 +204,11 @@ db_watchpoint_cmd(addr, have_addr, count, modif)
/* list watchpoints */
void
db_listwatch_cmd(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummmy4)
db_listwatch_cmd(dummy1, dummy2, dummy3, dummy4)
db_expr_t dummy1;
boolean_t dummy2;
db_expr_t dummy3;
char * dummy4;
{
db_list_watchpoints();
}