• Nathan Froyd's avatar
    target-mips: fix single-stepping · 7b270ef2
    Nathan Froyd authored
    Single-stepping branches on MIPS didn't work right, because the
    generation of EXCP_DEBUG happened after the generation of the code to
    exit the current TB.  That is, given the code:
        bne v0,v1,target
        addu v0,v0,v1
    when you single-stepped through the NOP, execution wouldn't actually
    halt until you reached the label `1'.
    This patch corrects that and also changes single-stepping so that a
    branch and its delay slot are executed as one instruction for the
    purposes of single-stepping.  This behavior is comparable to what other
    MIPS tools (e.g. MIPSsim with MDI) do.  GDB avoids placing breakpoints
    in branch delay slots, so this change doesn't break anything on the GDB
    Signed-off-by: default avatarNathan Froyd <froydnj@codesourcery.com>
    Signed-off-by: default avatarAurelien Jarno <aurelien@aurel32.net>