Use explicit rustc commit-hash

Required for lldb on mac
This commit is contained in:
vsrs 2021-04-22 18:30:44 +03:00
parent 1ebfe11730
commit 1b4197cb35
3 changed files with 15 additions and 3 deletions

View file

@ -3,7 +3,7 @@ import * as vscode from 'vscode';
import * as path from 'path';
import * as ra from './lsp_ext';
import { Cargo, getSysroot } from './toolchain';
import { Cargo, getRustcId, getSysroot } from './toolchain';
import { Ctx } from "./ctx";
import { prepareEnv } from "./run";
@ -107,9 +107,11 @@ async function getDebugConfiguration(ctx: Ctx, runnable: ra.Runnable): Promise<v
let sourceFileMap = debugOptions.sourceFileMap;
if (sourceFileMap === "auto") {
// let's try to use the default toolchain
const commitHash = await getRustcId(wsFolder);
const sysroot = await getSysroot(wsFolder);
const rustlib = path.normalize(sysroot + "/lib/rustlib/src/rust");
sourceFileMap = { "/rustc/*": rustlib };
sourceFileMap = {};
sourceFileMap[`/rustc/${commitHash}/`] = rustlib;
}
const debugConfig = knownEngines[debugEngine.id](runnable, simplifyPath(executable), env, sourceFileMap);