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

chomper

macrumors newbie
Original poster
Dec 26, 2010
23
0
Central Europe
Hello,

if I run my program in Xcode and my program returns the value of 1 in the main function or I call the exit(1) function anywhere in my code, the console displays this message:

Program exited with status value: 1. (gdb)

Here comes the but: If I try to run or build + run my program again, Xcode behaves as if my program were running - it shows the STOP EXECUTABLE dialog window asking me to terminate the program. Why?
 
Hello,

if I run my program in Xcode and my program returns the value of 1 in the main function or I call the exit(1) function anywhere in my code, the console displays this message:

Program exited with status value: 1. (gdb)

Here comes the but: If I try to run or build + run my program again, Xcode behaves as if my program were running - it shows the STOP EXECUTABLE dialog window asking me to terminate the program. Why?

Exit status of zero indicates the program finished happily, no (0) worries mate. Any other exit status value indicates failure. Take a look at the debugger to see if it is retaining context (in order to help you figure out what went wrong).
 
Your program has existed, it's just the debugger that's hanging around. But because your program has existed, there nothing much you can do with the debugger.

This seems to be a "mis-feature" of XCode 3. This behaviour has changed in the current developer preview of XCode 4. There the debugging session is closed regardless of the exit status of the program being debugged.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.