aboutsummaryrefslogtreecommitdiff
path: root/sys/ddb
diff options
context:
space:
mode:
authorGarrett Wollman <wollman@FreeBSD.org>1993-11-25 01:38:01 +0000
committerGarrett Wollman <wollman@FreeBSD.org>1993-11-25 01:38:01 +0000
commit381fe1aaf4d3cb1ad62f758c15ace6cb07eea97a (patch)
tree5f254571daeb319e5d462e9932f7aff4e6b7ee40 /sys/ddb
parent0f81714b346ecbc9651220ce3465d5dc75b38875 (diff)
downloadsrc-381fe1aaf4d3cb1ad62f758c15ace6cb07eea97a.tar.gz
src-381fe1aaf4d3cb1ad62f758c15ace6cb07eea97a.zip
Notes
Diffstat (limited to 'sys/ddb')
-rw-r--r--sys/ddb/db_access.c10
-rw-r--r--sys/ddb/db_aout.c9
-rw-r--r--sys/ddb/db_break.c7
-rw-r--r--sys/ddb/db_command.c7
-rw-r--r--sys/ddb/db_examine.c24
-rw-r--r--sys/ddb/db_expr.c5
-rw-r--r--sys/ddb/db_input.c9
-rw-r--r--sys/ddb/db_lex.c8
-rw-r--r--sys/ddb/db_output.c15
-rw-r--r--sys/ddb/db_output.h3
-rw-r--r--sys/ddb/db_print.c7
-rw-r--r--sys/ddb/db_run.c5
-rw-r--r--sys/ddb/db_sym.c9
-rw-r--r--sys/ddb/db_trap.c5
-rw-r--r--sys/ddb/db_variables.c16
-rw-r--r--sys/ddb/db_variables.h4
-rw-r--r--sys/ddb/db_watch.c8
-rw-r--r--sys/ddb/db_write_cmd.c5
-rw-r--r--sys/ddb/ddb.h109
19 files changed, 202 insertions, 63 deletions
diff --git a/sys/ddb/db_access.c b/sys/ddb/db_access.c
index cbb25dd371e3..b519e2853de7 100644
--- a/sys/ddb/db_access.c
+++ b/sys/ddb/db_access.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_access.c,v 1.2 1993/10/16 16:47:04 rgrimes Exp $
*/
/*
@@ -42,11 +42,11 @@
extern void db_read_bytes(); /* machine-dependent */
extern void db_write_bytes(); /* machine-dependent */
-int db_extend[] = { /* table for sign-extending */
+unsigned db_extend[] = { /* table for sign-extending */
0,
- 0xFFFFFF80,
- 0xFFFF8000,
- 0xFF800000
+ 0xFFFFFF80U,
+ 0xFFFF8000U,
+ 0xFF800000U
};
db_expr_t
diff --git a/sys/ddb/db_aout.c b/sys/ddb/db_aout.c
index d1c848f07da4..06d1b06e1bcc 100644
--- a/sys/ddb/db_aout.c
+++ b/sys/ddb/db_aout.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_aout.c,v 1.3 1993/10/16 16:47:06 rgrimes Exp $
*/
/*
@@ -35,8 +35,9 @@
*/
#include "param.h"
+#include "systm.h"
#include "proc.h"
-#include <machine/db_machdep.h> /* data types */
+#include "ddb/ddb.h"
#include <ddb/db_sym.h>
#ifndef DB_NO_AOUT
@@ -72,6 +73,7 @@
int db_symtabsize = SYMTAB_SPACE;
char db_symtab[SYMTAB_SPACE] = { 1 };
+void
X_db_sym_init(symtab, esymtab, name)
int * symtab; /* pointer to start of symbol table */
char * esymtab; /* pointer to end of string table,
@@ -217,7 +219,8 @@ X_db_line_at_pc()
/*
* Initialization routine for a.out files.
*/
-kdb_init()
+void
+kdb_init(void)
{
#if 0
extern char *esym;
diff --git a/sys/ddb/db_break.c b/sys/ddb/db_break.c
index b4d0bbcb3ec9..41761e818b1b 100644
--- a/sys/ddb/db_break.c
+++ b/sys/ddb/db_break.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_break.c,v 1.2 1993/10/16 16:47:07 rgrimes Exp $
*/
/*
@@ -34,8 +34,9 @@
* Breakpoints.
*/
#include "param.h"
+#include "systm.h"
#include "proc.h"
-#include <machine/db_machdep.h> /* type definitions */
+#include "ddb/ddb.h"
#include <ddb/db_lex.h>
#include <ddb/db_break.h>
@@ -291,7 +292,7 @@ db_breakpoint_cmd(addr, have_addr, count, modif)
/* list breakpoints */
void
-db_listbreak_cmd()
+db_listbreak_cmd(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummy4)
{
db_list_breakpoints();
}
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
index 8c2555dccea8..30d8b1745e29 100644
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_command.c,v 1.2 1993/10/16 16:47:10 rgrimes Exp $
*/
/*
@@ -35,8 +35,9 @@
* Command dispatcher.
*/
#include "param.h"
+#include "systm.h"
#include "proc.h"
-#include <machine/db_machdep.h> /* type definitions */
+#include "ddb/ddb.h"
#include <ddb/db_lex.h>
#include <ddb/db_output.h>
@@ -168,7 +169,7 @@ db_command(last_cmdp, cmd_table)
int t;
char modif[TOK_STRING_SIZE];
db_expr_t addr, count;
- boolean_t have_addr;
+ boolean_t have_addr = FALSE;
int result;
t = db_read_token();
diff --git a/sys/ddb/db_examine.c b/sys/ddb/db_examine.c
index 7a83692df1fc..bf9a4c76e7d1 100644
--- a/sys/ddb/db_examine.c
+++ b/sys/ddb/db_examine.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_examine.c,v 1.2 1993/10/16 16:47:13 rgrimes Exp $
*/
/*
@@ -31,8 +31,10 @@
* Date: 7/90
*/
#include "param.h"
+#include "systm.h"
#include "proc.h"
-#include <machine/db_machdep.h> /* type definitions */
+
+#include "ddb/ddb.h"
#include <ddb/db_lex.h>
#include <ddb/db_output.h>
@@ -44,6 +46,9 @@ char db_examine_format[TOK_STRING_SIZE] = "x";
extern db_addr_t db_disasm(/* db_addr_t, boolean_t */);
/* instruction disassembler */
+static void db_examine(db_addr_t, char *, int);
+static void db_search(db_addr_t, int, db_expr_t, db_expr_t, u_int);
+
/*
* Examine (print) data.
*/
@@ -64,6 +69,7 @@ db_examine_cmd(addr, have_addr, count, modif)
db_examine((db_addr_t) addr, db_examine_format, count);
}
+static void
db_examine(addr, fmt, count)
register
db_addr_t addr;
@@ -237,6 +243,7 @@ db_print_cmd(addr, have_addr, count, modif)
db_printf("\n");
}
+void
db_print_loc_and_inst(loc)
db_addr_t loc;
{
@@ -245,20 +252,12 @@ db_print_loc_and_inst(loc)
(void) db_disasm(loc, TRUE);
}
-db_strcpy(dst, src)
- register char *dst;
- register char *src;
-{
- while (*dst++ = *src++)
- ;
-}
-
/*
* Search for a value in memory.
* Syntax: search [/bhl] addr value [mask] [,count]
*/
void
-db_search_cmd()
+db_search_cmd(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummy4)
{
int t;
db_addr_t addr;
@@ -290,7 +289,7 @@ db_search_cmd()
size = 4;
}
- if (!db_expression(&addr)) {
+ if (!db_expression((db_expr_t *)&addr)) {
db_printf("Address missing\n");
db_flush_lex();
return;
@@ -321,6 +320,7 @@ db_search_cmd()
db_search(addr, size, value, mask, count);
}
+static void
db_search(addr, size, value, mask, count)
register
db_addr_t addr;
diff --git a/sys/ddb/db_expr.c b/sys/ddb/db_expr.c
index b02f22582527..3d239496479d 100644
--- a/sys/ddb/db_expr.c
+++ b/sys/ddb/db_expr.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_expr.c,v 1.2 1993/10/16 16:47:14 rgrimes Exp $
*/
/*
@@ -31,8 +31,9 @@
* Date: 7/90
*/
#include "param.h"
+#include "systm.h"
#include "proc.h"
-#include <machine/db_machdep.h>
+#include "ddb/ddb.h"
#include <ddb/db_lex.h>
#include <ddb/db_access.h>
#include <ddb/db_command.h>
diff --git a/sys/ddb/db_input.c b/sys/ddb/db_input.c
index 3cf0b0562b41..3f18cd8beaec 100644
--- a/sys/ddb/db_input.c
+++ b/sys/ddb/db_input.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_input.c,v 1.2 1993/10/16 16:47:16 rgrimes Exp $
*/
/*
@@ -32,7 +32,9 @@
*/
#include "param.h"
+#include "systm.h"
#include "proc.h"
+#include "ddb/ddb.h"
#include <ddb/db_output.h>
/*
@@ -239,12 +241,15 @@ db_check_interrupt()
}
}
-cnmaygetc ()
+int
+cnmaygetc (void)
{
return (-1);
}
/* called from kdb_trap in db_interface.c */
+void
cnpollc (flag)
+ int flag;
{
}
diff --git a/sys/ddb/db_lex.c b/sys/ddb/db_lex.c
index 84176383d104..655a1b53dbb0 100644
--- a/sys/ddb/db_lex.c
+++ b/sys/ddb/db_lex.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_lex.c,v 1.2 1993/10/16 16:47:17 rgrimes Exp $
*/
/*
@@ -33,6 +33,9 @@
/*
* Lexical analyzer.
*/
+#include "param.h"
+#include "systm.h"
+#include "ddb/ddb.h"
#include <ddb/db_lex.h>
char db_line[120];
@@ -78,6 +81,7 @@ db_read_char()
void
db_unread_char(c)
+ int c;
{
db_look_char = c;
}
@@ -132,7 +136,7 @@ db_lex()
if (c >= '0' && c <= '9') {
/* number */
- int r, digit;
+ int r, digit = 0;
if (c > '0')
r = db_radix;
diff --git a/sys/ddb/db_output.c b/sys/ddb/db_output.c
index 442546b9b29e..440f48674662 100644
--- a/sys/ddb/db_output.c
+++ b/sys/ddb/db_output.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_output.c,v 1.4 1993/10/16 16:47:20 rgrimes Exp $
*/
/*
@@ -38,6 +38,7 @@
#include "param.h"
#include "systm.h"
#include <machine/stdarg.h>
+#include "ddb/ddb.h"
/*
* Character output - tracks position in line.
@@ -58,7 +59,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 */
-extern void db_check_interrupt();
+
+static void db_printf_guts(const char *, va_list);
/*
* Force pending whitespace.
@@ -88,6 +90,7 @@ db_force_whitespace()
/*
* Output character. Buffer whitespace.
*/
+void
db_putchar(c)
int c; /* character to output */
{
@@ -136,10 +139,8 @@ db_print_position()
/*
* Printing
*/
-extern int db_radix;
-
-/*VARARGS1*/
-db_printf(char *fmt, ...)
+void
+db_printf(const char *fmt, ...)
{
va_list listp;
va_start(listp, fmt);
@@ -150,6 +151,7 @@ db_printf(char *fmt, ...)
/* alternate name */
/*VARARGS1*/
+void
kdbprintf(char *fmt, ...)
{
va_list listp;
@@ -190,6 +192,7 @@ db_ksprintn(ul, base, lenp)
return (p);
}
+static void
db_printf_guts(fmt, ap)
register const char *fmt;
va_list ap;
diff --git a/sys/ddb/db_output.h b/sys/ddb/db_output.h
index fb4ae67ffc2c..3969a3450ec4 100644
--- a/sys/ddb/db_output.h
+++ b/sys/ddb/db_output.h
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: db_output.h,v 1.2 1993/10/16 16:47:21 rgrimes Exp $
+ * $Id: db_output.h,v 1.3 1993/11/07 17:39:24 wollman Exp $
*/
#ifndef _DDB_DB_OUTPUT_H_
@@ -41,5 +41,4 @@
extern void db_force_whitespace();
extern int db_print_position();
extern void db_end_line();
-extern int db_printf();
#endif /* _DDB_DB_OUTPUT_H_ */
diff --git a/sys/ddb/db_print.c b/sys/ddb/db_print.c
index 25e4c66600fb..7ab209977202 100644
--- a/sys/ddb/db_print.c
+++ b/sys/ddb/db_print.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_print.c,v 1.2 1993/10/16 16:47:22 rgrimes Exp $
*/
/*
@@ -35,9 +35,10 @@
* Miscellaneous printing.
*/
#include "param.h"
+#include "systm.h"
#include "proc.h"
-#include <machine/db_machdep.h>
+#include "ddb/ddb.h"
#include <ddb/db_lex.h>
#include <ddb/db_variables.h>
@@ -46,7 +47,7 @@
extern unsigned int db_maxoff;
void
-db_show_regs()
+db_show_regs(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummy4)
{
int (*func)();
register struct db_variable *regp;
diff --git a/sys/ddb/db_run.c b/sys/ddb/db_run.c
index 78c0d4c1d4b7..1ba43c10a00e 100644
--- a/sys/ddb/db_run.c
+++ b/sys/ddb/db_run.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_run.c,v 1.2 1993/10/16 16:47:24 rgrimes Exp $
*/
/*
@@ -35,8 +35,9 @@
* Commands to run process.
*/
#include "param.h"
+#include "systm.h"
#include "proc.h"
-#include <machine/db_machdep.h>
+#include "ddb/ddb.h"
#include <ddb/db_lex.h>
#include <ddb/db_break.h>
diff --git a/sys/ddb/db_sym.c b/sys/ddb/db_sym.c
index fd02ae455c13..74c96e3ac7bb 100644
--- a/sys/ddb/db_sym.c
+++ b/sys/ddb/db_sym.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_sym.c,v 1.2 1993/10/16 16:47:25 rgrimes Exp $
*/
/*
@@ -31,8 +31,9 @@
* Date: 7/90
*/
#include "param.h"
+#include "systm.h"
#include "proc.h"
-#include <machine/db_machdep.h>
+#include "ddb/ddb.h"
#include <ddb/db_sym.h>
/*
@@ -313,6 +314,10 @@ db_printsym(off, strategy)
boolean_t
db_line_at_pc( sym, filename, linenum, pc)
+ int sym;
+ int filename;
+ int linenum;
+ int pc;
{
return X_db_line_at_pc( db_last_symtab, sym, filename, linenum, pc);
}
diff --git a/sys/ddb/db_trap.c b/sys/ddb/db_trap.c
index bcdc4f47f48a..abfa770d358c 100644
--- a/sys/ddb/db_trap.c
+++ b/sys/ddb/db_trap.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_trap.c,v 1.2 1993/10/16 16:47:28 rgrimes Exp $
*/
/*
@@ -35,7 +35,9 @@
* Trap entry point to kernel debugger.
*/
#include "param.h"
+#include "systm.h"
#include "proc.h"
+#include "ddb/ddb.h"
#include <ddb/db_command.h>
#include <ddb/db_break.h>
@@ -46,6 +48,7 @@ extern int db_inst_count;
extern int db_load_count;
extern int db_store_count;
+void
db_trap(type, code)
int type, code;
{
diff --git a/sys/ddb/db_variables.c b/sys/ddb/db_variables.c
index cd59bb2d5764..96ef62057a58 100644
--- a/sys/ddb/db_variables.c
+++ b/sys/ddb/db_variables.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_variables.c,v 1.2 1993/10/16 16:47:29 rgrimes Exp $
*/
/*
@@ -32,17 +32,15 @@
*/
#include "param.h"
+#include "systm.h"
#include "proc.h"
-#include <machine/db_machdep.h>
+#include "ddb/ddb.h"
#include <ddb/db_lex.h>
#include <ddb/db_variables.h>
-extern unsigned int db_maxoff;
-
-extern int db_radix;
-extern int db_max_width;
-extern int db_tab_stop_width;
+void db_read_variable(struct db_variable *, db_expr_t *);
+static void db_write_variable(struct db_variable *, db_expr_t *);
struct db_variable db_vars[] = {
{ "radix", &db_radix, FCN_NULL },
@@ -107,6 +105,7 @@ db_set_variable(value)
}
+void
db_read_variable(vp, valuep)
struct db_variable *vp;
db_expr_t *valuep;
@@ -119,6 +118,7 @@ db_read_variable(vp, valuep)
(*func)(vp, valuep, DB_VAR_GET);
}
+static void
db_write_variable(vp, valuep)
struct db_variable *vp;
db_expr_t *valuep;
@@ -132,7 +132,7 @@ db_write_variable(vp, valuep)
}
void
-db_set_cmd()
+db_set_cmd(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummy4)
{
db_expr_t value;
int (*func)();
diff --git a/sys/ddb/db_variables.h b/sys/ddb/db_variables.h
index 25558bc28b63..35e5a0001817 100644
--- a/sys/ddb/db_variables.h
+++ b/sys/ddb/db_variables.h
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_variables.h,v 1.2 1993/10/16 16:47:31 rgrimes Exp $
*/
/*
@@ -52,4 +52,6 @@ extern struct db_variable *db_evars;
extern struct db_variable db_regs[]; /* machine registers */
extern struct db_variable *db_eregs;
+extern void db_read_variable(struct db_variable *, db_expr_t *);
+
#endif /* _DB_VARIABLES_H_ */
diff --git a/sys/ddb/db_watch.c b/sys/ddb/db_watch.c
index b027732b9d49..0322a1805c03 100644
--- a/sys/ddb/db_watch.c
+++ b/sys/ddb/db_watch.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_watch.c,v 1.2 1993/10/16 16:47:32 rgrimes Exp $
*/
/*
@@ -32,15 +32,15 @@
*/
#include "param.h"
+#include "systm.h"
#include "proc.h"
-#include <machine/db_machdep.h>
+#include "ddb/ddb.h"
#include <vm/vm_map.h>
#include <ddb/db_lex.h>
#include <ddb/db_watch.h>
#include <ddb/db_access.h>
#include <ddb/db_sym.h>
-#include <machine/db_machdep.h>
/*
* Watchpoints.
@@ -205,7 +205,7 @@ db_watchpoint_cmd(addr, have_addr, count, modif)
/* list watchpoints */
void
-db_listwatch_cmd()
+db_listwatch_cmd(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummmy4)
{
db_list_watchpoints();
}
diff --git a/sys/ddb/db_write_cmd.c b/sys/ddb/db_write_cmd.c
index 0113958c9b5c..6de58a68e492 100644
--- a/sys/ddb/db_write_cmd.c
+++ b/sys/ddb/db_write_cmd.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id$
+ * $Id: db_write_cmd.c,v 1.2 1993/10/16 16:47:35 rgrimes Exp $
*/
/*
@@ -32,8 +32,9 @@
*/
#include "param.h"
+#include "systm.h"
#include "proc.h"
-#include <machine/db_machdep.h>
+#include "ddb/ddb.h"
#include <ddb/db_lex.h>
#include <ddb/db_access.h>
diff --git a/sys/ddb/ddb.h b/sys/ddb/ddb.h
new file mode 100644
index 000000000000..4d7b206bbd7a
--- /dev/null
+++ b/sys/ddb/ddb.h
@@ -0,0 +1,109 @@
+/*-
+ * Copyright (c) 1993, Garrett A. Wollman.
+ * Copyright (c) 1993, University of Vermont and State Agricultural College.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id$
+ */
+
+/*
+ * Necessary declarations for the `ddb' kernel debugger.
+ */
+
+#ifndef __h_ddb_ddb
+#define __h_ddb_ddb 1
+
+#include "machine/db_machdep.h" /* type definitions */
+
+/*
+ * Global variables...
+ */
+extern char *esym;
+extern unsigned int db_maxoff;
+extern int db_inst_count;
+extern int db_load_count;
+extern int db_store_count;
+extern int db_radix;
+extern int db_max_width;
+extern int db_tab_stop_width;
+
+/*
+ * Functions...
+ */
+extern void
+db_read_bytes(vm_offset_t addr, register int size, register char *data);
+ /* machine-dependent */
+
+extern void
+db_write_bytes(vm_offset_t addr, register int size, register char *data);
+ /* machine-dependent */
+
+struct vm_map; /* forward declaration */
+
+extern boolean_t db_map_equal(struct vm_map *, struct vm_map *);
+extern boolean_t db_map_current(struct vm_map *);
+extern struct vm_map *db_map_addr(vm_offset_t);
+
+#define db_strcpy strcpy
+extern int db_expression (db_expr_t *valuep);
+
+typedef void db_cmd_fcn(db_expr_t, int, db_expr_t, char *);
+
+extern db_cmd_fcn db_listbreak_cmd, db_listwatch_cmd, db_show_regs;
+extern db_cmd_fcn db_print_cmd, db_examine_cmd, db_set_cmd, db_search_cmd;
+extern db_cmd_fcn db_write_cmd, db_delete_cmd, db_breakpoint_cmd;
+extern db_cmd_fcn db_deletewatch_cmd, db_watchpoint_cmd;
+extern db_cmd_fcn db_single_step_cmd, db_trace_until_call_cmd;
+extern db_cmd_fcn db_trace_until_matching_cmd, db_continue_cmd;
+extern db_cmd_fcn db_stack_trace_cmd;
+
+extern db_addr_t db_disasm(db_addr_t loc, boolean_t altfmt);
+ /* instruction disassembler */
+
+extern int db_value_of_name (char *name, db_expr_t *valuep);
+extern int db_get_variable (db_expr_t *valuep);
+extern void db_putchar (int c);
+extern void db_error (char *s);
+extern int db_readline (char *lstart, int lsize);
+extern void db_printf (const char *fmt, ...);
+extern void db_check_interrupt(void);
+extern void db_print_loc_and_inst (db_addr_t loc);
+
+extern void db_clear_watchpoints (void);
+extern void db_set_watchpoints (void);
+
+extern void db_restart_at_pc(boolean_t watchpt);
+extern boolean_t db_stop_at_pc(boolean_t *is_breakpoint);
+
+extern void db_skip_to_eol (void);
+extern void db_single_step (db_regs_t *regs);
+
+extern void db_trap (int type, int code);
+
+extern void kdbprinttrap(int, int);
+
+#endif /* __h_ddb_ddb */