levivic
(Leo)
1
Hi guys, i am trying to debug swift-corelibs-foundatin with lldb in Linux. However, it keeps giving me "" 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, 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 fr v val, 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?
dcci
(Davide C. C. Italiano)
3
It looks like the foundation module isn't imported. Can you file a SR?
levivic
(Leo)
4
1 Like
dcci
(Davide C. C. Italiano)
5
Thanks, I'll try to take a look as time permits.
1 Like