Add "show msgbuf" command
This commit is contained in:
parent
58067a9909
commit
7ee17eea02
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=36181
@ -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
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user