Skip to content

Instantly share code, notes, and snippets.

@savanovich
Last active August 29, 2015 14:26
Show Gist options
  • Save savanovich/c89e0bc3ebfd350c3a1c to your computer and use it in GitHub Desktop.
Save savanovich/c89e0bc3ebfd350c3a1c to your computer and use it in GitHub Desktop.
Sends SIGTRAP signal and stops gdb
"""
$ gdb --args ./python /home/user/src/python/stop_gdb.py
(gdb) run
"""
import os
import signal
signal.signal(signal.SIGTRAP, lambda *args, **kwargs: None)
stop = lambda: os.kill(os.getpid(), signal.SIGTRAP)
stop()
def gen(): yield
gen()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment