diff --git a/pyocd/subcommands/gdbserver_cmd.py b/pyocd/subcommands/gdbserver_cmd.py index 2ce8a8d63..167d5004b 100644 --- a/pyocd/subcommands/gdbserver_cmd.py +++ b/pyocd/subcommands/gdbserver_cmd.py @@ -20,6 +20,7 @@ import logging import sys import os +import signal from time import sleep from .base import SubcommandBase @@ -135,6 +136,9 @@ def invoke(self) -> int: """@brief Handle 'gdbserver' subcommand.""" self._process_commands(self._args.commands) + # redirect SIGTERM issued e.g. by Eclipse debug plugin into a SIGINT + signal.signal(signal.SIGTERM, lambda x, y: signal.raise_signal(signal.SIGINT)) + probe_server = None gdbs = [] try: