Module Name: src
Committed By: mrg
Date: Wed Apr 13 03:34:38 UTC 2011
Modified Files:
src/sys/arch/sparc64/sparc64: db_interface.c
Log Message:
port to userspace. this needs db_user.h, stddef.h, stdbool.h and not
promlib.h. put db_read/write_bytes() under _KERNEL.
XXX: for now, provide an empty db_machine_command_table[].
XXX2: this file puts a lot of it under #ifdef DDB, but i'm not sure
why this is done. for now it makes it easier to port to userspace :)
To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/sys/arch/sparc64/sparc64/db_interface.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/sparc64/sparc64/db_interface.c
diff -u src/sys/arch/sparc64/sparc64/db_interface.c:1.127 src/sys/arch/sparc64/sparc64/db_interface.c:1.128
--- src/sys/arch/sparc64/sparc64/db_interface.c:1.127 Wed Apr 13 03:29:03 2011
+++ src/sys/arch/sparc64/sparc64/db_interface.c Wed Apr 13 03:34:37 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.127 2011/04/13 03:29:03 mrg Exp $ */
+/* $NetBSD: db_interface.c,v 1.128 2011/04/13 03:34:37 mrg Exp $ */
/*
* Copyright (c) 1996-2002 Eduardo Horvath. All rights reserved.
@@ -34,10 +34,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.127 2011/04/13 03:29:03 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.128 2011/04/13 03:34:37 mrg Exp $");
+#ifdef _KERNEL_OPT
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
+#endif
#include <sys/param.h>
#include <sys/proc.h>
@@ -53,6 +55,7 @@
#include <ddb/db_command.h>
#include <ddb/db_sym.h>
#include <ddb/db_variables.h>
+#include <ddb/db_user.h>
#include <ddb/db_extern.h>
#include <ddb/db_access.h>
#include <ddb/db_output.h>
@@ -61,12 +64,20 @@
#include <machine/instr.h>
#include <machine/cpu.h>
+#ifdef _KERNEL
#include <machine/promlib.h>
+#endif
#include <machine/ctlreg.h>
#include <machine/pmap.h>
#include <machine/intr.h>
+#include <machine/vmparam.h>
+#ifdef _KERNEL
#include "fb.h"
+#else
+#include <stddef.h>
+#include <stdbool.h>
+#endif
extern struct traptrace {
unsigned short tl:3, /* Trap level */
@@ -515,6 +526,7 @@
}
#endif /* DDB */
+#ifdef _KERNEL
/*
* Read bytes from kernel address space for debugger.
*/
@@ -556,6 +568,7 @@
}
}
+#endif
#ifdef DDB
void
@@ -1306,6 +1319,13 @@
{ DDB_ADD_CMD(NULL, NULL, 0, NULL,NULL,NULL) }
};
+#else /* DDB */
+
+/* XXX */
+const struct db_command db_machine_command_table[] = {
+ { DDB_ADD_CMD(NULL, NULL, 0, NULL,NULL,NULL) }
+};
+
#endif /* DDB */
/*
@@ -1358,7 +1378,8 @@
default:
/* not a branch */
- panic("branch_taken() on non-branch");
+ printf("branch_taken() on non-branch");
+ return pc;
}
}