Date: Wed, 1 Jul 2020 19:11:02 +0000 (UTC) From: Kristof Provost <kp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362851 - head/sys/riscv/riscv Message-ID: <202007011911.061JB29a029668@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kp Date: Wed Jul 1 19:11:02 2020 New Revision: 362851 URL: https://svnweb.freebsd.org/changeset/base/362851 Log: riscv: Log missing registers in dump_regs() If we panic we dump the registers for debugging. This is very useful, but it missed several registers (ra, sp, gp and tp). Log these as well. Especially the return address value is extremely useful. Sponsored by: Axiado Modified: head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Wed Jul 1 18:10:37 2020 (r362850) +++ head/sys/riscv/riscv/trap.c Wed Jul 1 19:11:02 2020 (r362851) @@ -147,6 +147,11 @@ dump_regs(struct trapframe *frame) for (i = 0; i < n; i++) printf("a[%d] == 0x%016lx\n", i, frame->tf_a[i]); + printf("ra == 0x%016lx\n", frame->tf_ra); + printf("sp == 0x%016lx\n", frame->tf_sp); + printf("gp == 0x%016lx\n", frame->tf_gp); + printf("tp == 0x%016lx\n", frame->tf_tp); + printf("sepc == 0x%016lx\n", frame->tf_sepc); printf("sstatus == 0x%016lx\n", frame->tf_sstatus); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007011911.061JB29a029668>