Skip to content

Commit

Permalink
Resolve the issue of not being able to set the GDB path on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryRiley0 committed Sep 25, 2024
1 parent eb9f5e4 commit 343a69a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ 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 path on Windows. ([@henryriley0])

## [0.27.0] - 2024-02-07

Expand Down
14 changes: 10 additions & 4 deletions src/mibase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,16 @@ 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;
} catch (error) {
if (process.platform === 'win32' && debuggerName.includes("\\")) {
const command = 'dir';
execSync(`${command} ${debuggerName}`, { stdio: 'ignore' });
return true;
}
else {
const command = process.platform === 'win32' ? 'where' : 'command -v';
execSync(`${command} ${debuggerName}`, { stdio: 'ignore' });
return true;
} } catch (error) {
return false;
}
}
Expand Down

0 comments on commit 343a69a

Please sign in to comment.