[PowerPC] add machdep.uprintf_signal sysctl
Add support for sysctl 'machdep.uprintf_signal' that prints debugging information on trap signal. Reviewed by: jhibbits, luporl, bdragon Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D26004
This commit is contained in:
parent
8e82f10172
commit
9470013f5a
@ -153,6 +153,11 @@ static struct powerpc_exception powerpc_exceptions[] = {
|
||||
{ EXC_LAST, NULL }
|
||||
};
|
||||
|
||||
static int uprintf_signal;
|
||||
SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RWTUN,
|
||||
&uprintf_signal, 0,
|
||||
"Print debugging information on trap signal to ctty");
|
||||
|
||||
#define ESR_BITMASK \
|
||||
"\20" \
|
||||
"\040b0\037b1\036b2\035b3\034PIL\033PRR\032PTR\031FP" \
|
||||
@ -489,6 +494,14 @@ trap(struct trapframe *frame)
|
||||
ksi.ksi_code = (int) ucode; /* XXX, not POSIX */
|
||||
ksi.ksi_addr = (void *)addr;
|
||||
ksi.ksi_trapno = type;
|
||||
if (uprintf_signal) {
|
||||
uprintf("pid %d comm %s: signal %d code %d type %d "
|
||||
"addr 0x%lx r1 0x%lx srr0 0x%lx srr1 0x%lx\n",
|
||||
p->p_pid, p->p_comm, sig, ucode, type,
|
||||
(u_long)addr, (u_long)frame->fixreg[1],
|
||||
(u_long)frame->srr0, (u_long)frame->srr1);
|
||||
}
|
||||
|
||||
trapsignal(td, &ksi);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user