Skip to content

Commit 401d4ce

Browse files
authored
gdbserver: change kill behavior — no target reset, preserve connection in extended-remote (#1837)
1 parent e18519e commit 401d4ce

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

pyocd/gdbserver/gdbserver.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ def detach(self, client, data):
646646
if client.is_extended_remote:
647647
self.notify_client_detached(client)
648648
else:
649-
# In normal mode, we close the connection and stop the client thread.
649+
# In normal mode, close the connection and stop the client thread
650650
client.stop()
651651
except Exception as e:
652652
LOG.error("Command: Detach: Error = %s", e, exc_info=self.session.log_tracebacks)
@@ -655,14 +655,12 @@ def detach(self, client, data):
655655

656656
def kill(self, client):
657657
LOG.debug("Command: Kill")
658-
try:
659-
client.stop()
660-
except Exception as e:
661-
LOG.error("Command: Kill: Error stopping client: %s", e, exc_info=self.session.log_tracebacks)
662-
try:
663-
self.target.reset()
664-
except Exception as e:
665-
LOG.error("Command: Kill: Error resetting target: %s", e, exc_info=self.session.log_tracebacks)
658+
if not client.is_extended_remote:
659+
# In normal mode, close the connection and stop the client thread
660+
try:
661+
client.stop()
662+
except Exception as e:
663+
LOG.error("Command: Kill: Error stopping client: %s", e, exc_info=self.session.log_tracebacks)
666664
# No reply for 'k' command.
667665

668666
def restart(self, client, data):

0 commit comments

Comments
 (0)