Skip to content
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

[SR-9587] Debug local stack frame variables fails - Failed to get module ‘Builtin’ from AST context #4614

Closed
swift-ci opened this issue Dec 31, 2018 · 1 comment
Labels
bug Something isn't working Compiler LLDB for Swift

Comments

@swift-ci
Copy link

Previous ID SR-9587
Radar None
Original Reporter DavidYangLiu (JIRA User)
Type Bug
Status Resolved
Resolution Invalid
Additional Detail from JIRA
Votes 0
Component/s Compiler, LLDB for Swift
Labels Bug
Assignee DavidYangLiu (JIRA)
Priority Medium

md5: 3489295b0b4fd5e3e6e8d17f77151227

Issue Description:

Hi, i ran in to an issue with debugging stdlib changes and believe this is an existing issue from 2017. Swif.org/fourms post here : Swift forums post

samding01 (JIRA User) found the original issue here: Sam's Swift forums post

How i cloned:
branch: master
clone: git clone https://github.com/apple/swift.git
./swift/utils/update-checkout --clone
How i built:
terminal: utils/build-script --release --debug-swift --debug-swift-stdlib
Xcode: utils/build-script --debug --xcode

How i am testing:
Xcode: build and run
terminal: lldb attached to Ninja-RelWithDebInfoAssert+stdlib-DebugAssert/swift-macosx-x86_64/bin/swift

Expected results - able to investigate my local variables on stack frame

Actual - error: in auto-import:
failed to get module 'Builtin' from AST context

ocess 20684 stopped

  • thread [lldb][NFC] Actually test which method we call in TestCallOverriddenMethod #2, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x000000010b01f657 libswiftCore.dylib`Array.stuffz.getter(self=) at Array.swift:328
    325 }
    326
    327 public var stuffz:String {
    -> 328 let x = "foobar"
    329 let y = "dem breakpoints"
    330 let combined = x + y
    331 return combined
    Target 0: (swift) stopped.
    (lldb) n
    Process 20684 stopped

  • thread [lldb][NFC] Actually test which method we call in TestCallOverriddenMethod #2, queue = 'com.apple.main-thread', stop reason = step over
    frame #0: 0x000000010b01f67c libswiftCore.dylib`Array.stuffz.getter(self=) at Array.swift:329
    326
    327 public var stuffz:String { 328 let x = "foobar" -> 329 let y = "dem breakpoints" 330 let combined = x + y 331 return combined 332 }
    Target 0: (swift) stopped.
    (lldb) po x
    error: in auto-import:
    failed to get module 'Builtin' from AST context
    (lldb) s
    Process 20684 stopped

  • thread [lldb][NFC] Actually test which method we call in TestCallOverriddenMethod #2, queue = 'com.apple.main-thread', stop reason = step in
    frame #0: 0x000000010b0178d8 libswiftCore.dylib`String.init(start=0x000000010b75dc1f "dem breakpoints", utf8CodeUnitCount=15, isASCII=1) at String.swift:513
    510 utf8CodeUnitCount: Builtin.Word,
    511 isASCII: Builtin.Int1
    512 ) {
    -> 513 let bufPtr = UnsafeBufferPointer(
    514 start: UnsafeRawPointer(start).assumingMemoryBound(to: UInt8.self),
    515 count: Int(utf8CodeUnitCount))
    516 if let smol = _SmallString(bufPtr) {
    Target 0: (swift) stopped.
    (lldb) s
    Process 20684 stopped

  • thread [lldb][NFC] Actually test which method we call in TestCallOverriddenMethod #2, queue = 'com.apple.main-thread', stop reason = step in
    frame #0: 0x000000010b01b1ff libswiftCore.dylib`UnsafeBufferPointer.init(start=, count=15) at UnsafeBufferPointer.swift:892
    889 @inlinable // unsafe-performance
    890 public init(start: UnsafePointer?, count: Int) {
    891 _precondition(
    -> 892 count >= 0, "UnsafeBufferPointer with negative count")
    893 _precondition(
    894 count == 0 || start != nil,
    895 "UnsafeBufferPointer has a nil start and nonzero count")
    Target 0: (swift) stopped.
    (lldb) po count
    error: in auto-import:
    failed to get module 'Builtin' from AST context

@swift-ci
Copy link
Author

swift-ci commented Jan 4, 2019

Comment by David Liu (JIRA)

Working as intended, it was user error.

Detailed form discussion here

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 7, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Compiler LLDB for Swift
Projects
None yet
Development

No branches or pull requests

1 participant