- Create a blank Xcode project for the purpose of debugging your app, if it was not built with Xcode.
- Select your executable you wish to debug using
Debug->Debug Executable...
orDebug->Attach to process
. - You can modify startup parameters for the app using the scheme, accessible at
Product->Scheme->Edit Scheme...
. - To load debug versions of libraries, like the Qt libraries, set the environment variable
DYLD_IMAGE_SUFFIX
to_debug
which will load the the debug versions of the Qt libraries. You can set this in the Arguments tab of the Scheme editor. - In Scheme editor, make sure that the
Document Versions ☐ Allow debugging when browsing versions
checkbox is unchecked - it defaults to on. Without doing this, you will often have applications failing on startup because Xcode inserts command line options to the application that the app is not expecting. - Make sure that the .dSYM files are located adjacent to the .frameworks and/or .dyld libraries.
- Running
image lookup --verbose --address $pc
in the lldb command line interface in xcode, when you have stepped into code that XCode is not showing you the sources for will show you the source path that is present in the debug symbol file, which you need when mapping sources to the sources on your local machine. - Set up the source mapping from the build machine's source location to the location of the sources on your machine can be done with the following command:
settings set target.source-map /Volumes/DATA/local/S/workspace/qt_maya/src /Users/kyzikadmin/Build/qt-git/qt5
- Step into the library code!
Created
May 9, 2023 19:15
-
-
Save keithel/f4576efa4e2c31a5756b9b8517d40a15 to your computer and use it in GitHub Desktop.
Apple devbugging tips
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment