Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

stephan.works

macrumors member
Original poster
Apr 29, 2008
33
0
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 :)
 
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?
 
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.
 
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?
 
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.
 
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'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!
 
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.
 
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.
 

Attachments

  • project.pbxproj.txt
    20.9 KB · Views: 112
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!
 
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.
 
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!
 

Attachments

  • xcode.jpg
    xcode.jpg
    113.9 KB · Views: 90
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"?
 
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.
 
I just uninstalled and reinstalled Xcode... didn't help.
I also tried (again) to delete the preferences file... no help.
 
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?
 
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.
 
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.
 
#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!
 
Any other idea on how to solve this Xcode problem (which apparently is linked to my account)?

Thanks!
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.