dtrace: Fix RISC-V user stack unwinder
The unwind logic was copied from AArch64 which follows the peculiar AACPS (where, unlike typical RISC architectures, its frame pointer follows an x86/stack machine-like convention where the frame pointer points at the bottom of the frame record, not the top). Delete the pointless riscv_frame struct and fix this. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28054
This commit is contained in:
parent
06faad1de2
commit
3872010732
@ -150,9 +150,8 @@ dtrace_getustack_common(uint64_t *pcstack, int pcstack_limit, uintptr_t pc,
|
||||
if (fp == 0)
|
||||
break;
|
||||
|
||||
pc = dtrace_fuword64((void *)(fp +
|
||||
offsetof(struct riscv_frame, f_retaddr)));
|
||||
fp = dtrace_fuword64((void *)fp);
|
||||
pc = dtrace_fuword64((void *)(fp - 1 * sizeof(uint64_t)));
|
||||
fp = dtrace_fuword64((void *)(fp - 2 * sizeof(uint64_t)));
|
||||
|
||||
if (fp == oldfp) {
|
||||
*flags |= CPU_DTRACE_BADSTACK;
|
||||
|
@ -59,11 +59,6 @@ struct trapframe {
|
||||
uint64_t tf_scause;
|
||||
};
|
||||
|
||||
struct riscv_frame {
|
||||
struct riscv_frame *f_frame;
|
||||
u_long f_retaddr;
|
||||
};
|
||||
|
||||
/*
|
||||
* Signal frame. Pushed onto user stack before calling sigcode.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user