summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2002-10-04 01:19:18 +0000
committergrehan <grehan@FreeBSD.org>2002-10-04 01:19:18 +0000
commit93f545f5364d26cf38551147edb95515a4ccc20e (patch)
tree8e5b099fda2bff29e4f306186c79ea3e644aff3d
parent40bdd697c26f987637e72420edcae436c92916b9 (diff)
downloadFreeBSD-src-93f545f5364d26cf38551147edb95515a4ccc20e.zip
FreeBSD-src-93f545f5364d26cf38551147edb95515a4ccc20e.tar.gz
Clean up ddb warnings/errors and enable in GENERIC
Approved by: benno Motivated by: gallatin
-rw-r--r--sys/powerpc/aim/trap.c4
-rw-r--r--sys/powerpc/conf/GENERIC2
-rw-r--r--sys/powerpc/include/db_machdep.h2
-rw-r--r--sys/powerpc/powerpc/db_disasm.c4
-rw-r--r--sys/powerpc/powerpc/db_interface.c1
-rw-r--r--sys/powerpc/powerpc/db_memrw.c2
-rw-r--r--sys/powerpc/powerpc/db_trace.c97
-rw-r--r--sys/powerpc/powerpc/trap.c4
8 files changed, 59 insertions, 57 deletions
diff --git a/sys/powerpc/aim/trap.c b/sys/powerpc/aim/trap.c
index d8d82e6..5469c2e 100644
--- a/sys/powerpc/aim/trap.c
+++ b/sys/powerpc/aim/trap.c
@@ -75,6 +75,8 @@ static const char rcsid[] =
#include <machine/spr.h>
#include <machine/sr.h>
+#include <ddb/ddb.h>
+
#ifndef MULTIPROCESSOR
extern int intr_depth;
#endif
@@ -280,7 +282,7 @@ trap_fatal(struct trapframe *frame)
printtrap(frame->exc, frame, 1, (frame->srr1 & PSL_PR));
#ifdef DDB
- if ((debugger_on_panic || db_active) && kdb_trap(frame->exc, 0, frame))
+ if ((debugger_on_panic || db_active) && kdb_trap(frame->exc, frame))
return;
#endif
panic("%s trap", trapname(frame->exc));
diff --git a/sys/powerpc/conf/GENERIC b/sys/powerpc/conf/GENERIC
index 061f3e5..e99835f 100644
--- a/sys/powerpc/conf/GENERIC
+++ b/sys/powerpc/conf/GENERIC
@@ -57,7 +57,7 @@ options SYSVSEM #SYSV-style semaphores
#options _KPOSIX_PRIORITY_SCHEDULING
# Debugging for use in -current
-#options DDB #Enable the kernel debugger
+options DDB #Enable the kernel debugger
options INVARIANTS #Enable calls of extra sanity checking
options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS
options WITNESS #Enable checks to detect deadlocks and cycles
diff --git a/sys/powerpc/include/db_machdep.h b/sys/powerpc/include/db_machdep.h
index c8c6723..33df0f3 100644
--- a/sys/powerpc/include/db_machdep.h
+++ b/sys/powerpc/include/db_machdep.h
@@ -42,7 +42,7 @@
#define DB_ELFSIZE 32
typedef vm_offset_t db_addr_t; /* address - unsigned */
-typedef long db_expr_t; /* expression - signed */
+typedef int db_expr_t; /* expression - signed */
struct powerpc_saved_state {
u_int32_t r[32]; /* data registers */
u_int32_t iar;
diff --git a/sys/powerpc/powerpc/db_disasm.c b/sys/powerpc/powerpc/db_disasm.c
index e598eb5..67f90d2 100644
--- a/sys/powerpc/powerpc/db_disasm.c
+++ b/sys/powerpc/powerpc/db_disasm.c
@@ -717,8 +717,7 @@ disasm_fields(const struct opcode *popcode, instr_t instr, vm_offset_t loc,
LI = LI << 8;
LI = LI >> 6;
LI += loc;
- db_symstr(pstr, LI, DB_STGY_ANY);
- pstr += strlen(pstr);
+ pstr += sprintf (pstr, "0x%x, ", LI);
func &= ~Op_LI;
}
switch (func & Op_SIMM) {
@@ -739,6 +738,7 @@ disasm_fields(const struct opcode *popcode, instr_t instr, vm_offset_t loc,
pstr += sprintf(pstr, "0x%x", IMM);
break;
default:
+ break;
}
if (func & Op_BD) {
u_int BD;
diff --git a/sys/powerpc/powerpc/db_interface.c b/sys/powerpc/powerpc/db_interface.c
index 8eda5c4..a25674b 100644
--- a/sys/powerpc/powerpc/db_interface.c
+++ b/sys/powerpc/powerpc/db_interface.c
@@ -9,6 +9,7 @@
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/systm.h>
+#include <sys/cons.h>
#include <machine/db_machdep.h>
#include <machine/frame.h>
diff --git a/sys/powerpc/powerpc/db_memrw.c b/sys/powerpc/powerpc/db_memrw.c
index eb3de2a..ccfc408 100644
--- a/sys/powerpc/powerpc/db_memrw.c
+++ b/sys/powerpc/powerpc/db_memrw.c
@@ -47,7 +47,7 @@
#include <machine/db_machdep.h>
-#include <ddb/db_access.h>
+#include <ddb/ddb.h>
/*
* Read bytes from kernel address space for debugger.
diff --git a/sys/powerpc/powerpc/db_trace.c b/sys/powerpc/powerpc/db_trace.c
index 0ea9758..014990d 100644
--- a/sys/powerpc/powerpc/db_trace.c
+++ b/sys/powerpc/powerpc/db_trace.c
@@ -29,6 +29,7 @@
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/user.h>
@@ -46,48 +47,48 @@
#include <ddb/db_variables.h>
struct db_variable db_regs[] = {
- { "r0", (long *)&ddb_regs.r[0], FCN_NULL },
- { "r1", (long *)&ddb_regs.r[1], FCN_NULL },
- { "r2", (long *)&ddb_regs.r[2], FCN_NULL },
- { "r3", (long *)&ddb_regs.r[3], FCN_NULL },
- { "r4", (long *)&ddb_regs.r[4], FCN_NULL },
- { "r5", (long *)&ddb_regs.r[5], FCN_NULL },
- { "r6", (long *)&ddb_regs.r[6], FCN_NULL },
- { "r7", (long *)&ddb_regs.r[7], FCN_NULL },
- { "r8", (long *)&ddb_regs.r[8], FCN_NULL },
- { "r9", (long *)&ddb_regs.r[9], FCN_NULL },
- { "r10", (long *)&ddb_regs.r[10], FCN_NULL },
- { "r11", (long *)&ddb_regs.r[11], FCN_NULL },
- { "r12", (long *)&ddb_regs.r[12], FCN_NULL },
- { "r13", (long *)&ddb_regs.r[13], FCN_NULL },
- { "r14", (long *)&ddb_regs.r[14], FCN_NULL },
- { "r15", (long *)&ddb_regs.r[15], FCN_NULL },
- { "r16", (long *)&ddb_regs.r[16], FCN_NULL },
- { "r17", (long *)&ddb_regs.r[17], FCN_NULL },
- { "r18", (long *)&ddb_regs.r[18], FCN_NULL },
- { "r19", (long *)&ddb_regs.r[19], FCN_NULL },
- { "r20", (long *)&ddb_regs.r[20], FCN_NULL },
- { "r21", (long *)&ddb_regs.r[21], FCN_NULL },
- { "r22", (long *)&ddb_regs.r[22], FCN_NULL },
- { "r23", (long *)&ddb_regs.r[23], FCN_NULL },
- { "r24", (long *)&ddb_regs.r[24], FCN_NULL },
- { "r25", (long *)&ddb_regs.r[25], FCN_NULL },
- { "r26", (long *)&ddb_regs.r[26], FCN_NULL },
- { "r27", (long *)&ddb_regs.r[27], FCN_NULL },
- { "r28", (long *)&ddb_regs.r[28], FCN_NULL },
- { "r29", (long *)&ddb_regs.r[29], FCN_NULL },
- { "r30", (long *)&ddb_regs.r[30], FCN_NULL },
- { "r31", (long *)&ddb_regs.r[31], FCN_NULL },
- { "iar", (long *)&ddb_regs.iar, FCN_NULL },
- { "msr", (long *)&ddb_regs.msr, FCN_NULL },
- { "lr", (long *)&ddb_regs.lr, FCN_NULL },
- { "ctr", (long *)&ddb_regs.ctr, FCN_NULL },
- { "cr", (long *)&ddb_regs.cr, FCN_NULL },
- { "xer", (long *)&ddb_regs.xer, FCN_NULL },
+ { "r0", &ddb_regs.r[0], FCN_NULL },
+ { "r1", &ddb_regs.r[1], FCN_NULL },
+ { "r2", &ddb_regs.r[2], FCN_NULL },
+ { "r3", &ddb_regs.r[3], FCN_NULL },
+ { "r4", &ddb_regs.r[4], FCN_NULL },
+ { "r5", &ddb_regs.r[5], FCN_NULL },
+ { "r6", &ddb_regs.r[6], FCN_NULL },
+ { "r7", &ddb_regs.r[7], FCN_NULL },
+ { "r8", &ddb_regs.r[8], FCN_NULL },
+ { "r9", &ddb_regs.r[9], FCN_NULL },
+ { "r10", &ddb_regs.r[10], FCN_NULL },
+ { "r11", &ddb_regs.r[11], FCN_NULL },
+ { "r12", &ddb_regs.r[12], FCN_NULL },
+ { "r13", &ddb_regs.r[13], FCN_NULL },
+ { "r14", &ddb_regs.r[14], FCN_NULL },
+ { "r15", &ddb_regs.r[15], FCN_NULL },
+ { "r16", &ddb_regs.r[16], FCN_NULL },
+ { "r17", &ddb_regs.r[17], FCN_NULL },
+ { "r18", &ddb_regs.r[18], FCN_NULL },
+ { "r19", &ddb_regs.r[19], FCN_NULL },
+ { "r20", &ddb_regs.r[20], FCN_NULL },
+ { "r21", &ddb_regs.r[21], FCN_NULL },
+ { "r22", &ddb_regs.r[22], FCN_NULL },
+ { "r23", &ddb_regs.r[23], FCN_NULL },
+ { "r24", &ddb_regs.r[24], FCN_NULL },
+ { "r25", &ddb_regs.r[25], FCN_NULL },
+ { "r26", &ddb_regs.r[26], FCN_NULL },
+ { "r27", &ddb_regs.r[27], FCN_NULL },
+ { "r28", &ddb_regs.r[28], FCN_NULL },
+ { "r29", &ddb_regs.r[29], FCN_NULL },
+ { "r30", &ddb_regs.r[30], FCN_NULL },
+ { "r31", &ddb_regs.r[31], FCN_NULL },
+ { "iar", &ddb_regs.iar, FCN_NULL },
+ { "msr", &ddb_regs.msr, FCN_NULL },
+ { "lr", &ddb_regs.lr, FCN_NULL },
+ { "ctr", &ddb_regs.ctr, FCN_NULL },
+ { "cr", &ddb_regs.cr, FCN_NULL },
+ { "xer", &ddb_regs.xer, FCN_NULL },
#ifdef PPC_IBM4XX
- { "dear", (long *)&ddb_regs.dear, FCN_NULL },
- { "esr", (long *)&ddb_regs.esr, FCN_NULL },
- { "pid", (long *)&ddb_regs.pid, FCN_NULL },
+ { "dear", &ddb_regs.dear, FCN_NULL },
+ { "esr", &ddb_regs.esr, FCN_NULL },
+ { "pid", &ddb_regs.pid, FCN_NULL },
#endif
};
struct db_variable *db_eregs = db_regs + sizeof (db_regs)/sizeof (db_regs[0]);
@@ -98,19 +99,15 @@ extern int end[];
/*
* Frame tracing.
*/
-void
-db_stack_trace_print(addr, have_addr, count, modif, pr)
- db_expr_t addr;
- int have_addr;
- db_expr_t count;
- char *modif;
- void (*pr) __P((const char *, ...));
+static void
+db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count,
+ char *modif, void (*pr)(const char *, ...))
{
db_addr_t frame, lr, caller, *args;
db_addr_t fakeframe[2];
db_expr_t diff;
- db_sym_t sym;
- char *symname;
+ c_db_sym_t sym;
+ const char *symname;
boolean_t kernel_only = TRUE;
boolean_t trace_thread = FALSE;
boolean_t full = FALSE;
diff --git a/sys/powerpc/powerpc/trap.c b/sys/powerpc/powerpc/trap.c
index d8d82e6..5469c2e 100644
--- a/sys/powerpc/powerpc/trap.c
+++ b/sys/powerpc/powerpc/trap.c
@@ -75,6 +75,8 @@ static const char rcsid[] =
#include <machine/spr.h>
#include <machine/sr.h>
+#include <ddb/ddb.h>
+
#ifndef MULTIPROCESSOR
extern int intr_depth;
#endif
@@ -280,7 +282,7 @@ trap_fatal(struct trapframe *frame)
printtrap(frame->exc, frame, 1, (frame->srr1 & PSL_PR));
#ifdef DDB
- if ((debugger_on_panic || db_active) && kdb_trap(frame->exc, 0, frame))
+ if ((debugger_on_panic || db_active) && kdb_trap(frame->exc, frame))
return;
#endif
panic("%s trap", trapname(frame->exc));
OpenPOWER on IntegriCloud