[swift-dev] Debugging on Xcode

Robert Widmann rwidmann at apple.com
Fri Aug 11 13:38:09 CDT 2017


Full disclaimer: I haven’t looked into this bug, so I’m just going to describe higher-level workflow tips.

> On Aug 11, 2017, at 5:02 AM, Mike Choi via swift-dev <swift-dev at swift.org> wrote:
> 
> Hello Swift community,
> 
> I’m currently trying to debug SR-5556 https://bugs.swift.org/plugins/servlet/mobile#issue/SR-5556 <https://bugs.swift.org/plugins/servlet/mobile#issue/SR-5556>. 
> TL;Dr This bug has to do with Xcode not providing a fixit when it should. 
> 

The way to do what you’re asking for is to build a toolchain, which is far too time-consuming for the debugging workflow you want here.  This diagnostic is coming from somewhere in Semantic Analysis, so you just need to take your minimally-reproducing test case and only run the compiler up to that point.  To do this in Xcode, since you already have the project in hand, you can do the following:

- Select the ‘swift’ scheme
- Pull up the scheme editor (⌘+⇧+<)
- Select the ‘Arguments’ tab and click the ‘+’
- (For this particular case) add ‘-frontend -typecheck /Path/To/This/Test/Case.swift’
- Close the scheme editor
- Build and run

~Robert Widmann

> To proceed, I built Swift and generated an Xcode project but have no idea how to debug the problem. Is there a way for me to input Swift code into the built Swift compiler via Xcode and debug in Xcode??
> 
> If not, what is the usual way to debug something like this?
> 
> Thank you for your time!
> 
> Best,
> Mike JS. Choi
> 
> 
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20170811/d7aa7502/attachment.html>


More information about the swift-dev mailing list