[swift-users] Debugger woes
Jon Shier
jon at jonshier.com
Tue Jan 31 12:57:46 CST 2017
This is pretty normal debugger behavior for me. Issues with printing variables clearly in scope, using types or operators from other modules, and poor performance happen every time I try to debug Swift under Xcode. I’ve never found anything that works reliably.
Jon
> On Jan 31, 2017, at 1:54 PM, Maury Markowitz via swift-users <swift-users at swift.org> wrote:
>
> I hope this is the right place to ask this:
>
> I'm using Xcode Version 8.2.1 (8C1002) and I'm trying to find out what's going wrong in my Swift3 app. Here's the code:
>
> let background = sceneView.snapshot().cgImage!
> let cropped = background.cropping(to: overlayView.frame)
> UIGraphicsBeginImageContextWithOptions(overlayView.frame.size, false, 1.0)
>
> I have a breakpoint on the first line. When it trips I F6 to the next line and examine background:
>
> (lldb) p background
> (CGImage) $R0 = 0x00000001741d4370 {}
> Printing description of background:
> <CGImage 0x1741d4370>
> <<CGColorSpace 0x170024480> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; sRGB IEC61966-2.1)>
> width = 640, height = 998, bpc = 8, bpp = 32, row bytes = 2560
>
> Now I hit F6 again and do the same thing:
>
> (lldb) p background
> error: <EXPR>:3:1: error: use of unresolved identifier 'background'
> background
> ^~~~~~~~~~
>
> This happens to pretty much every variable in the app, after running another line or two, it apparently disappears. This is particularly annoying in this case, because QuickLook fails almost every time, which makes debugging image work somewhat difficult.
>
> I've cleaned and rebooted and it keeps coming back. Any suggestions?
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users
More information about the swift-users
mailing list