Skip to content

Commit b8be45a

Browse files
committed
Resolve the issue of not being able to set the GDB binary with a path on Windows.
1 parent bb22e7a commit b8be45a

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Versioning].
2424
- solve the problem of failed parsing of containers ([@henryriley0])
2525
- Fixes #421 - Added `registerLimit` option to specify the registers to
2626
display - PR #444 ([@chenzhiy2001])
27+
- resolve the issue of not being able to set the GDB binary with a path on Windows - PR #448
28+
([@henryriley0])
2729

2830
## [0.27.0] - 2024-02-07
2931

src/mibase.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,16 @@ export class MI2DebugSession extends DebugSession {
9696
// verifies that the specified command can be executed
9797
protected checkCommand(debuggerName: string): boolean {
9898
try {
99-
const command = process.platform === 'win32' ? 'where' : 'command -v';
100-
execSync(`${command} ${debuggerName}`, { stdio: 'ignore' });
101-
return true;
99+
if (process.platform === 'win32' && debuggerName.includes("\\")) {
100+
const command = 'dir';
101+
execSync(`${command} ${debuggerName}`, { stdio: 'ignore' });
102+
return true;
103+
}
104+
else {
105+
const command = process.platform === 'win32' ? 'where' : 'command -v';
106+
execSync(`${command} ${debuggerName}`, { stdio: 'ignore' });
107+
return true;
108+
}
102109
} catch (error) {
103110
return false;
104111
}

0 commit comments

Comments
 (0)