[Scope of application]
adviceXross, adviceLUNA II, adviceLUNA
[Question]
When I try to step the following instruction in assembler level, the step is not performed properly. It is stuck at that instruction. What should I do?
10 | 0x00000110 cmp r2, #&0
11 | 0x00000114 beq &114
[Answer]
You cannot perform step for the branch instruction which is branching to itself with step in assembler level (inst mode Step). This is a specification of ICE.
[Cause]
For example, at the line No. 11 of above instruction, it is a branch instruction with conditions. The branch destination is depending on the results of cmp instruction at line 10.
If the result is true, it branches to 0x114, and if it is false, it branches to 0x118. If you perform step the 0x114 with inst mode, it is stuck at line 11 even if the results of line 10 is false.
Debugger sets OCD break at branch destination by analyzing the instruction of current PC value when performing step with inst mode. OCD break occurs a break before executing the instruction. Therefore the break is occurred before the results of branch conditions are figured out.
As a result, the instruction is not executed regardless of the branch conditions, and only the break is hit. That is why it is stuck at the instruction.
[Workaround]
You can avoid this problem by executing “Go to” to go through the branch instruction.
In the disassemble window, right-click on the address of branch destination and select Execute to the target.