Hi, The current displaced stepping doesn't consider the case that we set a breakpoint on syscall insn, which will cause fork/vfork, and single step over it with displaced stepping. In this case, syscall insn is executed in scratch pad, and GDB will receive TARGET_WAITKIND_FORKED and TARGET_WAITKIND_VFORKED before it cleans up displaced stepping state. The other problem, in this case, is that the PC of child process points to the scratch pad instead of original program location. This patch is to address these two problems. When GDB receives TARGET_WAITKIND_FORKED or TARGET_WAITKIND_VFORKED, it will check whether it has been in displaced stepping. If it is, that means GDB executed a syscall insn in scratch pad, then, we should cleanup the displaced stepping state, such as clean up scratch pad, and set the PC of child process to the original location. -- Yao (齐尧)