Enhance db_trace to understand syscalls and print the syscall number
that the user requested. For example: 0xd5c56f40: SC trap #240 by 0x15668c60: srr1=0xd032 r1=0xffffe470 cr=0x44000045 xer=0 ctr=0xeff27ab8
This commit is contained in:
parent
a678ebca13
commit
554b4aa05f
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: trap_subr.S,v 1.7 2003/02/02 20:43:23 matt Exp $ */
|
||||
/* $NetBSD: trap_subr.S,v 1.8 2003/07/09 22:51:50 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001 Wasabi Systems, Inc.
|
||||
|
@ -340,7 +340,7 @@ _C_LABEL(trapexit):
|
|||
|
||||
|
||||
|
||||
.globl _C_LABEL(sctrap),_C_LABEL(scsize)
|
||||
.globl _C_LABEL(sctrap),_C_LABEL(scsize),_C_LABEL(sctrapexit)
|
||||
_C_LABEL(sctrap):
|
||||
STANDARD_PROLOG(tempsave);
|
||||
bla s_sctrap
|
||||
|
@ -358,6 +358,7 @@ s_sctrap:
|
|||
lwz 4,P_MD_SYSCALL(4)
|
||||
mtctr 4
|
||||
bctrl
|
||||
_C_LABEL(sctrapexit):
|
||||
/* Disable interrupts: */
|
||||
wrteei 0
|
||||
/* Test AST pending: */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: db_trace.c,v 1.28 2003/04/02 02:47:19 thorpej Exp $ */
|
||||
/* $NetBSD: db_trace.c,v 1.29 2003/07/09 22:51:51 matt Exp $ */
|
||||
/* $OpenBSD: db_trace.c,v 1.3 1997/03/21 02:10:48 niklas Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -111,7 +111,7 @@ db_stack_trace_print(addr, have_addr, count, modif, pr)
|
|||
char *symname;
|
||||
boolean_t kernel_only = TRUE;
|
||||
boolean_t trace_thread = FALSE;
|
||||
extern int trapexit[];
|
||||
extern int trapexit[], sctrapexit[];
|
||||
#ifdef PPC_OEA
|
||||
extern int end[];
|
||||
#endif
|
||||
|
@ -194,9 +194,14 @@ db_stack_trace_print(addr, have_addr, count, modif, pr)
|
|||
} else {
|
||||
(*pr)(" <?> : ");
|
||||
}
|
||||
if (caller + 4 == (db_addr_t) &trapexit) {
|
||||
if (caller + 4 == (db_addr_t) trapexit ||
|
||||
caller + 4 == (db_addr_t) sctrapexit) {
|
||||
const char *trapstr;
|
||||
struct trapframe *tf = (struct trapframe *) (frame+8);
|
||||
if (caller + 4 == (db_addr_t) sctrapexit) {
|
||||
(*pr)("SC trap #%d by ", tf->fixreg[0]);
|
||||
goto print_trap;
|
||||
}
|
||||
(*pr)("%s ", tf->srr1 & PSL_PR ? "user" : "kernel");
|
||||
switch (tf->exc) {
|
||||
case EXC_DSI:
|
||||
|
@ -275,6 +280,8 @@ db_stack_trace_print(addr, have_addr, count, modif, pr)
|
|||
frame = (db_addr_t) fakeframe;
|
||||
if (kernel_only && (tf->srr1 & PSL_PR))
|
||||
break;
|
||||
if (tf->exc == EXC_SC)
|
||||
break;
|
||||
goto next_frame;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: trap_subr.S,v 1.38 2003/04/29 15:16:14 scw Exp $ */
|
||||
/* $NetBSD: trap_subr.S,v 1.39 2003/07/09 22:51:51 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||
|
@ -740,7 +740,7 @@ trapexit:
|
|||
* Trap handler for syscalls (EXC_SC)
|
||||
*/
|
||||
/* LINTSTUB: Var: int sctrap[1], scsize[1]; */
|
||||
.globl _C_LABEL(sctrap),_C_LABEL(scsize)
|
||||
.globl _C_LABEL(sctrap),_C_LABEL(scsize),_C_LABEL(sctrapexit)
|
||||
_C_LABEL(sctrap):
|
||||
mtsprg 1,1 /* save SP */
|
||||
GET_CPUINFO(1)
|
||||
|
@ -770,6 +770,7 @@ s_sctrap:
|
|||
lwz 4,P_MD_SYSCALL(4)
|
||||
mtctr 4
|
||||
bctrl
|
||||
_C_LABEL(sctrapexit):
|
||||
/* Disable interrupts: */
|
||||
mfmsr 3
|
||||
andi. 3,3,~PSL_EE@l
|
||||
|
|
Loading…
Reference in New Issue