-
Notifications
You must be signed in to change notification settings - Fork 86
Add logging getLLDBLibPath to better diagnose failures #1943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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<Result<string>> { | ||
| export async function getLLDBLibPath( | ||
| toolchain: SwiftToolchain, | ||
| logger?: SwiftLogger | ||
| ): Promise<Result<string>> { | ||
| 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<Result< | |
| // should just the version of lldb that comes with CodeLLDB. We return a failure with no message | ||
| // to indicate we want it to fail silently. | ||
| if (process.platform === "win32") { | ||
| logger?.error(`Failed to get LLDB library path for lldb on Windows, error: ${error}`); | ||
| return Result.makeFailure(undefined); | ||
| } | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't seem to add comment to lines not in patch, but in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also don't think it would be too verbose to log directory contents returned by |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while we're here, maybe a debug log of what was found