diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2022-01-21 16:39:57 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2022-01-21 16:39:57 +0000 |
commit | 99b48866b7de080a2f647126a0a582f7138fd1e5 (patch) | |
tree | e9b088953af621297c4210cf0931992151b16340 /sys/arch | |
parent | 948e6b7d179561f7f7a2fb75f5e2eaaee9e7d39d (diff) |
Limit unwinder symbol search to FUNC symbols
The prolog scanning has to locate the start of the subroutine, not some
local symbol in the middle.
This should reduce cases where unwinding goes astray.
OK miod@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/mips64/mips64/trap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c index 857f9fed7c6..1470522844f 100644 --- a/sys/arch/mips64/mips64/trap.c +++ b/sys/arch/mips64/mips64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.156 2021/12/09 00:26:11 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.157 2022/01/21 16:39:56 visa Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -1207,13 +1207,13 @@ loop: * Dig out the function from the symbol table. * Watch out for function tail optimizations. */ - sym = db_search_symbol(pc, DB_STGY_ANY, &diff); + sym = db_search_symbol(pc, DB_STGY_PROC, &diff); if (sym != NULL && diff == 0) { instr = kdbpeek(pc - 2 * sizeof(int)); i.word = instr; if (i.JType.op == OP_JAL) { sym = db_search_symbol(pc - sizeof(int), - DB_STGY_ANY, &diff); + DB_STGY_PROC, &diff); if (sym != NULL && diff != 0) diff += sizeof(int); } @@ -1407,7 +1407,7 @@ stacktrace_save_at(struct stacktrace *st, unsigned int skip) first = 0; /* Determine the start address of the current subroutine. */ - sym = db_search_symbol(pc, DB_STGY_ANY, &diff); + sym = db_search_symbol(pc, DB_STGY_PROC, &diff); if (sym == NULL) break; db_symbol_values(sym, &name, NULL); |