Quantcast
Channel: Python extension for WinDbg
Viewing all articles
Browse latest Browse all 1625

New Post: How to detachProcess gracefully

$
0
0
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.
def signal_handler(signal, frame):
    print("You pressed Ctrl C!")
    pykd.detachProcess()
    sys.exit(0)

Viewing all articles
Browse latest Browse all 1625

Trending Articles