diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 0f62f88de17f..63a89bb7879e 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -1,558 +1,550 @@ /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * 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 $ */ /* * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 */ /* * Command dispatcher. */ #include #include #include #include #include #include #include #include #include /* * 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; db_addr_t db_prev; db_addr_t db_next; 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[]; /* * if 'ed' style: 'dot' is set at start of last item printed, * and '+' points to next line. * Otherwise: 'dot' points to next item, '..' points to last. */ static boolean_t db_ed_style = TRUE; /* * Utility routine - discard tokens through end-of-line. */ void db_skip_to_eol() { int t; do { t = db_read_token(); } while (t != tEOL); } /* * Results of command search. */ #define CMD_UNIQUE 0 #define CMD_FOUND 1 #define CMD_NONE 2 #define CMD_AMBIGUOUS 3 #define CMD_HELP 4 static void db_cmd_list __P((struct command *table, struct command **aux_tablep)); static int db_cmd_search __P((char *name, struct command *table, struct command **aux_tablep, struct command **cmdp)); static void db_command __P((struct command **last_cmdp, struct command *cmd_table, struct command **aux_cmd_tablep)); /* * Search for command prefix. */ static int db_cmd_search(name, table, aux_tablep, cmdp) char * name; struct command *table; struct command **aux_tablep; struct command **cmdp; /* out */ { struct command *cmd; struct command **aux_cmdp; int result = CMD_NONE; for (cmd = table; cmd->name != 0; cmd++) { register char *lp; register char *rp; register int c; lp = name; rp = cmd->name; while ((c = *lp) == *rp) { if (c == 0) { /* complete match */ *cmdp = cmd; return (CMD_UNIQUE); } lp++; rp++; } if (c == 0) { /* end of name, not end of command - partial match */ if (result == CMD_FOUND) { result = CMD_AMBIGUOUS; /* but keep looking for a full match - this lets us match single letters */ } else { *cmdp = cmd; result = CMD_FOUND; } } } if (result == CMD_NONE && aux_tablep != 0) /* XXX repeat too much code. */ for (aux_cmdp = aux_tablep; *aux_cmdp != 0; aux_cmdp++) { register char *lp; register char *rp; register int c; lp = name; rp = (*aux_cmdp)->name; while ((c = *lp) == *rp) { if (c == 0) { /* complete match */ *cmdp = *aux_cmdp; return (CMD_UNIQUE); } lp++; rp++; } if (c == 0) { /* end of name, not end of command - partial match */ if (result == CMD_FOUND) { result = CMD_AMBIGUOUS; /* but keep looking for a full match - this lets us match single letters */ } else { *cmdp = *aux_cmdp; result = CMD_FOUND; } } } if (result == CMD_NONE) { /* check for 'help' */ if (name[0] == 'h' && name[1] == 'e' && name[2] == 'l' && name[3] == 'p') result = CMD_HELP; } return (result); } static void db_cmd_list(table, aux_tablep) struct command *table; struct command **aux_tablep; { register struct command *cmd; register struct command **aux_cmdp; for (cmd = table; cmd->name != 0; cmd++) { db_printf("%-12s", cmd->name); db_end_line(); } if (aux_tablep == 0) return; for (aux_cmdp = aux_tablep; *aux_cmdp != 0; aux_cmdp++) { db_printf("%-12s", (*aux_cmdp)->name); db_end_line(); } } static void db_command(last_cmdp, cmd_table, aux_cmd_tablep) struct command **last_cmdp; /* IN_OUT */ struct command *cmd_table; struct command **aux_cmd_tablep; { struct command *cmd; int t; char modif[TOK_STRING_SIZE]; db_expr_t addr, count; boolean_t have_addr = FALSE; int result; t = db_read_token(); if (t == tEOL) { /* empty line repeats last command, at 'next' */ cmd = *last_cmdp; addr = (db_expr_t)db_next; have_addr = FALSE; count = 1; modif[0] = '\0'; } else if (t == tEXCL) { db_fncall((db_expr_t)0, (boolean_t)0, (db_expr_t)0, (char *)0); return; } else if (t != tIDENT) { db_printf("?\n"); db_flush_lex(); return; } else { /* * Search for command */ while (cmd_table) { result = db_cmd_search(db_tok_string, cmd_table, aux_cmd_tablep, &cmd); switch (result) { case CMD_NONE: db_printf("No such command\n"); db_flush_lex(); return; case CMD_AMBIGUOUS: db_printf("Ambiguous\n"); db_flush_lex(); return; case CMD_HELP: db_cmd_list(cmd_table, aux_cmd_tablep); db_flush_lex(); return; default: break; } if ((cmd_table = cmd->more) != 0) { /* XXX usually no more aux's. */ aux_cmd_tablep = 0; if (cmd_table == db_show_cmds) aux_cmd_tablep = (struct command **)&db_show_cmd_set.ls_items[0]; t = db_read_token(); if (t != tIDENT) { db_cmd_list(cmd_table, aux_cmd_tablep); db_flush_lex(); return; } } } if ((cmd->flag & CS_OWN) == 0) { /* * Standard syntax: * command [/modifier] [addr] [,count] */ t = db_read_token(); if (t == tSLASH) { t = db_read_token(); if (t != tIDENT) { db_printf("Bad modifier\n"); db_flush_lex(); return; } db_strcpy(modif, db_tok_string); } else { db_unread_token(t); modif[0] = '\0'; } if (db_expression(&addr)) { db_dot = (db_addr_t) addr; db_last_addr = db_dot; have_addr = TRUE; } else { addr = (db_expr_t) db_dot; have_addr = FALSE; } t = db_read_token(); if (t == tCOMMA) { if (!db_expression(&count)) { db_printf("Count missing\n"); db_flush_lex(); return; } } else { db_unread_token(t); count = -1; } if ((cmd->flag & CS_MORE) == 0) { db_skip_to_eol(); } } } *last_cmdp = cmd; if (cmd != 0) { /* * Execute the command. */ (*cmd->fcn)(addr, have_addr, count, modif); if (cmd->flag & CS_SET_DOT) { /* * If command changes dot, set dot to * previous address displayed (if 'ed' style). */ if (db_ed_style) { db_dot = db_prev; } else { db_dot = db_next; } } else { /* * If command does not change dot, * set 'next' location to be the same. */ db_next = db_dot; } } } /* * 'show' commands */ static struct command db_show_all_cmds[] = { #if 0 { "threads", db_show_all_threads, 0, 0 }, #endif { "procs", db_ps, 0, 0 }, { (char *)0 } }; 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 #if 0 { "port", ipc_port_print, 0, 0 }, #endif { (char *)0, } }; static struct command db_command_table[] = { { "print", db_print_cmd, 0, 0 }, { "p", db_print_cmd, 0, 0 }, { "examine", db_examine_cmd, CS_SET_DOT, 0 }, { "x", db_examine_cmd, CS_SET_DOT, 0 }, { "search", db_search_cmd, CS_OWN|CS_SET_DOT, 0 }, { "set", db_set_cmd, CS_OWN, 0 }, { "write", db_write_cmd, CS_MORE|CS_SET_DOT, 0 }, { "w", db_write_cmd, CS_MORE|CS_SET_DOT, 0 }, { "delete", db_delete_cmd, 0, 0 }, { "d", db_delete_cmd, 0, 0 }, { "break", db_breakpoint_cmd, 0, 0 }, { "dwatch", db_deletewatch_cmd, 0, 0 }, { "watch", db_watchpoint_cmd, CS_MORE,0 }, { "step", db_single_step_cmd, 0, 0 }, { "s", db_single_step_cmd, 0, 0 }, { "continue", db_continue_cmd, 0, 0 }, { "c", db_continue_cmd, 0, 0 }, { "until", db_trace_until_call_cmd,0, 0 }, { "next", db_trace_until_matching_cmd,0, 0 }, { "match", db_trace_until_matching_cmd,0, 0 }, { "trace", db_stack_trace_cmd, 0, 0 }, { "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, } }; static struct command *db_last_command = 0; #if 0 void db_help_cmd() { struct command *cmd = db_command_table; while (cmd->name != 0) { db_printf("%-12s", cmd->name); db_end_line(); 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"); } void db_command_loop() { /* * Initialize 'prev' and 'next' to dot. */ db_prev = db_dot; db_next = db_dot; db_cmd_loop_done = 0; while (!db_cmd_loop_done) { (void) setjmp(db_jmpbuf); if (db_print_position() != 0) db_printf("\n"); db_printf("db> "); (void) db_read_line(); db_command(&db_last_command, db_command_table, (struct command **)&db_cmd_set.ls_items[0]); } } void db_error(s) char *s; { if (s) db_printf(s); db_flush_lex(); longjmp(db_jmpbuf, 1); } /* * Call random function: * !expr(arg,arg,arg) */ static void db_fncall(dummy1, dummy2, dummy3, dummy4) db_expr_t dummy1; boolean_t dummy2; db_expr_t dummy3; char * dummy4; { db_expr_t fn_addr; #define MAXARGS 11 /* XXX only 10 are passed */ db_expr_t args[MAXARGS]; int nargs = 0; db_expr_t retval; 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)) { db_printf("Bad function\n"); db_flush_lex(); return; } func = (fcn_10args_t *)fn_addr; /* XXX */ t = db_read_token(); if (t == tLPAREN) { if (db_expression(&args[0])) { nargs++; while ((t = db_read_token()) == tCOMMA) { if (nargs == MAXARGS) { db_printf("Too many arguments\n"); db_flush_lex(); return; } if (!db_expression(&args[nargs])) { db_printf("Argument missing\n"); db_flush_lex(); return; } nargs++; } db_unread_token(t); } if (db_read_token() != tRPAREN) { db_printf("?\n"); db_flush_lex(); return; } } db_skip_to_eol(); while (nargs < MAXARGS) { args[nargs++] = 0; } retval = (*func)(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9] ); db_printf("%#n\n", retval); } /* Enter GDB remote protocol debugger on the next trap. */ static void db_gdb (dummy1, dummy2, dummy3, dummy4) db_expr_t dummy1; boolean_t dummy2; db_expr_t dummy3; char * dummy4; { boothowto ^= RB_GDB; db_printf("Next trap will enter %s\n", boothowto & RB_GDB ? "GDB remote protocol mode" : "DDB debugger"); } diff --git a/sys/ddb/db_watch.c b/sys/ddb/db_watch.c index c0f951e72689..1fa3c3438c93 100644 --- a/sys/ddb/db_watch.c +++ b/sys/ddb/db_watch.c @@ -1,285 +1,284 @@ /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * 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 $ */ /* * Author: Richard P. Draves, Carnegie Mellon University * Date: 10/90 */ #include +#include #include #include #include #include #include #include #include /* * Watchpoints. */ static boolean_t db_watchpoints_inserted = TRUE; #define NWATCHPOINTS 100 static struct db_watchpoint db_watch_table[NWATCHPOINTS]; static db_watchpoint_t db_next_free_watchpoint = &db_watch_table[0]; static db_watchpoint_t db_free_watchpoints = 0; static db_watchpoint_t db_watchpoint_list = 0; static db_watchpoint_t db_watchpoint_alloc __P((void)); static void db_watchpoint_free __P((db_watchpoint_t watch)); static void db_delete_watchpoint __P((vm_map_t map, db_addr_t addr)); #ifdef notused static boolean_t db_find_watchpoint __P((vm_map_t map, db_addr_t addr, db_regs_t *regs)); #endif static void db_list_watchpoints __P((void)); static void db_set_watchpoint __P((vm_map_t map, db_addr_t addr, vm_size_t size)); db_watchpoint_t db_watchpoint_alloc() { register db_watchpoint_t watch; if ((watch = db_free_watchpoints) != 0) { db_free_watchpoints = watch->link; return (watch); } if (db_next_free_watchpoint == &db_watch_table[NWATCHPOINTS]) { db_printf("All watchpoints used.\n"); return (0); } watch = db_next_free_watchpoint; db_next_free_watchpoint++; return (watch); } void db_watchpoint_free(watch) register db_watchpoint_t watch; { watch->link = db_free_watchpoints; db_free_watchpoints = watch; } static void db_set_watchpoint(map, addr, size) vm_map_t map; db_addr_t addr; vm_size_t size; { register db_watchpoint_t watch; if (map == NULL) { db_printf("No map.\n"); return; } /* * Should we do anything fancy with overlapping regions? */ for (watch = db_watchpoint_list; watch != 0; watch = watch->link) if (db_map_equal(watch->map, map) && (watch->loaddr == addr) && (watch->hiaddr == addr+size)) { db_printf("Already set.\n"); return; } watch = db_watchpoint_alloc(); if (watch == 0) { db_printf("Too many watchpoints.\n"); return; } watch->map = map; watch->loaddr = addr; watch->hiaddr = addr+size; watch->link = db_watchpoint_list; db_watchpoint_list = watch; db_watchpoints_inserted = FALSE; } static void db_delete_watchpoint(map, addr) vm_map_t map; db_addr_t addr; { register db_watchpoint_t watch; register db_watchpoint_t *prev; for (prev = &db_watchpoint_list; (watch = *prev) != 0; prev = &watch->link) if (db_map_equal(watch->map, map) && (watch->loaddr <= addr) && (addr < watch->hiaddr)) { *prev = watch->link; db_watchpoint_free(watch); return; } db_printf("Not set.\n"); } static void db_list_watchpoints() { register db_watchpoint_t watch; if (db_watchpoint_list == 0) { db_printf("No watchpoints set\n"); return; } db_printf(" Map Address Size\n"); for (watch = db_watchpoint_list; watch != 0; watch = watch->link) db_printf("%s%8x %8x %x\n", db_map_current(watch->map) ? "*" : " ", watch->map, watch->loaddr, watch->hiaddr - watch->loaddr); } /* Delete watchpoint */ /*ARGSUSED*/ void db_deletewatch_cmd(addr, have_addr, count, modif) db_expr_t addr; boolean_t have_addr; db_expr_t count; char * modif; { db_delete_watchpoint(db_map_addr(addr), addr); } /* Set watchpoint */ /*ARGSUSED*/ void db_watchpoint_cmd(addr, have_addr, count, modif) db_expr_t addr; boolean_t have_addr; db_expr_t count; char * modif; { vm_size_t size; db_expr_t value; if (db_expression(&value)) size = (vm_size_t) value; else size = 4; db_skip_to_eol(); 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(); } void db_set_watchpoints() { register db_watchpoint_t watch; if (!db_watchpoints_inserted) { for (watch = db_watchpoint_list; watch != 0; watch = watch->link) pmap_protect(watch->map->pmap, trunc_page(watch->loaddr), round_page(watch->hiaddr), VM_PROT_READ); db_watchpoints_inserted = TRUE; } } void db_clear_watchpoints() { db_watchpoints_inserted = FALSE; } #ifdef notused static boolean_t db_find_watchpoint(map, addr, regs) vm_map_t map; db_addr_t addr; db_regs_t *regs; { register db_watchpoint_t watch; db_watchpoint_t found = 0; for (watch = db_watchpoint_list; watch != 0; watch = watch->link) if (db_map_equal(watch->map, map)) { if ((watch->loaddr <= addr) && (addr < watch->hiaddr)) return (TRUE); else if ((trunc_page(watch->loaddr) <= addr) && (addr < round_page(watch->hiaddr))) found = watch; } /* * We didn't hit exactly on a watchpoint, but we are * in a protected region. We want to single-step * and then re-protect. */ if (found) { db_watchpoints_inserted = FALSE; db_single_step(regs); } return (FALSE); } #endif diff --git a/sys/ddb/ddb.h b/sys/ddb/ddb.h index 6376a2000e1f..a5638947728f 100644 --- a/sys/ddb/ddb.h +++ b/sys/ddb/ddb.h @@ -1,150 +1,149 @@ /*- * 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$ + * $Id: ddb.h,v 1.14 1997/02/22 09:28:35 peter Exp $ */ /* * Necessary declarations for the `ddb' kernel debugger. */ #ifndef _DDB_DDB_H_ #define _DDB_DDB_H_ #include /* type definitions */ typedef void db_cmdfcn_t __P((db_expr_t addr, boolean_t have_addr, db_expr_t count, char *modif)); #define DB_COMMAND(cmd_name, func_name) \ DB_SET(cmd_name, func_name, db_cmd_set) #define DB_SHOW_COMMAND(cmd_name, func_name) \ DB_SET(cmd_name, func_name, db_show_cmd_set) #define DB_SET(cmd_name, func_name, set) \ static db_cmdfcn_t func_name; \ \ static const struct command __CONCAT(func_name,_cmd) = { \ __STRING(cmd_name), \ func_name, \ 0, \ 0, \ }; \ TEXT_SET(set, __CONCAT(func_name,_cmd)); \ \ static void \ func_name(addr, have_addr, count, modif) \ db_expr_t addr; \ boolean_t have_addr; \ db_expr_t count; \ char *modif; extern char *esym; extern unsigned int db_maxoff; extern int db_indent; 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; struct vm_map; void cnpollc __P((int)); void db_check_interrupt __P((void)); void db_clear_watchpoints __P((void)); db_addr_t db_disasm __P((db_addr_t loc, boolean_t altfmt)); /* instruction disassembler */ void db_error __P((char *s)); int db_expression __P((db_expr_t *valuep)); int db_get_variable __P((db_expr_t *valuep)); void db_iprintf __P((const char *,...)); struct vm_map *db_map_addr __P((vm_offset_t)); boolean_t db_map_current __P((struct vm_map *)); boolean_t db_map_equal __P((struct vm_map *, struct vm_map *)); void db_print_loc_and_inst __P((db_addr_t loc)); void db_printf __P((const char *fmt, ...)); void db_read_bytes __P((vm_offset_t addr, int size, char *data)); /* machine-dependent */ int db_readline __P((char *lstart, int lsize)); void db_restart_at_pc __P((boolean_t watchpt)); void db_set_watchpoints __P((void)); void db_skip_to_eol __P((void)); boolean_t db_stop_at_pc __P((boolean_t *is_breakpoint)); #define db_strcpy strcpy void db_trap __P((int type, int code)); int db_value_of_name __P((char *name, db_expr_t *valuep)); void db_write_bytes __P((vm_offset_t addr, int size, char *data)); /* machine-dependent */ void kdb_init __P((void)); void kdbprintf __P((const char *fmt, ...)); db_cmdfcn_t db_breakpoint_cmd; db_cmdfcn_t db_continue_cmd; 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; db_cmdfcn_t db_set_cmd; db_cmdfcn_t db_show_regs; db_cmdfcn_t db_single_step_cmd; db_cmdfcn_t db_stack_trace_cmd; db_cmdfcn_t db_trace_until_call_cmd; db_cmdfcn_t db_trace_until_matching_cmd; db_cmdfcn_t db_watchpoint_cmd; db_cmdfcn_t db_write_cmd; #if 0 db_cmdfcn_t db_help_cmd; db_cmdfcn_t db_show_all_threads; db_cmdfcn_t db_show_one_thread; db_cmdfcn_t ipc_port_print; db_cmdfcn_t vm_page_print; #endif /* * Command table. */ struct command { char * name; /* command name */ 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 words * at end */ #define CS_SET_DOT 0x100 /* set dot after command */ struct command *more; /* another level of command */ }; #endif /* !_DDB_DDB_H_ */