try:
subprocess.call("gdb", shell=True)
except KeyboardInterrupt:
print("get SIGINT")
print("ended gdb and moving to the next")
I run subprocess 'gdb' on python. on gdb by subprocess, after setting breakpoint, I run 'continue' then gdb is running until breakpoint hits.
in this status, if ctrl-c(SIGINT), then gdb will be stopped from 'continue' and give (gdb). however since python also receives ctrl-c, the gdb by subprocess.call is abnormally aborted I would like to know how to,
- python ignores ctrl-c (i.e. let gdb keep running)
- only gdb receives ctrl-c
- hence if gdb quits properly, then python resumes its code, e.g. printing "ended gdb and moving to the next"