Skip to content

FreeBSD: lldb expression evaluation fails #11760

@etcwilde

Description

@etcwilde

LLDB is unable to run Swift evaluate Swift expressions on FreeBSD.
There seem to be two issues here. First, the module triple for finding the swiftmodule directory appears to be unnormalized, resulting in LLDB looking for x86_64--freebsd.swiftmodule instead of x86_64-unknown-freebsd.swiftmodule. The second issues seems to be that virtual llvm::Expected<XcodeSDK> lldb_private::Platform::GetSDKPathFromDebugInfo(CompileUnit &) is not implemented.

This is the program involved:

let a = 10
print(a)
ewilde@latte ~ %  swiftc main.swift -g
ewilde@latte ~ %  lldb -- main
[lldb] % target create "main"
Current executable set to '/home/ewilde/main' (x86_64).
[lldb] % b 2
Breakpoint 1: where = main`main + 32 at main.swift:2:7, address = 0x0000000000201e90
[lldb] % run
Process 97664 launched: '/home/ewilde/main' (x86_64)
Process 97664 stopped
* thread #1, name = 'main', stop reason = breakpoint 1.1
    frame #0: 0x0000000000201e90 main`main at main.swift:2:7
   1    let a = 10
-> 2    print(a)
Target 0: (main) stopped.
[lldb] % p a 
(Int) 10
[lldb] % p a + 1
error: Error while parsing SDK path from debug info: virtual llvm::Expected<XcodeSDK> lldb_private::Platform::GetSDKPathFromDebugInfo(CompileUnit &) not implemented for 'host' platform.
Could not import Swift modules for translation unit: failed to get module "Swift" from AST context:
error: could not find module 'Swift' for target 'x86_64--freebsd'; found: x86_64-unknown-freebsd, at: /home/ewilde/.toolchains/swift/main-2025-11-04/usr/lib/swift/freebsd/Swift.swiftmodule/x86_64--freebsd
           
error: error status positive, but import still failed

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions