PDA

View Full Version : Xcode debugging red arrow not working properly




stephan.works
Nov 10, 2009, 02:02 PM
Hi guys!

I'm debugging a C++ program with Xcode but unfortunately I have to manually follow the flow of the program since Xcode doesn't automatically display the line of code which is currently executing (the one with the red arrow).

(clicking on the stack brings to the correct line but of the wrong file!)

Does anybody know why?
Thanks :)



lloyddean
Nov 10, 2009, 02:21 PM
Was your project started from an Xcode project template?

If so are you building and attempting to debug a debug target or a release target?

stephan.works
Nov 10, 2009, 05:47 PM
Was your project started from an Xcode project template?

If so are you building and attempting to debug a debug target or a release target?

I started from a template (command line tool, c++) and I'm trying to debug a debug target.
Thank you.

lloyddean
Nov 10, 2009, 08:14 PM
OK, so, when debugging a red arrow does appear and it moves from line to line when stepping through the code but the view does not follow the arrow as it steps out of bounds.

Is that correct?

Does this also happen following a quit and relaunch of the Xcode project?

stephan.works
Nov 10, 2009, 09:29 PM
OK, so, when debugging a red arrow does appear and it moves from line to line when stepping through the code but the view does not follow the arrow as it steps out of bounds.

Is that correct?

Does this also happen following a quit and relaunch of the Xcode project?


Correct.
I've tried to relaunch, reboot, update to latest version, "clean all" in the project. Unfortunately those didn't help.

Thank you.

lloyddean
Nov 11, 2009, 12:57 AM
I've seen this a couple of times. Quitting Xcode and trashing the build folder would usually straighten things out.

Sorry but I'm coming up empty.

Does the same thing happen logged-in as a different user?

Does the same thing happen when the project is brought up on a different machine?

Does the same thing happen with a new project?

Are you using unusual, non system supplied, fonts?

stephan.works
Nov 11, 2009, 10:16 AM
I've seen this a couple of times. Quitting Xcode and trashing the build folder would usually straighten things out.

Sorry but I'm coming up empty.

Does the same thing happen logged-in as a different user?

Does the same thing happen when the project is brought up on a different machine?

Does the same thing happen with a new project?

Are you using unusual, non system supplied, fonts?

I have no unusual fonts.
I've tried to trash the build folder: nothing.
I've tried to use an old version of the project: nothing.
I've created a new project with just main.cpp and a couple of functions: in such project the red line works properly.

There must be something wrong with the project... but what?
Thank you!

wrldwzrd89
Nov 11, 2009, 10:29 AM
Is your Xcode up to date? The latest versions:

2.5 for Tiger
3.1.4 for Leopard
3.2.1 for Snow Leopard

stephan.works
Nov 11, 2009, 10:39 AM
Is your Xcode up to date? The latest versions:

2.5 for Tiger
3.1.4 for Leopard
3.2.1 for Snow Leopard

Yes, I have 3.2.1 on Snow Leopard 10.6.2.
(I had the same problem on 10.6.1).
Thank you.

lloyddean
Nov 11, 2009, 01:48 PM
So, it's just this one project.

Perhaps you've accidentally changed a debug setting in the debug targets.

You can check this out by selecting "Edit Active Target <your project name>" from the "Project" menu.

In the resulting "Target <your project name> Info" window select "Debug" from the "Configuration" popup menu. And "User-Defined Settings" from the "Show" popup menu. If you changed something from the default it should pop out at you.

Another thing we could try is looking over the "project.pbxproj" file located within your ".xcodeproj" bundle package if you're willing to post it.

stephan.works
Nov 11, 2009, 02:14 PM
So, it's just this one project.

Perhaps you've accidentally changed a debug setting in the debug targets.

You can check this out by selecting "Edit Active Target <your project name>" from the "Project" menu.

In the resulting "Target <your project name> Info" window select "Debug" from the "Configuration" popup menu. And "User-Defined Settings" from the "Show" popup menu. If you changed something from the default it should pop out at you.

Another thing we could try is looking over the "project.pbxproj" file located within your ".xcodeproj" bundle package if you're willing to post it.


Thank you for your help.
I've checked and there are no user-defined settings.
I've attached my my .xcodeproj file.

lloyddean
Nov 11, 2009, 04:07 PM
Which version of Xcode was used to "create" this project?

Which project creation template did you select to "create" this project?

stephan.works
Nov 12, 2009, 02:57 PM
Which version of Xcode was used to "create" this project?

Which project creation template did you select to "create" this project?


I started from a command-line tool template.
At the time I created the project I was using Xcode 3.0 (I think, not entirely sure though).

Thank you!

lloyddean
Nov 12, 2009, 05:12 PM
I'm not seeing anything that should be a problem.

I hadn't seen an answer to the question: Does the same thing happen when the project is brought up on a different machine?

Either way a next possibility would be to set aside the two files "<your-login-name-here>.pbxuser" and "<your-login-name-here>.mode1v3" (rename by adding an underscore to the front) located within your ".xcodeproj" bundle package. Relaunch the problematic Xcode project an see if that takes care of it.

These files store thing like breakpoints and personal execution setting related to console interactions so they may need to be reset-up should it otherwise start working.

stephan.works
Nov 15, 2009, 03:17 PM
I hadn't seen an answer to the question: Does the same thing happen when the project is brought up on a different machine?

Either way a next possibility would be to set aside the two files "<your-login-name-here>.pbxuser" and "<your-login-name-here>.mode1v3" (rename by adding an underscore to the front) located within your ".xcodeproj" bundle package. Relaunch the problematic Xcode project an see if that takes care of it.

These files store thing like breakpoints and personal execution setting related to console interactions so they may need to be reset-up should it otherwise start working.

Sorry for my late reply.
I tried to rename such files and it didn't help.
Unfortunately I don't have another Mac on which to try (at least for this week).

I also tried to create the project from scratch but it also doesn't work; those are the steps I've followed:

I've built freeglut2.4 (I need it for a project)
I've set the settings attached below
I've added the OpenGL and the freeglut frameworks

I guess there must be something wrong with those steps.


Thanks!

lloyddean
Nov 15, 2009, 04:21 PM
OK. I'll take a look at those later this evening, but first - a question. You are aware that Apple provides a version of GLUT for your use in /System/Libraries/Frameworks aren't you? Or is there something special about "freeglut2.4"?

lloyddean
Nov 15, 2009, 04:35 PM
stephan.works,

Attached is a quick GLUT based Orthographic Projection Xcode project I put together for you to try. It uses the System supplied GLUT.framework.

203324

stephan.works
Nov 15, 2009, 04:55 PM
Thank you but I can't find "freeglut" it in /System/Library/Frameworks
I can see on "GLUT" but I need to use freeglut because that's a requirement of the project.

I also found another Mac on which to run my project... and the red arrow works properly on it... :confused::confused::confused:

There must be something wrong with my Mac / Xcode...
Thanks for your help.

stephan.works
Nov 15, 2009, 05:30 PM
I just uninstalled and reinstalled Xcode... didn't help.
I also tried (again) to delete the preferences file... no help.

lloyddean
Nov 15, 2009, 09:44 PM
I just uninstalled and reinstalled Xcode... didn't help.
I also tried (again) to delete the preferences file... no help.


Repeating an unanswered question from much earlier - does the same thing happen logged-in as a different user?

Now I'm just plain nosey! Is this project for a class of some type? If so what?

stephan.works
Nov 16, 2009, 12:06 AM
Repeating an unanswered question from much earlier - does the same thing happen logged-in as a different user?

Now I'm just plain nosey! Is this project for a class of some type? If so what?


So I tried with a test user... and it works.
There must be something wrong with my user then...

Removing preferences didn't help... I also tried to clean the cache...
Not sure what else influences Xcode.


Thanks for your help!

PS: yes, it's for a class. The project should also run on lab machines, which are Linux boxes and have freeglut installed.

lloyddean
Nov 16, 2009, 12:29 PM
So "freeglut" really isn't needed for your Xcode project but will be needed in order to link under LINUX, and or, Windows. In which case the only thing that would need changing in order for you to drop "freeglut" under Mac OS X is the addition of a conditional inclusion of 'glut.h' as follows:

#ifndef __APPLE__
#include <gl/glut.h>
#else
#include <GLUT/glut.h>
#endif

This leaves the source compilable on all platforms that support GLUT.

stephan.works
Nov 16, 2009, 06:34 PM
#ifndef __APPLE__
#include <gl/glut.h>
#else
#include <GLUT/glut.h>
#endif


Thank you but unfortunately, as far as I know (I might be mistaken though), GLUT is slightly different from freeglut and I don't want to work on something that might not work properly on Linux.

Moreover... the project works on the test account so... there must be something wrong with my account. But I really don't have idea of what it might be.

Thanks for you help!

stephan.works
Nov 23, 2009, 03:16 AM
Any other idea on how to solve this Xcode problem (which apparently is linked to my account)?

Thanks!

lloyddean
Nov 23, 2009, 11:23 AM
I'd probably start by moving ALL the files in my ~/Library/Preferences folder to someplace else logging out and then back in to do testing to see if it then works. Remember to quit Xcode before performing the next round of testing.

And sure things will feel a bit odd at first but it's only for testing purposes.

If it works narrow it down by placing files back into the Preferences folder in small groups starting at either end of most likely, or least likely, till you hit the problematic one.

stephan.works
Jan 4, 2010, 04:47 PM
I'm sorry I didn't reply... I tried but I didn't solve the problem.
Now I'm working on different projects and the debugger works as expected.

Thank you for your help!