Uploaded image for project: 'Swift'
  1. Swift
  2. SR-9092

Could Not Resolve Type during swift Foundation debugging

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Cannot Reproduce
    • Component/s: Foundation, LLDB for Swift
    • Labels:
      None
    • Environment:

      Linux

      Description

      Hi guys, i am trying to debug swift-corelibs-foundatin with lldb in Linux. However, it keeps giving me "<could not resolve type>" when I try to access a variable. Here is my testing example:

       import Foundation
       let c1 = NSDateComponents()
       let c2 = NSDateComponents()
       c2.calendar = c1.calendar
       let c1a = c1.calendar as Any
       print(c1a)
       let c2a = c2.calendar as Any
       print(c2a)
      

      I have set breakpoint at `c2.calendar = c1.calendar`. When i step in, at some point it reaches `NSCalendar.swift` under Foundation as follows:

       (lldb) s
       Process 9448 stopped
       * thread #1, name = 'simCalendarCopy', stop reason = step in
       frame #0: 0x000003fffd6eff9e libFoundation.so`NSDateComponents.calendar.setter(newValue=<unavailable>, self=<unavailable>) at NSCalendar.swift:1428
       1425 return _calendar
       1426 }
       1427 set {
       -> 1428 if let val = newValue \{ 
      1429 _calendar = val 
      1430 } else {
       1431 _calendar = nil
       Target 0: (simCalendarCopy) stopped.
      

      Then when i tried to use `fr v` to access variables, the debugger would show me `could not resolve type`. It looks like lldb won't print any variables when it gets into the Foundation code. Any ideas how to fix this?

        Attachments

          Activity

            People

            • Assignee:
              aprantl Adrian Prantl
              Reporter:
              levivic Leo Z
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: