Skip to content

Commit

Permalink
ARM: fix single-step of Thumb unconditional branch
Browse files Browse the repository at this point in the history
Only type 1 branch instruction has a condition code, not type 2.
Currently they're both tagged with ARM_B which doesn't allow for the
distinction.

Signed-off-by: Nicolas Pitre <[email protected]>
Signed-off-by: David Brownell <[email protected]>
  • Loading branch information
npitre authored and David Brownell committed Oct 28, 2009
1 parent 39dd68b commit 76afa93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/target/arm_simulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ int arm_simulate_step_core(target_t *target, uint32_t *dry_run_pc, struct arm_si
return retval;
instruction_size = 2;

/* check condition code (only for branch instructions) */
if (instruction.type == ARM_B &&
/* check condition code (only for branch (1) instructions) */
if ((opcode & 0xf000) == 0xd000 &&
!thumb_pass_branch_condition(sim->get_cpsr(sim, 0, 32), opcode))
{
if (dry_run_pc)
Expand Down

0 comments on commit 76afa93

Please sign in to comment.