From 0e3bf4890906fa7066a5deafd6ab033934b8d100 Mon Sep 17 00:00:00 2001 From: Roman Kapl Date: Tue, 14 Aug 2018 18:09:51 +0200 Subject: ppc: add DBCR based debugging Add support for DBCR (debug control register) based debugging as used on BookE ppc. So far supports only branch and single-step events, but these are the important ones. GDB in Linux guest can now do single-stepping. Signed-off-by: Roman Kapl Signed-off-by: David Gibson --- target/ppc/excp_helper.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'target/ppc/excp_helper.c') diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index d6e97a9..0ec7ae1 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -348,19 +348,16 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp) case POWERPC_EXCP_ITLB: /* Instruction TLB error */ break; case POWERPC_EXCP_DEBUG: /* Debug interrupt */ - switch (excp_model) { - case POWERPC_EXCP_BOOKE: + if (env->flags & POWERPC_FLAG_DE) { /* FIXME: choose one or the other based on CPU type */ srr0 = SPR_BOOKE_DSRR0; srr1 = SPR_BOOKE_DSRR1; asrr0 = SPR_BOOKE_CSRR0; asrr1 = SPR_BOOKE_CSRR1; - break; - default: - break; + /* DBSR already modified by caller */ + } else { + cpu_abort(cs, "Debug exception triggered on unsupported model\n"); } - /* XXX: TODO */ - cpu_abort(cs, "Debug exception is not implemented yet !\n"); break; case POWERPC_EXCP_SPEU: /* SPE/embedded floating-point unavailable */ env->spr[SPR_BOOKE_ESR] = ESR_SPV; -- cgit v1.1