From 5e9abd8c21966ddede380f45205c712b410efe3b Mon Sep 17 00:00:00 2001 From: oltolm Date: Thu, 7 Mar 2024 23:37:01 +0100 Subject: [PATCH] fix problems found in review --- src/backend/mi2/mi2.ts | 6 +++--- src/mibase.ts | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/backend/mi2/mi2.ts b/src/backend/mi2/mi2.ts index fe55b09a..9980557a 100644 --- a/src/backend/mi2/mi2.ts +++ b/src/backend/mi2/mi2.ts @@ -315,7 +315,7 @@ export class MI2 extends EventEmitter implements IBackend { } onOutputStderr(str: string) { - let lines = str.split('\n'); + const lines = str.split('\n'); lines.forEach(line => { this.log("stderr", line); }); @@ -330,7 +330,7 @@ export class MI2 extends EventEmitter implements IBackend { } onOutput(str: string) { - let lines = str.split('\n'); + const lines = str.split('\n'); lines.forEach(line => { if (couldBeOutput(line)) { if (!gdbMatch.exec(line)) @@ -835,7 +835,7 @@ export class MI2 extends EventEmitter implements IBackend { this.log("stderr", "varCreate"); let miCommand = "var-create "; if (threadId != 0) { - miCommand += `--thread ${threadId} --frame ${frameLevel}` + miCommand += `--thread ${threadId} --frame ${frameLevel}`; } const res = await this.sendCommand(`${miCommand} ${this.quote(name)} ${frame} "${expression}"`); return new VariableObject(res.result("")); diff --git a/src/mibase.ts b/src/mibase.ts index 9a273e8a..159574bf 100644 --- a/src/mibase.ts +++ b/src/mibase.ts @@ -285,7 +285,8 @@ export class MI2DebugSession extends DebugSession { this.sendResponse(response); }).catch((error: MIError) => { if (error.message === 'Selected thread is running.') { - console.error(error); + console.error(error.message); + this.sendResponse(response); return; } this.sendErrorResponse(response, 17, `Could not get threads: ${error}`);