PPC: Fix for the gdb single step problem on an rfi instruction

When using gdb to single step a ppc interrupt routine, the execution
flow passes the rfi instruction without actually returning from the
interrupt.

The patch fixes this by avoiding to update the nip when the debug
exception is raised and a previous POWERPC_EXCP_SYNC was set.

The latter is the case only, if code for rfi or a related instruction
was generated.

Signed-off-by: Sebastian Bauer <mail@sebastianbauer.info>
Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
Sebastian Bauer 2011-08-10 01:41:48 +00:00 committed by Alexander Graf
parent 9df3b45dd4
commit ee2b399463
1 changed files with 3 additions and 1 deletions

View File

@ -298,8 +298,10 @@ static inline void gen_debug_exception(DisasContext *ctx)
{
TCGv_i32 t0;
if (ctx->exception != POWERPC_EXCP_BRANCH)
if ((ctx->exception != POWERPC_EXCP_BRANCH) &&
(ctx->exception != POWERPC_EXCP_SYNC)) {
gen_update_nip(ctx, ctx->nip);
}
t0 = tcg_const_i32(EXCP_DEBUG);
gen_helper_raise_exception(t0);
tcg_temp_free_i32(t0);