From 2869f942a461410004199b4018849f0505766e2f Mon Sep 17 00:00:00 2001 From: xuhong Date: Fri, 31 May 2024 11:09:26 +0800 Subject: [PATCH] 1.fix gdb check error --- src/gdb.ts | 4 ++-- src/lldb.ts | 4 ++-- src/mago.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gdb.ts b/src/gdb.ts index 843fca25..ecc6c3ce 100644 --- a/src/gdb.ts +++ b/src/gdb.ts @@ -55,7 +55,7 @@ class GDBDebugSession extends MI2DebugSession { protected override launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void { const dbgCommand = args.gdbpath || "gdb"; - if (this.checkCommand(dbgCommand)) { + if (!this.checkCommand(dbgCommand)) { this.sendErrorResponse(response, 104, `Configured debugger ${dbgCommand} not found.`); return; } @@ -101,7 +101,7 @@ class GDBDebugSession extends MI2DebugSession { protected override attachRequest(response: DebugProtocol.AttachResponse, args: AttachRequestArguments): void { const dbgCommand = args.gdbpath || "gdb"; - if (this.checkCommand(dbgCommand)) { + if (!this.checkCommand(dbgCommand)) { this.sendErrorResponse(response, 104, `Configured debugger ${dbgCommand} not found.`); return; } diff --git a/src/lldb.ts b/src/lldb.ts index 718af1e5..5db0bbea 100644 --- a/src/lldb.ts +++ b/src/lldb.ts @@ -49,7 +49,7 @@ class LLDBDebugSession extends MI2DebugSession { protected override launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void { const dbgCommand = args.lldbmipath || "lldb-mi"; - if (this.checkCommand(dbgCommand)) { + if (!this.checkCommand(dbgCommand)) { this.sendErrorResponse(response, 104, `Configured debugger ${dbgCommand} not found.`); return; } @@ -95,7 +95,7 @@ class LLDBDebugSession extends MI2DebugSession { protected override attachRequest(response: DebugProtocol.AttachResponse, args: AttachRequestArguments): void { const dbgCommand = args.lldbmipath || "lldb-mi"; - if (this.checkCommand(dbgCommand)) { + if (!this.checkCommand(dbgCommand)) { this.sendErrorResponse(response, 104, `Configured debugger ${dbgCommand} not found.`); return; } diff --git a/src/mago.ts b/src/mago.ts index 411797da..df53e6df 100644 --- a/src/mago.ts +++ b/src/mago.ts @@ -51,7 +51,7 @@ class MagoDebugSession extends MI2DebugSession { protected override launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void { const dbgCommand = args.magomipath || "mago-mi"; - if (this.checkCommand(dbgCommand)) { + if (!this.checkCommand(dbgCommand)) { this.sendErrorResponse(response, 104, `Configured debugger ${dbgCommand} not found.`); return; } @@ -75,7 +75,7 @@ class MagoDebugSession extends MI2DebugSession { protected override attachRequest(response: DebugProtocol.AttachResponse, args: AttachRequestArguments): void { const dbgCommand = args.magomipath || "mago-mi"; - if (this.checkCommand(dbgCommand)) { + if (!this.checkCommand(dbgCommand)) { this.sendErrorResponse(response, 104, `Configured debugger ${dbgCommand} not found.`); return; }