+/* When FRAME is at a syscall instruction (ECALL), return the PC of the next
+ instruction to be executed. */
+
+static CORE_ADDR
+riscv_linux_syscall_next_pc (struct frame_info *frame)
+{
+ const CORE_ADDR pc = get_frame_pc (frame);
+ const ULONGEST a7 = get_frame_register_unsigned (frame, RISCV_A7_REGNUM);
+
+ if (a7 == RISCV_NR_rt_sigreturn)
+ return frame_unwind_caller_pc (frame);
+
+ return pc + 4 /* Length of the ECALL insn. */;
+}
+