debugging framework source in XCode

Post: #1
I have a framework, and I have an application that uses the framework. Everything builds just fine. When I debug my application in XCode, however, I cannot step into methods defined within framework sources. I can step through methods defined locally in my project. I have tried dozens of permutations of project settings, and none seems to fix the problem.

Does anyone know where I went wrong and how I can recover?
Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #2
Sounds like you need to build the framework in debug mode?
Quote this message in a reply
Post: #3
OneSadCookie Wrote:Sounds like you need to build the framework in debug mode?

I've built the framework in both debug and release modes with the same negative outcome. I've tried linking to the release and debug versions with the same outcome. I've even tried embedding the framework with no success (the framework gets embedded all right, but I still can't debug the code). The debugger console gives no messages when I attempt to step into framework code. It just passes over the line as though it were a declaration or assignment.

How about this: suppose I create a framework from scratch. Before linking it into a new application, what should I do to ensure that the framework source is available for debugging?

Quote this message in a reply
Post: #4
I figured it out. I didn't set the "DYLD_FRAMEWORK_PATH" environment variable in my Application's executable settings. I also had a Release version built in my username/Library/Frameworks folder, which was being linked preferentially over my Debug version.

In case someone stumbles onto this thread with the same confusion as me, I'll recap the whole process of making and linking a framework for Debug purposes.

1. Create the Framework project. Add the source files and such.
2. Create the master header: "MyFramework/MyFramework.h".
3. Create MyApplication and add the Existing Framework in ".../MyFramework/build/Debug/MyFramework.framework"
4. In the left-side tray of MyApplication, where it lists Classes, Targets, etc, find the Executables tab. Select MyApplication's executable and open it's info pane.
5. Under the "Arguments" tab of the Executable Info pane, at the bottom is a list titled "Variables to be set in the environment". Click `+' to add a variable. Title the variable "DYLD_FRAMEWORK_PATH" and set its value to ".../MyFramework/build/Debug", where "..." should be replaced with your framework project's full path.

Did I leave anything out?

My apologies if this list is redundant, but it appears they've done frequent tinkering with the look and organization of these settings, resulting in a lot of (slightly) outdated documentation and tutorials.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Debugging Help - Game Won't Display Rasterman 6 4,276 Dec 14, 2007 08:10 AM
Last Post: Rasterman
  Confused While Debugging Nick 2 4,078 Feb 24, 2005 10:04 AM
Last Post: Nick