Xcode 4 External Build Project and Debugging

I have a makefile based project that creates my code on multiple platforms. On my Mac, I want to use Xcode for debugging. I created Xcode as an external build project. I can run the application from Xcode. The result is displayed in Xcode, and if the application crashes, it returns to the debugger, but when you start the debugger, you cannot find the source files, so I just see the assembly. How can I tell Xcode where to find the source?

I also cannot set breakpoints, but I think this is still the same problem.

+7
source share
3 answers

I was able to fix the problem of not stopping at breakpoints by setting a custom working directory for the executable. Prior to this change, I was able to successfully build an external scons system with Xcode 4. My code will work when called from Xcode, but breakpoints will be ignored.

Then in Xcode, Go to product → Change schema ... The check 'uses a custom working directory' and I installed it in the same directory as the executable.

Then breakpoints began to work.

+6
source
  • Make sure -g is included in the compiler options in the makefile.
  • Set a custom working directory in the scheme, install the executable file, if it is not already installed.
  • Make sure the project does not pull in dylibs that have not been compiled with -g. You may need a build step to run make install if the project creates children, as well as the main goal.
  • Make sure that strip is not being called. There are vars environments that install xcode that allow you to save the makefile working file when used outside of xcode.

You had this problem and it worked (Xcode 4.6) (it turned out to debug the source code and working breakpoints)

+4
source

In the "Project Navigator" (the file folder icon just below the "Run" button), right-click and select "Add files to your project." Go to the top-level folder, where you usually run the external assembly, and click "Add."

+1
source

All Articles