arch/riscv/ricv_exception.c: Dump the process name at exception in user space

This helps in debugging loaded elf files in CONFIG_BUILD_KERNEL. If a user space exception occurs,
one would beed the process name in order to debug the correct process/elf file.

Only dumping the pid and name of the crashed task/thread doesn't help, since different processes
may have helper threads with the same name.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This commit is contained in:
Jukka Laitinen
2025-06-13 12:58:57 +03:00
committed by Xiang Xiao
parent a5f43aa8e8
commit 5aa45e328e
+3 -1
View File
@@ -106,7 +106,9 @@ int riscv_exception(int mcause, void *regs, void *args)
if (((tcb->flags & TCB_FLAG_TTYPE_MASK) != TCB_FLAG_TTYPE_KERNEL) &&
((tcb->flags & TCB_FLAG_SYSCALL) == false))
{
_alert("Segmentation fault in PID %d: %s\n",
struct tcb_s *ptcb = nxsched_get_tcb(tcb->group->tg_pid);
_alert("Segmentation fault in %s (PID %d: %s)\n", get_task_name(ptcb),
tcb->pid, get_task_name(tcb));
tcb->flags |= TCB_FLAG_FORCED_CANCEL;