Fixed an issue when Ctrl+C(SIGINT) terminates debugging session instead of halting // Resolve #2733

This commit is contained in:
Ivan Kravets
2019-07-04 17:47:26 +03:00
parent d9b6842b6a
commit caf5159002
4 changed files with 23 additions and 1 deletions
+3
View File
@@ -15,6 +15,7 @@
import json
import os
import re
import signal
import time
from hashlib import sha1
from os.path import abspath, basename, dirname, isdir, join, splitext
@@ -188,6 +189,8 @@ class GDBClient(BaseProcess): # pylint: disable=too-many-instance-attributes
if b"-exec-continue" in data:
self._target_is_run = True
if b"-gdb-exit" in data or data.strip() in (b"q", b"quit"):
# Allow terminating via SIGINT/CTRL+C
signal.signal(signal.SIGINT, signal.default_int_handler)
self.transport.write(b"pio_reset_target\n")
self.transport.write(data)