diff options
author | phk <phk@FreeBSD.org> | 1998-05-19 11:02:24 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-05-19 11:02:24 +0000 |
commit | e9c01f2e741c8a0e26e7d3712d942dc5d5f5fa0b (patch) | |
tree | 8ee4916cff753a650c4ede6aa561a7d54e574465 /sys/ddb | |
parent | 00b3b49e1bf2cd947f5d9fc0b4a645f000094534 (diff) | |
download | FreeBSD-src-e9c01f2e741c8a0e26e7d3712d942dc5d5f5fa0b.zip FreeBSD-src-e9c01f2e741c8a0e26e7d3712d942dc5d5f5fa0b.tar.gz |
Add "show msgbuf" command
Diffstat (limited to 'sys/ddb')
-rw-r--r-- | sys/ddb/db_command.c | 3 | ||||
-rw-r--r-- | sys/ddb/db_print.c | 32 | ||||
-rw-r--r-- | sys/ddb/ddb.h | 3 |
3 files changed, 35 insertions, 3 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 63a89bb..1bf43de 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.24 1998/02/09 06:07:52 eivind Exp $ + * $Id: db_command.c,v 1.25 1998/02/13 02:19:29 bde Exp $ */ /* @@ -369,6 +369,7 @@ 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 }, + { "msgbuf", db_show_msgbuf, 0, 0 }, #if 0 { "thread", db_show_one_thread, 0, 0 }, #endif diff --git a/sys/ddb/db_print.c b/sys/ddb/db_print.c index 8f7528f..c67c964 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: db_print.c,v 1.13 1997/02/22 09:28:27 peter Exp $ + * $Id: db_print.c,v 1.14 1997/06/14 11:52:36 bde Exp $ */ /* @@ -35,6 +35,7 @@ * Miscellaneous printing. */ #include <sys/param.h> +#include <sys/msgbuf.h> #include <ddb/ddb.h> #include <ddb/db_variables.h> @@ -65,3 +66,32 @@ db_show_regs(dummy1, dummy2, dummy3, dummy4) db_print_loc_and_inst(PC_REGS(DDB_REGS)); } + +void +db_show_msgbuf(dummy1, dummy2, dummy3, dummy4) + db_expr_t dummy1; + boolean_t dummy2; + db_expr_t dummy3; + char * dummy4; +{ + int i,j; + + if (!msgbufmapped) { + db_printf("msgbuf not mapped yet\n"); + return; + } + db_printf("msgbufp = %p\n", msgbufp); + db_printf("magic = %x, size = %d, r= %d, w = %d, ptr = %p\n", + msgbufp->msg_magic, + msgbufp->msg_size, + msgbufp->msg_bufr, + msgbufp->msg_bufx, + msgbufp->msg_ptr); + for (i = 0; i < msgbufp->msg_size; i++) { + j = msgbufp->msg_ptr[(i + msgbufp->msg_bufr) % msgbufp->msg_size]; + if (j) + db_printf("%c", j); + } + db_printf("\n"); +} + diff --git a/sys/ddb/ddb.h b/sys/ddb/ddb.h index a563894..b635ff2 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: ddb.h,v 1.14 1997/02/22 09:28:35 peter Exp $ + * $Id: ddb.h,v 1.15 1998/02/13 02:19:29 bde Exp $ */ /* @@ -116,6 +116,7 @@ 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_msgbuf; db_cmdfcn_t db_show_regs; db_cmdfcn_t db_single_step_cmd; db_cmdfcn_t db_stack_trace_cmd; |