-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement debugging mode #25
Comments
Hi
You will also need a
Feel free to add this to the swift-bundler templates. |
Awesome, thanks for the config! |
I've added a new I updated the settings referring to Again, thanks for the config file examples! I've never used CodeLLDB myself so it might've taken me a bit longer to figure it out. |
Nice. I was under the impression I could not use breakpoints in the release build but I was wrong. 😃 There is a small issue with the
and no |
Oh you can? I also assumed that you couldn't 😅 The only reason I debug with release builds is if the crash only happens in release builds, or if the program is so slow in debug builds that it's impossible to debug.
Ah, my bad, good catch! I never use |
When using
swift bundler run
to build and run an app, Swift Bundler simply starts the app's main executable as a child process and waits for it to finish (similar to whatswift run
does), however, often you need to debug apps and Swift Bundler has no simple way to do so. I often end up runninglldb .build/bundler/MyApp.app/Contents/MacOS/MyApp
and then typingrun
in lldb; very cumbersome!A good way to implement this would be to add a
--lldb
flag to theRunCommand
struct, and then modifyRunner.run
to take an extra boolean argument labelleddebug
. My reason for not calling the--lldb
flag--debug
is that in many build systems (such as Rust'scargo
),--debug
affects the optimization of the executable instead of whether the executable should be run in a debugger or not. I'm open to better suggestions! After modifyingRunner.run
, you'll need to also update all ofRunner
's other platform specificrun...
methods to support running in a debugger. If you can't figure out a way to do so for some of the more obscure platforms such asvisionOS
oriOSSimulator
, I'm happy for that to be completed in a future issue.The text was updated successfully, but these errors were encountered: