Skip to content

Commit 6ef489f

Browse files
committed
Gdbserver: halt target after client connects instead of before.
This change ensures that the target is halted even if gdb disconnects and reconnects.
1 parent a4e6067 commit 6ef489f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pyocd/gdbserver/gdbserver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,6 @@ def _cleanup_for_next_connection(self):
311311

312312
def run(self):
313313
LOG.info('GDB server started on port %d (core %d)', self.port, self.core)
314-
315-
# Make sure the target is halted. Otherwise gdb gets easily confused.
316-
self.target.halt()
317314

318315
while True:
319316
try:
@@ -339,6 +336,9 @@ def run(self):
339336

340337
if self.detach_event.isSet():
341338
continue
339+
340+
# Make sure the target is halted. Otherwise gdb gets easily confused.
341+
self.target.halt()
342342

343343
LOG.info("Client connected to port %d!", self.port)
344344
self._run_connection()

0 commit comments

Comments
 (0)