Debugging on Xcode

Hello Swift community,

I’m currently trying to debug SR-5556 Issues · apple/swift · GitHub.
TL;Dr This bug has to do with Xcode not providing a fixit when it should.

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

Hey Mike, I've found this presentation by Ayanonagon to be helpful in
getting a functional development environment up and running:

Also, I'm going to be facilitating a workshop at try! Swift NYC to help
people set up functional development environments in Swift. Part of this is
going to be improving the getting started instructions and getting people
started a few weeks before the conference. I'd be glad to have another set
of new eyes to review it before sending it out.

There's also a few people in #swift-compiler on the iosdevelopers slack.
It's not a deep bench in terms of compiler expertise, but I'll answer
anything I can.

Good luck!

Brian

···

On Fri, Aug 11, 2017 at 8:02 AM, Mike Choi via swift-dev < swift-dev@swift.org> wrote:

Hello Swift community,

I’m currently trying to debug 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.

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@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

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

Hello Swift community,

I’m currently trying to debug SR-5556 Issues · apple/swift · GitHub.
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

···

On Aug 11, 2017, at 5:02 AM, Mike Choi via swift-dev <swift-dev@swift.org> wrote:

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@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Add to debugging the compiler?

···

Sent from my iPhone

On Aug 11, 2017, at 11:38 AM, Robert Widmann via swift-dev <swift-dev@swift.org> wrote:

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@swift.org> wrote:

Hello Swift community,

I’m currently trying to debug SR-5556 Issues · apple/swift · GitHub.
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@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev