From 6a330c2b26113258f560aa6b8b77e00c65da90b1 Mon Sep 17 00:00:00 2001 From: thegecko Date: Sat, 17 Oct 2020 14:10:46 +0100 Subject: [PATCH] Add guard against decrementing port number --- src/pyocd-server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyocd-server.ts b/src/pyocd-server.ts index 532f3f5..c645bc8 100644 --- a/src/pyocd-server.ts +++ b/src/pyocd-server.ts @@ -36,7 +36,7 @@ export class PyocdServer extends AbstractServer { protected progress = 0; public resolveGdbPort(port: number): number { - if (this.args.gdbCore) { + if (this.args.gdbCore && this.args.gdbCore > 0) { // PyOCD starts each core on a subsequent port // (e.g. core 0 on starting port, core 1 on starting port +1, etc.) port += this.args.gdbCore;