Why Single Stepping Instruction on X86?

后端 未结 5 1960
太阳男子
太阳男子 2021-01-01 00:03

So there is \"int 3\" which is an interrupt instruction used for breakpoints in debuggers.

But then there is also \"int 1\" which is used for single stepping. But wh

5条回答
  •  醉梦人生
    2021-01-01 00:24

    int 3 is used to set a breakpoint so that the code can execute freely until a particular point (the breakpoint) is reached. this speeds up the debugging process so it is not necessary to trap through known good code.

    int 1 is used to unconditionally halt after every instruction. this can be handy when conditional branch instructions are executed and the condition of the status flags is not known. otherwise, a breakpoint would need to be set at branch address and the address of the instruction following the branch.

    int 1 is can also be used at board bring-up when both the board hardware and the bring-up are new and untested.

提交回复
热议问题