diff --git a/CHANGELOG.md b/CHANGELOG.md index 49747b7..6dea7a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,8 @@ Versioning]. - solve the problem of failed parsing of containers ([@henryriley0]) - Fixes #421 - Added `registerLimit` option to specify the registers to display - PR #444 ([@chenzhiy2001]) +- resolve the issue of not being able to set the GDB binary with a path on + Windows - PR #448 ([@henryriley0]) ## [0.27.0] - 2024-02-07 diff --git a/src/mibase.ts b/src/mibase.ts index ef2b83e..eb22088 100644 --- a/src/mibase.ts +++ b/src/mibase.ts @@ -96,9 +96,15 @@ export class MI2DebugSession extends DebugSession { // verifies that the specified command can be executed protected checkCommand(debuggerName: string): boolean { try { - const command = process.platform === 'win32' ? 'where' : 'command -v'; - execSync(`${command} ${debuggerName}`, { stdio: 'ignore' }); - return true; + if (process.platform === 'win32' && debuggerName.includes("\\")) { + // For Windows paths containing backslashes, check if the file exists directly + return fs.existsSync(debuggerName); + } + else { + const command = process.platform === 'win32' ? 'where' : 'command -v'; + execSync(`${command} ${debuggerName}`, { stdio: 'ignore' }); + return true; + } } catch (error) { return false; }