summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-02-13 02:19:29 +0000
committerbde <bde@FreeBSD.org>1998-02-13 02:19:29 +0000
commite159c8ff9735b3dbd503e2695d5b6f040140ce03 (patch)
treee6d877a03bcdb603b973e9b9ce816f4db67c40b7
parent9461b07207276f197a45e7ed0bc94bda8106f779 (diff)
downloadFreeBSD-src-e159c8ff9735b3dbd503e2695d5b6f040140ce03.zip
FreeBSD-src-e159c8ff9735b3dbd503e2695d5b6f040140ce03.tar.gz
Ensure that the linker sets for commands exist by putting a standard
command in each of them. This removes the need for hard-to-configure dummy instantiations of the sets.
-rw-r--r--sys/ddb/db_command.c22
-rw-r--r--sys/ddb/db_watch.c15
-rw-r--r--sys/ddb/ddb.h3
3 files changed, 15 insertions, 25 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
index 0f62f88..63a89bb 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: db_command.c,v 1.23 1997/02/22 09:28:21 peter Exp $
+ * $Id: db_command.c,v 1.24 1998/02/09 06:07:52 eivind Exp $
*/
/*
@@ -49,12 +49,8 @@
/*
* Exported global variables
*/
-/*
- * XXX when db_command is actually used, it will be generated by the linker.
- * Then it should be declared extern.
- */
-static struct linker_set db_cmd_set;
boolean_t db_cmd_loop_done;
+extern struct linker_set db_cmd_set;
db_addr_t db_dot;
jmp_buf db_jmpbuf;
db_addr_t db_last_addr;
@@ -64,7 +60,6 @@ extern struct linker_set db_show_cmd_set;
static db_cmdfcn_t db_fncall;
static db_cmdfcn_t db_gdb;
-static db_cmdfcn_t db_panic;
/* XXX this is actually forward-static. */
extern struct command db_show_cmds[];
@@ -374,7 +369,6 @@ static struct command db_show_cmds[] = {
{ "all", 0, 0, db_show_all_cmds },
{ "registers", db_show_regs, 0, 0 },
{ "breaks", db_listbreak_cmd, 0, 0 },
- { "watches", db_listwatch_cmd, 0, 0 },
#if 0
{ "thread", db_show_one_thread, 0, 0 },
#endif
@@ -409,7 +403,6 @@ static struct command db_command_table[] = {
{ "call", db_fncall, CS_OWN, 0 },
{ "show", 0, 0, db_show_cmds },
{ "ps", db_ps, 0, 0 },
- { "panic", db_panic, 0, 0 },
{ "gdb", db_gdb, 0, 0 },
{ (char *)0, }
};
@@ -430,12 +423,11 @@ db_help_cmd()
}
#endif
-static void
-db_panic(dummy1, dummy2, dummy3, dummy4)
- db_expr_t dummy1;
- boolean_t dummy2;
- db_expr_t dummy3;
- char * dummy4;
+/*
+ * At least one non-optional command must be implemented using
+ * DB_COMMAND() so that db_cmd_set gets created. Here is one.
+ */
+DB_COMMAND(panic, db_panic)
{
panic("from debugger");
}
diff --git a/sys/ddb/db_watch.c b/sys/ddb/db_watch.c
index c0f951e..1fa3c34 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: db_watch.c,v 1.14 1997/02/22 09:28:33 peter Exp $
+ * $Id: db_watch.c,v 1.15 1997/06/14 11:52:37 bde Exp $
*/
/*
@@ -32,6 +32,7 @@
*/
#include <sys/param.h>
+#include <sys/kernel.h>
#include <vm/vm.h>
#include <sys/lock.h>
@@ -212,13 +213,11 @@ db_watchpoint_cmd(addr, have_addr, count, modif)
db_set_watchpoint(db_map_addr(addr), addr, size);
}
-/* list watchpoints */
-void
-db_listwatch_cmd(dummy1, dummy2, dummy3, dummy4)
- db_expr_t dummy1;
- boolean_t dummy2;
- db_expr_t dummy3;
- char * dummy4;
+/*
+ * At least one non-optional show-command must be implemented using
+ * DB_SHOW_COMMAND() so that db_show_cmd_set gets created. Here is one.
+ */
+DB_SHOW_COMMAND(watches, db_listwatch_cmd)
{
db_list_watchpoints();
}
diff --git a/sys/ddb/ddb.h b/sys/ddb/ddb.h
index 6376a20..a563894 100644
--- a/sys/ddb/ddb.h
+++ b/sys/ddb/ddb.h
@@ -27,7 +27,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: ddb.h,v 1.14 1997/02/22 09:28:35 peter Exp $
*/
/*
@@ -112,7 +112,6 @@ db_cmdfcn_t db_delete_cmd;
db_cmdfcn_t db_deletewatch_cmd;
db_cmdfcn_t db_examine_cmd;
db_cmdfcn_t db_listbreak_cmd;
-db_cmdfcn_t db_listwatch_cmd;
db_cmdfcn_t db_print_cmd;
db_cmdfcn_t db_ps;
db_cmdfcn_t db_search_cmd;
OpenPOWER on IntegriCloud