linux-user/ppc: deliver SIGTRAP on POWERPC_EXCP_TRAP

Handle POWERPC_EXCP_TRAP in cpu_loop to deliver SIGTRAP on tw[i]/td[i].
The si_code comes from do_program_check in the kernel source file
arch/powerpc/kernel/traps.c

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Message-Id: <20220113170456.1796911-2-matheus.ferst@eldorado.org.br>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
Matheus Ferst 2022-01-13 14:04:54 -03:00 committed by Laurent Vivier
parent 4ff17cf0aa
commit 083fe9a12d

View File

@ -181,7 +181,8 @@ void cpu_loop(CPUPPCState *env)
}
break;
case POWERPC_EXCP_TRAP:
cpu_abort(cs, "Tried to call a TRAP\n");
si_signo = TARGET_SIGTRAP;
si_code = TARGET_TRAP_BRKPT;
break;
default:
/* Should not happen ! */