diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-11-01 18:03:51 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-11-01 18:03:51 +0000 |
commit | 1ba480fa0b8f1268e5c2c616e0cb5d249b30d1b2 (patch) | |
tree | fd66a89b91766b13cc865b71992917f1dac5462d | |
parent | e24fcba90ecba2ea118c82e44b76aa7fcd23b08a (diff) |
Fix an off-by-one in db_save_stack_trace().
Save the PC after checking if it belongs to the kernel.
-rw-r--r-- | sys/arch/sparc64/sparc64/db_trace.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/sparc64/sparc64/db_trace.c b/sys/arch/sparc64/sparc64/db_trace.c index fdbf0043a54..bf14be083b4 100644 --- a/sys/arch/sparc64/sparc64/db_trace.c +++ b/sys/arch/sparc64/sparc64/db_trace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_trace.c,v 1.16 2019/11/01 17:50:53 mpi Exp $ */ +/* $OpenBSD: db_trace.c,v 1.17 2019/11/01 18:03:50 mpi Exp $ */ /* $NetBSD: db_trace.c,v 1.23 2001/07/10 06:06:16 eeh Exp $ */ /* @@ -171,7 +171,6 @@ db_save_stack_trace(struct db_stack_trace *st) f64 = (struct frame64 *)(frame + BIAS); pc = (db_addr_t)KLOAD(f64->fr_pc); - st->st_pc[st->st_count++] = pc; frame = KLOAD(f64->fr_fp); if (pc < KERNBASE || pc >= KERNEND) @@ -180,6 +179,8 @@ db_save_stack_trace(struct db_stack_trace *st) break; if ((frame & 1) == 0) break; + + st->st_pc[st->st_count++] = pc; } } |