From 08dce9308932600b41b859a66d6c2a5a3021182c Mon Sep 17 00:00:00 2001 From: Hardy Griech Date: Wed, 10 Dec 2025 18:25:35 +0100 Subject: [PATCH] fix Eclipse debug plugin exit by redirecting SIGTERM to SIGINT --- pyocd/subcommands/gdbserver_cmd.py | 4 ++++ 1 file changed, 4 insertions(+) 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: