In my project, i have added another project as a library, Their are some runtime issues present due to which i want to debug that to resolve that. while with xcode 3.2.5 i am able to debugged that, but i am not able to do the same with xcode 4. Does anyone faced similar issue? Are there any additional settings required in xcode 4.
-
do u mean to say you are not able to put breakpoints..? what exactly meant by "i am able to debugged that"?Saurabh Passolia– Saurabh Passolia2012-01-08 09:46:49 +00:00Commented Jan 8, 2012 at 9:46
-
@samfisher i am able to put breakpoints, but at the time of execution it won't work, while it is working with xcode 3.2.5rishi– rishi2012-01-08 09:50:51 +00:00Commented Jan 8, 2012 at 9:50
2 Answers
Xcode 4 does not have a UI to add directories to search for source code yet. Instead you will need to following steps:
- Add a breakpoint which will be hit before the code you need to search for. A good place would be main.
- Once the breakpoint is hit open the Debug Area and enter the command "directory" followed by the path to the directory which contains the source. gdb doesn't search recursively so you will need to repeat the command for each directory containing code you need. The picture below gives an example.
- Continue until a breakpoint is hit in the code which needs to be searched for. If gdb can't find the source at the path in the symbol table then it will search through the paths you gave with "directory"
Comments
Add both projects into the very same workspace and the debugger breakpoints will work fine again. To add the library project into your app projects' workspace, drag it from the finder onto the root level of your app project. Xcode will ask if you want to convert that project into a workspace now. Make sure the library project is not opened within Xcode outside of the freshly created workspace.
As an alternative, make sure the library project is opened within Xcode. Put a breakpoint onto a call of your library methods within the main (app) project. Step into the library once and continue the execution normally. From now on, breakpoints within your library project will be functioning.