@@ -161,11 +161,11 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
161
161
return false ;
162
162
}
163
163
if ( defaultConfig . name . startsWith ( "(Windows) " ) ) {
164
- if ( command . includes ( "cl.exe" ) ) {
164
+ if ( command . startsWith ( "cl.exe" ) ) {
165
165
return true ;
166
166
}
167
167
} else {
168
- if ( ! command . includes ( "cl.exe" ) ) {
168
+ if ( ! command . startsWith ( "cl.exe" ) ) {
169
169
return true ;
170
170
}
171
171
}
@@ -203,21 +203,26 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
203
203
let debuggerName : string ;
204
204
if ( compilerName . startsWith ( "clang" ) ) {
205
205
newConfig . MIMode = "lldb" ;
206
- const suffixIndex : number = compilerName . indexOf ( "-" ) ;
207
- const suffix : string = suffixIndex === - 1 ? "" : compilerName . substr ( suffixIndex ) ;
208
- debuggerName = "lldb-mi" + suffix ;
206
+ debuggerName = "lldb-mi" ;
207
+ // Search for clang-8, clang-10, etc.
208
+ if ( ( compilerName !== "clang-cl.exe" ) && ( compilerName !== "clang-cpp.exe" ) ) {
209
+ const suffixIndex : number = compilerName . indexOf ( "-" ) ;
210
+ if ( suffixIndex !== - 1 ) {
211
+ const suffix : string = compilerName . substr ( suffixIndex ) ;
212
+ debuggerName += suffix ;
213
+ }
214
+ }
215
+ newConfig . type = "cppdbg" ;
209
216
} else if ( compilerName === "cl.exe" ) {
210
217
newConfig . miDebuggerPath = undefined ;
211
218
newConfig . type = "cppvsdbg" ;
212
219
return resolve ( newConfig ) ;
213
220
} else {
214
221
debuggerName = "gdb" ;
215
222
}
216
-
217
223
if ( isWindows ) {
218
- debuggerName += ".exe" ;
224
+ debuggerName = debuggerName . endsWith ( ".exe" ) ? debuggerName : ( debuggerName + ".exe" ) ;
219
225
}
220
-
221
226
const compilerDirname : string = path . dirname ( compilerPath ) ;
222
227
const debuggerPath : string = path . join ( compilerDirname , debuggerName ) ;
223
228
if ( isWindows ) {
0 commit comments