New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

XCode Debugging From Source Code


Post Reply New Thread Subscribe

 
Thread Tools
deanrayj

 
Member Since: Apr 25, 2008
Posts: 1
deanrayj is on a distinguished road

deanrayj is offline
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?

http://ohnoabear.com/dreamshade/debug0.jpg
This is the console window on running the program.

http://ohnoabear.com/dreamshade/debug1.jpg
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.

http://ohnoabear.com/dreamshade/debug2.jpg
If I pause the program, this occurs.
QUOTE Thanks

Post Reply New Thread Subscribe


« profiling with Saturn? | Ar/libtool deadlock in 10.5 »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
help me convert something, please. krrose27 Switcher Hangout 4 05-25-2007 03:10 AM
Adobe liberates Flex source code MacHeadCase Schweb's Lounge 0 04-28-2007 03:01 PM
New Xcode plug-in helps developers reuse code Murlyn OS X - Development and Darwin 0 11-10-2003 01:16 PM
Darwin 7.0 source code posted Murlyn OS X - Development and Darwin 1 10-28-2003 01:26 PM
Darwin 6.7 and 6.8 source code posted Murlyn OS X - Development and Darwin 0 09-23-2003 02:07 PM

All times are GMT -4. The time now is 06:12 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?