[eros-cvs] cvs commit: eros/src/base/sys/ddb db_command.cxx db_eros.cxx
shap@eros.cs.jhu.edu
shap@eros.cs.jhu.edu
Sat, 20 Jan 2001 14:27:39 -0500
shap 01/01/20 14:27:39
Modified: src/base/sys/ddb db_command.cxx db_eros.cxx
Log:
Add support in the kernel debugger to print out SegWalkInfo
structures. This was needed to track down the source of the pPage == 0
bug, but since it isn't properly a part of the bug fix I am checking
it in separately.
Revision Changes Path
1.61 +2 -0 eros/src/base/sys/ddb/db_command.cxx
Index: db_command.cxx
===================================================================
RCS file: /cvs/eros/src/base/sys/ddb/db_command.cxx,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- db_command.cxx 2001/01/10 13:16:42 1.60
+++ db_command.cxx 2001/01/20 19:27:38 1.61
@@ -375,6 +375,7 @@
extern void db_show_savearea_cmd(db_expr_t, int, db_expr_t, char*);
extern void db_show_sizes_cmd(db_expr_t, int, db_expr_t, char*);
extern void db_show_gdt(db_expr_t, int, db_expr_t, char*);
+extern void db_show_walkinfo_cmd(db_expr_t, int, db_expr_t, char*);
struct db_command db_show_all_cmds[] = {
#if 0
@@ -430,6 +431,7 @@
{ "sizes", db_show_sizes_cmd, 0, 0 },
{ "thread", db_thread_print_cmd, 0, 0 },
{ "uthreads", db_show_uthread_cmd, 0, 0 },
+ { "walkinfo", db_show_walkinfo_cmd, 0, 0 },
#ifdef DDB_WATCH
{ "watches", db_listwatch_cmd, 0, 0 },
#endif
1.130 +36 -0 eros/src/base/sys/ddb/db_eros.cxx
Index: db_eros.cxx
===================================================================
RCS file: /cvs/eros/src/base/sys/ddb/db_eros.cxx,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -r1.129 -r1.130
--- db_eros.cxx 2001/01/10 13:16:42 1.129
+++ db_eros.cxx 2001/01/20 19:27:38 1.130
@@ -1714,3 +1714,39 @@
base += EROS_PAGE_SIZE;
}
}
+
+void
+db_print_walkinfo(const SegWalkInfo *wi)
+{
+#define BOOLC(x) ((x) ? 'y' : 'n')
+ db_printf("wi: vaddr 0x%08x segBlss %d segObj 0x%08x\n"
+ "segObjIsRed: %c offset: 0x%08x%08x\n"
+ "redSpanBlss %d redSegOffset 0x%08x%08x\n"
+ "writeAccess: %c capAccess: %c prompt: %c canCall: %c\n"
+ "weakRef: %c canWrite: %c segFault %d traverseCount %d\n",
+ wi->vaddr, wi->segBlss, wi->segObj,
+ BOOLC(wi->segObjIsRed),
+ (uint32_t) (wi->offset >> 32),
+ (uint32_t) (wi->offset),
+ wi->redSpanBlss,
+ (uint32_t) (wi->redSegOffset >> 32),
+ (uint32_t) (wi->redSegOffset),
+ BOOLC(wi->writeAccess), BOOLC(wi->capAccess),
+ BOOLC(wi->prompt),
+ BOOLC(wi->canCall), BOOLC(wi->weakRef),
+ BOOLC(wi->canWrite),
+ wi->segFault, wi->traverseCount);
+#undef BOOLC
+}
+
+void
+db_show_walkinfo_cmd(db_expr_t addr, int have_addr,
+ db_expr_t /* count */, char * /* modif */)
+{
+ extern void DumpFixRegs(const fixregs_t *fx);
+
+ if (have_addr == 0)
+ db_error("requires address\n");
+
+ db_print_walkinfo((const SegWalkInfo *) addr);
+}