Odd XCode debug issue

KenDRhyD

Registered
For the most part I have been enjoying my excursions into learning Objective-C and the XCode environment. I have been programming for more than 30 years and have used most programming languages at one time or another, so most of my issues deal with the intracacies of the Coacoa environment, and especially the programming paradigms for GUI based applications under MaxOS X.

I am using a 1.2GHz iMac 17" as my primary machine, and have the latest versions of the OS and tools installed.

There are a couple of things about the XCode environment that bug the heck out of me, unless I am not doing something right.

1. Debug performance. If I execute my code, which is riddled with NSLog() calls to aid in trackiong down issues, the code runs very fast and I see the results very quickly. If I press the debug button, however, it can take 20-70 seconds before my dialog appears and I can press a button. After pressing the button, it can take another 15-45 seconds before I hit my first breakpoint. Is this performance normal? Or are there things that can be done to improve this?

2. If I organize my source files into subdirectories of the main project folder, then I cannot step into code that resides in those subdirectories, even if I have set the project to full symbols and no optimization! If I set a breakpoint within some code that is in a subdirectory then I hit that breakpoint and can step into most other routines in the same file and some in the same directory, but not all -- and aside from the files being in a subdirectory of the project I can find no other pattern. Is this normal? Or is there some configuration I can adjust to avoid this?

3. I have found no reference to keyboard equivalences to the Step In/Over/Out or Continue buttons. I am forced to use the mouse for everything. Are there no keyboard values for the debugger?

-ken
 
KenDRhyD said:
1. Debug performance. If I execute my code, which is riddled with NSLog() calls to aid in trackiong down issues, the code runs very fast and I see the results very quickly. If I press the debug button, however, it can take 20-70 seconds before my dialog appears and I can press a button. After pressing the button, it can take another 15-45 seconds before I hit my first breakpoint. Is this performance normal? Or are there things that can be done to improve this?

One thing I know that slows down debugging is using the GuardMalloc library. GuardMalloc makes your program run up to 100 times slower. Make sure the Enable Guard Malloc menu item isn't set in the Debug menu.

3. I have found no reference to keyboard equivalences to the Step In/Over/Out or Continue buttons. I am forced to use the mouse for everything. Are there no keyboard values for the debugger?
The Debug menu shows the default keyboard equivalents for common debugging commands, including the Step and Continue commands. You can change the keyboard equivalents in Xcode's preferences, in the Key Bindings section.
 
1. Yep, that was causing most of the problem. Removing the malloc checks improved the speed dramatically.

3. Sometimes one can be so blind!

Thank you.


2. No idea on why I cannot step into methods that belong to source files that are stored in subdirectories?

-ken
 
KenDRhyD said:
2. No idea on why I cannot step into methods that belong to source files that are stored in subdirectories?
1. Make sure you create groups for your subdirectories in the Groups and Files list. Choose File > New Group to create a new group.
2. Make sure your files' path types are set to Relative to Enclosing Group. Select a file, click the Info, and click the General tab to see the file's path type.

I can't think of any other reasons why you couldn't debug files located in subdirectories.
 
szymczyk said:
1. Make sure you create groups for your subdirectories in the Groups and Files list. Choose File > New Group to create a new group.
2. Make sure your files' path types are set to Relative to Enclosing Group. Select a file, click the Info, and click the General tab to see the file's path type.

I can't think of any other reasons why you couldn't debug files located in subdirectories.

This is how I had separated the files to begin with. Each subdirectory has its own group and all of the files in a specific subdirectory are in that grooup. And all of the files are marked "relative to the group".

The symptom is that ste-into actually does a ste-over when the procedure/method being called resides in a source file in a different directory from the invoking line of code and the project itself.

Very odd!
 
Back
Top