mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-07-07 17:00:35 +00:00
arm: Factor out "generate right kind of step exception"
We currently have two places that do: if (dc->ss_active) { gen_step_complete_exception(dc); } else { gen_exception_internal(EXCP_DEBUG); } Factor this out into its own function, as we're about to add a third place that needs the same logic. Backports commit 5425415ebba5fa20558e1ef25e1997a6f5ea4c7c from qemu
This commit is contained in:
parent
ddfe550411
commit
23141d7620
|
@ -290,6 +290,19 @@ static void gen_step_complete_exception(DisasContext *s)
|
||||||
s->is_jmp = DISAS_EXC;
|
s->is_jmp = DISAS_EXC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void gen_singlestep_exception(DisasContext *s)
|
||||||
|
{
|
||||||
|
/* Generate the right kind of exception for singlestep, which is
|
||||||
|
* either the architectural singlestep or EXCP_DEBUG for QEMU's
|
||||||
|
* gdb singlestepping.
|
||||||
|
*/
|
||||||
|
if (s->ss_active) {
|
||||||
|
gen_step_complete_exception(s);
|
||||||
|
} else {
|
||||||
|
gen_exception_internal(s, EXCP_DEBUG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void gen_smul_dual(DisasContext *s, TCGv_i32 a, TCGv_i32 b)
|
static void gen_smul_dual(DisasContext *s, TCGv_i32 a, TCGv_i32 b)
|
||||||
{
|
{
|
||||||
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
||||||
|
@ -12222,24 +12235,15 @@ tb_end:
|
||||||
gen_set_pc_im(dc, dc->pc);
|
gen_set_pc_im(dc, dc->pc);
|
||||||
/* fall through */
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
if (dc->ss_active) {
|
/* FIXME: Single stepping a WFI insn will not halt the CPU. */
|
||||||
gen_step_complete_exception(dc);
|
gen_singlestep_exception(dc);
|
||||||
} else {
|
|
||||||
/* FIXME: Single stepping a WFI insn will not halt
|
|
||||||
the CPU. */
|
|
||||||
gen_exception_internal(dc, EXCP_DEBUG);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (dc->condjmp) {
|
if (dc->condjmp) {
|
||||||
/* "Condition failed" instruction codepath. */
|
/* "Condition failed" instruction codepath. */
|
||||||
gen_set_label(tcg_ctx, dc->condlabel);
|
gen_set_label(tcg_ctx, dc->condlabel);
|
||||||
gen_set_condexec(dc);
|
gen_set_condexec(dc);
|
||||||
gen_set_pc_im(dc, dc->pc);
|
gen_set_pc_im(dc, dc->pc);
|
||||||
if (dc->ss_active) {
|
gen_singlestep_exception(dc);
|
||||||
gen_step_complete_exception(dc);
|
|
||||||
} else {
|
|
||||||
gen_exception_internal(dc, EXCP_DEBUG);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* While branches must always occur at the end of an IT block,
|
/* While branches must always occur at the end of an IT block,
|
||||||
|
|
Loading…
Reference in a new issue