summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-02-22 19:19:33 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-02-22 19:19:33 +0000
commit8587f314348ce0067933e1207bbd0d1c15e33830 (patch)
treee2b6907021853a0db93493ae57f8c9867a65c7da /usr.bin
parent73032fcd052b774b91d07262a83ecfacd6f61de5 (diff)
include a siginfo_t with ktrace PSIG information, so that kdump can print
fault addresses and other information. (a small bug exists: in some signal delivery cases, two PSIG records may be inserted, because postsig() is unaware a PSIG record has already been placed. but this small bug can stay since the siginfo_t information helps us find and fix other bugs)
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/kdump/kdump.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index c212e649b72..b24e26e9022 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kdump.c,v 1.13 2002/02/16 21:27:47 millert Exp $ */
+/* $OpenBSD: kdump.c,v 1.14 2002/02/22 19:19:32 deraadt Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
#endif
-static char *rcsid = "$OpenBSD: kdump.c,v 1.13 2002/02/16 21:27:47 millert Exp $";
+static char *rcsid = "$OpenBSD: kdump.c,v 1.14 2002/02/22 19:19:32 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -521,10 +521,22 @@ ktrpsig(psig)
{
(void)printf("SIG%s ", sys_signame[psig->signo]);
if (psig->action == SIG_DFL)
- (void)printf("SIG_DFL\n");
+ (void)printf("SIG_DFL code %d", psig->code);
else
- (void)printf("caught handler=0x%lx mask=0x%x code=0x%x\n",
- (u_long)psig->action, psig->mask, psig->code);
+ (void)printf("caught handler=0x%lx mask=0x%x",
+ (u_long)psig->action, psig->mask);
+ switch (psig->signo) {
+ case SIGSEGV:
+ case SIGILL:
+ case SIGBUS:
+ case SIGFPE:
+ printf(" addr=%p trapno=%d", psig->si.si_addr,
+ psig->si.si_trapno);
+ break;
+ default:
+ break;
+ }
+ printf("\n");
}
static void