diff --git a/src/debugger/debugAdapterFactory.ts b/src/debugger/debugAdapterFactory.ts index eca0a3f83..f3c46b6b9 100644 --- a/src/debugger/debugAdapterFactory.ts +++ b/src/debugger/debugAdapterFactory.ts @@ -244,7 +244,7 @@ export class LLDBDebugConfigurationProvider implements vscode.DebugConfiguration } async promptForCodeLldbSettingsIfRequired(toolchain: SwiftToolchain) { - const libLldbPathResult = await getLLDBLibPath(toolchain); + const libLldbPathResult = await getLLDBLibPath(toolchain, this.logger); if (!libLldbPathResult.success) { const errorMessage = `Error: ${getErrorDescription(libLldbPathResult.failure)}`; void vscode.window.showWarningMessage( diff --git a/src/debugger/lldb.ts b/src/debugger/lldb.ts index 0a3cf6d80..a47bd5988 100644 --- a/src/debugger/lldb.ts +++ b/src/debugger/lldb.ts @@ -17,6 +17,7 @@ import * as fs from "fs/promises"; import * as path from "path"; import * as vscode from "vscode"; +import { SwiftLogger } from "../logging/SwiftLogger"; import { SwiftToolchain } from "../toolchain/toolchain"; import { Result } from "../utilities/result"; import { IS_RUNNING_UNDER_TEST, execFile } from "../utilities/utilities"; @@ -45,11 +46,15 @@ export function updateLaunchConfigForCI( * * @returns Library path for LLDB */ -export async function getLLDBLibPath(toolchain: SwiftToolchain): Promise> { +export async function getLLDBLibPath( + toolchain: SwiftToolchain, + logger?: SwiftLogger +): Promise> { let executable: string; try { executable = await toolchain.getLLDB(); } catch (error) { + logger?.error(`Failed to get LLDB path from the toolchain, error: ${error}`); return Result.makeFailure(error); } let pathHint = path.dirname(toolchain.swiftFolderPath); @@ -68,6 +73,7 @@ export async function getLLDBLibPath(toolchain: SwiftToolchain): Promise { }); test("getLLDBLibPath Contract Test, make sure we can find lib LLDB", async () => { - const libPath = await getLLDBLibPath(workspaceContext.globalToolchain); + const libPath = await getLLDBLibPath( + workspaceContext.globalToolchain, + workspaceContext.logger + ); // Check the result for various platforms if (process.platform === "linux") {