Clean up ddb warnings/errors and enable in GENERIC

Approved by: benno
Motivated by: gallatin
This commit is contained in:
grehan 2002-10-04 01:19:18 +00:00
parent 40bdd697c2
commit 93f545f536
8 changed files with 59 additions and 57 deletions

View File

@ -75,6 +75,8 @@ static const char rcsid[] =
#include <machine/spr.h> #include <machine/spr.h>
#include <machine/sr.h> #include <machine/sr.h>
#include <ddb/ddb.h>
#ifndef MULTIPROCESSOR #ifndef MULTIPROCESSOR
extern int intr_depth; extern int intr_depth;
#endif #endif
@ -280,7 +282,7 @@ trap_fatal(struct trapframe *frame)
printtrap(frame->exc, frame, 1, (frame->srr1 & PSL_PR)); printtrap(frame->exc, frame, 1, (frame->srr1 & PSL_PR));
#ifdef DDB #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; return;
#endif #endif
panic("%s trap", trapname(frame->exc)); panic("%s trap", trapname(frame->exc));

View File

@ -57,7 +57,7 @@ options SYSVSEM #SYSV-style semaphores
#options _KPOSIX_PRIORITY_SCHEDULING #options _KPOSIX_PRIORITY_SCHEDULING
# Debugging for use in -current # 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 INVARIANTS #Enable calls of extra sanity checking
options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS
options WITNESS #Enable checks to detect deadlocks and cycles options WITNESS #Enable checks to detect deadlocks and cycles

View File

@ -42,7 +42,7 @@
#define DB_ELFSIZE 32 #define DB_ELFSIZE 32
typedef vm_offset_t db_addr_t; /* address - unsigned */ 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 { struct powerpc_saved_state {
u_int32_t r[32]; /* data registers */ u_int32_t r[32]; /* data registers */
u_int32_t iar; u_int32_t iar;

View File

@ -717,8 +717,7 @@ disasm_fields(const struct opcode *popcode, instr_t instr, vm_offset_t loc,
LI = LI << 8; LI = LI << 8;
LI = LI >> 6; LI = LI >> 6;
LI += loc; LI += loc;
db_symstr(pstr, LI, DB_STGY_ANY); pstr += sprintf (pstr, "0x%x, ", LI);
pstr += strlen(pstr);
func &= ~Op_LI; func &= ~Op_LI;
} }
switch (func & Op_SIMM) { 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); pstr += sprintf(pstr, "0x%x", IMM);
break; break;
default: default:
break;
} }
if (func & Op_BD) { if (func & Op_BD) {
u_int BD; u_int BD;

View File

@ -9,6 +9,7 @@
#include <sys/param.h> #include <sys/param.h>
#include <sys/proc.h> #include <sys/proc.h>
#include <sys/systm.h> #include <sys/systm.h>
#include <sys/cons.h>
#include <machine/db_machdep.h> #include <machine/db_machdep.h>
#include <machine/frame.h> #include <machine/frame.h>

View File

@ -47,7 +47,7 @@
#include <machine/db_machdep.h> #include <machine/db_machdep.h>
#include <ddb/db_access.h> #include <ddb/ddb.h>
/* /*
* Read bytes from kernel address space for debugger. * Read bytes from kernel address space for debugger.

View File

@ -29,6 +29,7 @@
*/ */
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h> #include <sys/proc.h>
#include <sys/user.h> #include <sys/user.h>
@ -46,48 +47,48 @@
#include <ddb/db_variables.h> #include <ddb/db_variables.h>
struct db_variable db_regs[] = { struct db_variable db_regs[] = {
{ "r0", (long *)&ddb_regs.r[0], FCN_NULL }, { "r0", &ddb_regs.r[0], FCN_NULL },
{ "r1", (long *)&ddb_regs.r[1], FCN_NULL }, { "r1", &ddb_regs.r[1], FCN_NULL },
{ "r2", (long *)&ddb_regs.r[2], FCN_NULL }, { "r2", &ddb_regs.r[2], FCN_NULL },
{ "r3", (long *)&ddb_regs.r[3], FCN_NULL }, { "r3", &ddb_regs.r[3], FCN_NULL },
{ "r4", (long *)&ddb_regs.r[4], FCN_NULL }, { "r4", &ddb_regs.r[4], FCN_NULL },
{ "r5", (long *)&ddb_regs.r[5], FCN_NULL }, { "r5", &ddb_regs.r[5], FCN_NULL },
{ "r6", (long *)&ddb_regs.r[6], FCN_NULL }, { "r6", &ddb_regs.r[6], FCN_NULL },
{ "r7", (long *)&ddb_regs.r[7], FCN_NULL }, { "r7", &ddb_regs.r[7], FCN_NULL },
{ "r8", (long *)&ddb_regs.r[8], FCN_NULL }, { "r8", &ddb_regs.r[8], FCN_NULL },
{ "r9", (long *)&ddb_regs.r[9], FCN_NULL }, { "r9", &ddb_regs.r[9], FCN_NULL },
{ "r10", (long *)&ddb_regs.r[10], FCN_NULL }, { "r10", &ddb_regs.r[10], FCN_NULL },
{ "r11", (long *)&ddb_regs.r[11], FCN_NULL }, { "r11", &ddb_regs.r[11], FCN_NULL },
{ "r12", (long *)&ddb_regs.r[12], FCN_NULL }, { "r12", &ddb_regs.r[12], FCN_NULL },
{ "r13", (long *)&ddb_regs.r[13], FCN_NULL }, { "r13", &ddb_regs.r[13], FCN_NULL },
{ "r14", (long *)&ddb_regs.r[14], FCN_NULL }, { "r14", &ddb_regs.r[14], FCN_NULL },
{ "r15", (long *)&ddb_regs.r[15], FCN_NULL }, { "r15", &ddb_regs.r[15], FCN_NULL },
{ "r16", (long *)&ddb_regs.r[16], FCN_NULL }, { "r16", &ddb_regs.r[16], FCN_NULL },
{ "r17", (long *)&ddb_regs.r[17], FCN_NULL }, { "r17", &ddb_regs.r[17], FCN_NULL },
{ "r18", (long *)&ddb_regs.r[18], FCN_NULL }, { "r18", &ddb_regs.r[18], FCN_NULL },
{ "r19", (long *)&ddb_regs.r[19], FCN_NULL }, { "r19", &ddb_regs.r[19], FCN_NULL },
{ "r20", (long *)&ddb_regs.r[20], FCN_NULL }, { "r20", &ddb_regs.r[20], FCN_NULL },
{ "r21", (long *)&ddb_regs.r[21], FCN_NULL }, { "r21", &ddb_regs.r[21], FCN_NULL },
{ "r22", (long *)&ddb_regs.r[22], FCN_NULL }, { "r22", &ddb_regs.r[22], FCN_NULL },
{ "r23", (long *)&ddb_regs.r[23], FCN_NULL }, { "r23", &ddb_regs.r[23], FCN_NULL },
{ "r24", (long *)&ddb_regs.r[24], FCN_NULL }, { "r24", &ddb_regs.r[24], FCN_NULL },
{ "r25", (long *)&ddb_regs.r[25], FCN_NULL }, { "r25", &ddb_regs.r[25], FCN_NULL },
{ "r26", (long *)&ddb_regs.r[26], FCN_NULL }, { "r26", &ddb_regs.r[26], FCN_NULL },
{ "r27", (long *)&ddb_regs.r[27], FCN_NULL }, { "r27", &ddb_regs.r[27], FCN_NULL },
{ "r28", (long *)&ddb_regs.r[28], FCN_NULL }, { "r28", &ddb_regs.r[28], FCN_NULL },
{ "r29", (long *)&ddb_regs.r[29], FCN_NULL }, { "r29", &ddb_regs.r[29], FCN_NULL },
{ "r30", (long *)&ddb_regs.r[30], FCN_NULL }, { "r30", &ddb_regs.r[30], FCN_NULL },
{ "r31", (long *)&ddb_regs.r[31], FCN_NULL }, { "r31", &ddb_regs.r[31], FCN_NULL },
{ "iar", (long *)&ddb_regs.iar, FCN_NULL }, { "iar", &ddb_regs.iar, FCN_NULL },
{ "msr", (long *)&ddb_regs.msr, FCN_NULL }, { "msr", &ddb_regs.msr, FCN_NULL },
{ "lr", (long *)&ddb_regs.lr, FCN_NULL }, { "lr", &ddb_regs.lr, FCN_NULL },
{ "ctr", (long *)&ddb_regs.ctr, FCN_NULL }, { "ctr", &ddb_regs.ctr, FCN_NULL },
{ "cr", (long *)&ddb_regs.cr, FCN_NULL }, { "cr", &ddb_regs.cr, FCN_NULL },
{ "xer", (long *)&ddb_regs.xer, FCN_NULL }, { "xer", &ddb_regs.xer, FCN_NULL },
#ifdef PPC_IBM4XX #ifdef PPC_IBM4XX
{ "dear", (long *)&ddb_regs.dear, FCN_NULL }, { "dear", &ddb_regs.dear, FCN_NULL },
{ "esr", (long *)&ddb_regs.esr, FCN_NULL }, { "esr", &ddb_regs.esr, FCN_NULL },
{ "pid", (long *)&ddb_regs.pid, FCN_NULL }, { "pid", &ddb_regs.pid, FCN_NULL },
#endif #endif
}; };
struct db_variable *db_eregs = db_regs + sizeof (db_regs)/sizeof (db_regs[0]); struct db_variable *db_eregs = db_regs + sizeof (db_regs)/sizeof (db_regs[0]);
@ -98,19 +99,15 @@ extern int end[];
/* /*
* Frame tracing. * Frame tracing.
*/ */
void static void
db_stack_trace_print(addr, have_addr, count, modif, pr) db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count,
db_expr_t addr; char *modif, void (*pr)(const char *, ...))
int have_addr;
db_expr_t count;
char *modif;
void (*pr) __P((const char *, ...));
{ {
db_addr_t frame, lr, caller, *args; db_addr_t frame, lr, caller, *args;
db_addr_t fakeframe[2]; db_addr_t fakeframe[2];
db_expr_t diff; db_expr_t diff;
db_sym_t sym; c_db_sym_t sym;
char *symname; const char *symname;
boolean_t kernel_only = TRUE; boolean_t kernel_only = TRUE;
boolean_t trace_thread = FALSE; boolean_t trace_thread = FALSE;
boolean_t full = FALSE; boolean_t full = FALSE;

View File

@ -75,6 +75,8 @@ static const char rcsid[] =
#include <machine/spr.h> #include <machine/spr.h>
#include <machine/sr.h> #include <machine/sr.h>
#include <ddb/ddb.h>
#ifndef MULTIPROCESSOR #ifndef MULTIPROCESSOR
extern int intr_depth; extern int intr_depth;
#endif #endif
@ -280,7 +282,7 @@ trap_fatal(struct trapframe *frame)
printtrap(frame->exc, frame, 1, (frame->srr1 & PSL_PR)); printtrap(frame->exc, frame, 1, (frame->srr1 & PSL_PR));
#ifdef DDB #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; return;
#endif #endif
panic("%s trap", trapname(frame->exc)); panic("%s trap", trapname(frame->exc));