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 1c9b15e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog], and this project adheres to [Semantic
Versioning].
The format is based on [Keep a Changelog], and this project adheres to [Semantic Versioning].

[keep a changelog]: https://keepachangelog.com/en/1.0.0
[semantic versioning]: https://semver.org/spec/v2.0.0.html
Expand All @@ -24,6 +23,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 path on Windows
([@henryriley0])

## [0.27.0] - 2024-02-07

Expand Down Expand Up @@ -123,8 +124,7 @@ Versioning].
### Fixed

- Remove the need for extra trust for debugging workspaces per guidance "for
debug extensions" as noted in the [Workspace Trust Extension Guide] - PR #272
([@GitMensch])
debug extensions" as noted in the [Workspace Trust Extension Guide] - PR #272 ([@GitMensch])
- don't abort if `set target-async` or `cd` fails in attach (brings in line with
existing behavior from launch) ([@WebFreak001])
- Fix simple value formatting list parsing with empty string as first argument -
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 1c9b15e

Please sign in to comment.