If the code is simple enough without calling pykd.go(), The two methods attachProcess and detachProcess work perfectly well.
If I add a callback based on pykd.eventHandler and run the method pykd.go, I don't know how to detachProcess gracefully.
I want to press CTRL+C to detach the debugger from debuggee. But calling pydk.detachProcess() will fail, the debuggee will be closed as well.
If I add a callback based on pykd.eventHandler and run the method pykd.go, I don't know how to detachProcess gracefully.
I want to press CTRL+C to detach the debugger from debuggee. But calling pydk.detachProcess() will fail, the debuggee will be closed as well.
def signal_handler(signal, frame):
print("You pressed Ctrl C!")
pykd.detachProcess()
sys.exit(0)