This will be the issue for adding a ptrace based Linux debugger. I have previously done this, and it proved to be a bit more difficult to keep clean than the QEMU debugger I wrote. ptrace() has some drawbacks: the main one that I could not solve was that it has no way to access branch prediction without manual disassembly and predicting off the instruction (i.e. it disables the Last Branch Records).
This will be the issue for adding a ptrace based Linux debugger. I have previously done this, and it proved to be a bit more difficult to keep clean than the QEMU debugger I wrote. ptrace() has some drawbacks: the main one that I could not solve was that it has no way to access branch prediction without manual disassembly and predicting off the instruction (i.e. it disables the Last Branch Records).