Skip to content

Commit

Permalink
Merge pull request #7766 from microsoft/main
Browse files Browse the repository at this point in the history
Merge for 1.5.0-insiders3 (2nd time)
  • Loading branch information
sean-mcmanus authored Jul 1, 2021
2 parents 2ab63a4 + 3967429 commit 7ad30da
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions Extension/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

### Bug Fixes
* Fix code folding causing `} else if` lines to be hidden. [#5521](https://github.com/microsoft/vscode-cpptools/issues/5521)
* Fix empty `launch.json` being created when debug configuration selection is canceled. [#7517](https://github.com/microsoft/vscode-cpptools/issues/7517)
* Fix Find All References on a global variable giving incorrect references to local variables. [#7702](https://github.com/microsoft/vscode-cpptools/issues/7702)
* Fix `vcFormat` not working near the end of the file with UTF-8 characters > 1 byte. [#7704](https://github.com/microsoft/vscode-cpptools/issues/7704)
* Fix configuration squiggle on a recursively resolved `forcedInclude`. [PR #7722](https://github.com/microsoft/vscode-cpptools/pull/7722)
Expand Down
23 changes: 14 additions & 9 deletions Extension/src/Debugger/configurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class QuickPickConfigurationProvider implements vscode.DebugConfiguration

const selection: MenuItem | undefined = await vscode.window.showQuickPick(items, {placeHolder: localize("select.configuration", "Select a configuration")});
if (!selection) {
return []; // User canceled it.
throw Error(localize("debug.configuration.selection.canceled", "Debug configuration selection canceled")); // User canceled it.
}
if (selection.label.startsWith("cl.exe")) {
if (!process.env.DevEnvDir) {
Expand Down Expand Up @@ -161,11 +161,11 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
return false;
}
if (defaultConfig.name.startsWith("(Windows) ")) {
if (command.includes("cl.exe")) {
if (command.startsWith("cl.exe")) {
return true;
}
} else {
if (!command.includes("cl.exe")) {
if (!command.startsWith("cl.exe")) {
return true;
}
}
Expand Down Expand Up @@ -203,21 +203,26 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
let debuggerName: string;
if (compilerName.startsWith("clang")) {
newConfig.MIMode = "lldb";
const suffixIndex: number = compilerName.indexOf("-");
const suffix: string = suffixIndex === -1 ? "" : compilerName.substr(suffixIndex);
debuggerName = "lldb-mi" + suffix;
debuggerName = "lldb-mi";
// Search for clang-8, clang-10, etc.
if ((compilerName !== "clang-cl.exe") && (compilerName !== "clang-cpp.exe")) {
const suffixIndex: number = compilerName.indexOf("-");
if (suffixIndex !== -1) {
const suffix: string = compilerName.substr(suffixIndex);
debuggerName += suffix;
}
}
newConfig.type = "cppdbg";
} else if (compilerName === "cl.exe") {
newConfig.miDebuggerPath = undefined;
newConfig.type = "cppvsdbg";
return resolve(newConfig);
} else {
debuggerName = "gdb";
}

if (isWindows) {
debuggerName += ".exe";
debuggerName = debuggerName.endsWith(".exe") ? debuggerName : (debuggerName + ".exe");
}

const compilerDirname: string = path.dirname(compilerPath);
const debuggerPath: string = path.join(compilerDirname, debuggerName);
if (isWindows) {
Expand Down

0 comments on commit 7ad30da

Please sign in to comment.