0
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,

  1. python ignores ctrl-c (i.e. let gdb keep running)
  2. only gdb receives ctrl-c
  3. hence if gdb quits properly, then python resumes its code, e.g. printing "ended gdb and moving to the next"
Shawn
  • 1

0 Answers0