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.
This commit is contained in:
parent
2f253e75c8
commit
b7aa38c1e3
@ -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");
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user