Thread: XCode Debugging From Source Code
04-25-2008, 10:33 PM #1
XCode Debugging From Source Code
- Member Since
- Apr 25, 2008
I'm pretty new to programming. I got my hands on a beginner's book for C++ with a series of basic programs to type up, and I've been using XCode 1.5 on my OS 10.3.9 Powerbook to play around with it. I got through to the last chapter, which is on inheritance and polymorphism, and I get to the last sample program, a simple Blackjack program. I type it up and compile, and the program crashes early on a segfault.
Rather than comb the program for the error, I decide that this would be a good chance to figure out how to use XCode's debugger. The help pages I've been finding about XCode seem to suggest that I should be able to debug the program from the source code and see how things are linking together so I could find the exact line where things are messing up.
However, when I open the debugger, I hit a couple of problems. First of all, the debugger doesn't load the source code. If I pause the program in operation, I get some machine code to pop up, but I can't get the debug to actually run off the source. I can even go to the source code in the list of "targets" on the sidebar of the main window and drag it into the debug window, but it'll then basically ignore that and go back to dumping me off on the machine code.
Second, the segfault is occurring right after I get prompted to input a "how many players?" variable. When I run the program from the debugger, I can't seem to be able to give an input for that variable. For example, if I type "1" and hit enter, the cursor will just jump to the next line and leave white space. If I pause the program, the line "Undefined command: "1". Try "help"," pops up.
I've been looking around the net for some hints on making things run, but I'm not getting anything but the basic help pages. Could I get a hand with the troubleshooting?
This is the console window on running the program.
This is what happens when I "build and debug" the program. The program itself does not show up in the debug window. If I enter a number for the prompt in the console window, I come back with nothing.
If I pause the program, this occurs.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By sisyphus00 in forum OS X - Development and DarwinReplies: 1Last Post: 07-17-2011, 09:53 PM
By xkitsunex in forum OS X - Development and DarwinReplies: 1Last Post: 04-18-2011, 06:07 PM
By Wimsey in forum OS X - Development and DarwinReplies: 0Last Post: 02-03-2011, 12:02 AM
By skiabox in forum OS X - Development and DarwinReplies: 0Last Post: 11-07-2010, 05:44 PM
By cng11 in forum OS X - Development and DarwinReplies: 0Last Post: 03-29-2010, 12:30 AM