Skip to content

Commit 1c9b15e

Browse files
committed
Resolve the issue of not being able to set the GDB path on Windows.
1 parent eb9f5e4 commit 1c9b15e

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

CHANGELOG.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

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

5-
The format is based on [Keep a Changelog], and this project adheres to [Semantic
6-
Versioning].
5+
The format is based on [Keep a Changelog], and this project adheres to [Semantic Versioning].
76

87
[keep a changelog]: https://keepachangelog.com/en/1.0.0
98
[semantic versioning]: https://semver.org/spec/v2.0.0.html
@@ -24,6 +23,8 @@ Versioning].
2423
- solve the problem of failed parsing of containers ([@henryriley0])
2524
- Fixes #421 - Added `registerLimit` option to specify the registers to
2625
display - PR #444 ([@chenzhiy2001])
26+
- Resolve the issue of not being able to set the GDB path on Windows
27+
([@henryriley0])
2728

2829
## [0.27.0] - 2024-02-07
2930

@@ -123,8 +124,7 @@ Versioning].
123124
### Fixed
124125

125126
- Remove the need for extra trust for debugging workspaces per guidance "for
126-
debug extensions" as noted in the [Workspace Trust Extension Guide] - PR #272
127-
([@GitMensch])
127+
debug extensions" as noted in the [Workspace Trust Extension Guide] - PR #272 ([@GitMensch])
128128
- don't abort if `set target-async` or `cd` fails in attach (brings in line with
129129
existing behavior from launch) ([@WebFreak001])
130130
- Fix simple value formatting list parsing with empty string as first argument -

src/mibase.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -96,10 +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;
102-
} catch (error) {
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+
} } catch (error) {
103109
return false;
104110
}
105111
}

0 commit comments

Comments
 (0)