diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2020-01-09 15:18:59 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2020-01-09 15:18:59 +0000 |
commit | 9b36b4d43cd7adc0de1c044300bb2a4777388478 (patch) | |
tree | 3e79c424e2d2fa3983ba800d14dd730cdb79c03b /sys/ddb | |
parent | 2befe2c4f61368f80c6e7855e333cbb3d000b1d9 (diff) |
If the kernel panics due to SMEP or SMAP, print correct stack trace
and pass information to ddb. This helps to debug kernel NULL pointer
function calls.
input guenther@; OK kettenis@
Diffstat (limited to 'sys/ddb')
-rw-r--r-- | sys/ddb/db_examine.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/ddb/db_examine.c b/sys/ddb/db_examine.c index 12bcb29546e..ff708e0c0f9 100644 --- a/sys/ddb/db_examine.c +++ b/sys/ddb/db_examine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_examine.c,v 1.26 2019/11/07 13:16:25 mpi Exp $ */ +/* $OpenBSD: db_examine.c,v 1.27 2020/01/09 15:18:58 bluhm Exp $ */ /* $NetBSD: db_examine.c,v 1.11 1996/03/30 22:30:07 christos Exp $ */ /* @@ -288,8 +288,10 @@ void db_print_loc_and_inst(vaddr_t loc) { db_printsym(loc, DB_STGY_PROC, db_printf); - db_printf(":\t"); - (void) db_disasm(loc, 0); + if (loc != 0) { + db_printf(":\t"); + db_disasm(loc, 0); + } } /* local copy is needed here so that we can trace strlcpy() in libkern */ |