Fog Creek Software
Discussion Board

Stupid XCode question

Being mostly used to Visual Studio, I'm having some difficulty adapting to Apple's latest and greatest.

Yes, this is for homework, but I'm hoping someone will help me anyway.  ;>  We're writing simple command-line apps in an intro C++ class.  I'm starting my project as a "C++ tool" and I can't for the life of me figure out how to use the debugging environment.  I can interact with the program fine if I run (without debugging), but when I hit "build and debug," the debugger just sits there at the first call to cin.

So... where the heck am I supposed to type my input while debugging?  (Told you this was a stupid question.)

Sam Livingston-Gray
Friday, February 20, 2004

This may not be helpful, but if you are familiar with gdb at all, you should be bale to debug with that on OSX, from a command prompt. I think, anyway; the mac box at work has the gnu tools on it, and I was under the impression that they were standard on OSX.

Mike Swieton
Friday, February 20, 2004

Use the Debug -> Show Stdio menu item. This will allow you to interact with the program via stdio. Otherwise, your code gets to cin and then waits for input -- it doesn't automatically know to show the Stdio window. I guess this is because stdio may not necessarily map to the keyboard and screen.

C Rose
Friday, February 20, 2004

I'd found the gdb drawer, which was particularly confusing in that it seemed to be showing stdout, but not knowing the first thing about gdb, I had no idea how to proceed.

But the stdio window was what I was looking for.  Thanks!

Sam Livingston-Gray
Friday, February 20, 2004

Read the documentation?

Or, put a breakpoint somewhere and use the nice big buttons for go, step into, step over, step out of, and enjoy the nice local variable displays.

BTW the debugger in XCode *is* gdb. And you don't need to use the stdio very much from within XCode.

Brent Gulanowski
Sunday, February 22, 2004


I have another stupid Xcode uqestion. I'm debugging a program which uses pointers of the type:

double *pop;

where pop is an array of values. Is there an option in the debugger to see all the values in that array?
Because the value given by the debugger for that variable is a memory location (and the first value in that location), but I'm interested in the value at that location and also the followings,  not just the first one. One option is to define each of the values I want to see in the "Expressions" window, like:

and so on...
But when the array is so big, this is obviously not an option.

Any guidance on this matter will be very appreciated.

Thank you, Max.

Max Salazar
Monday, February 23, 2004

I just receive an answer in another forum. Just to close this topic here in case someone was interested.

This option is still not implemented in Xcode but is soported by GDB. So, you can use the "Expressions" window and use:


Which will give the 20 first elements of the array, for example.

If you want read more about this, have a look at:


the section on "artificial arrays" in the gdb manual.

[Thanks to Jim for his help.]

Max Salazar
Monday, February 23, 2004

Ok here is a bigger stupid XCODE question

I have a folder of c++ files and libraries that make into a app. This is a Geant4 example for those who have heard of it.

All I want to do is import all of the files into a Xcode project and modify from there. Is this possible?

Justin F. McDowell
Friday, June 04, 2004

*  Recent Topics

*  Fog Creek Home