"GDB Running..." message when code debugged without error

Discussion in 'Mac Programming' started by gswans3, Aug 31, 2011.

  1. gswans3 macrumors newbie

    Aug 31, 2011
    Chaska, MN
    I'm relatively new to C++ and am learning it to understand the concepts before moving on to Objective C or others. I'm using Xcode 3.2 and using the Sam's Teach Yourself C++ in 24 hours book. Most of the programs compile and run just fine, and the message, "... ended normally" is displayed following the compiling. However, and it seems to be when using pointers and references, sometimes it displays, "... ended normally" and then displays, "GDB Running..."
    Some of those programs will run and some will not. Of those that run, I will sometimes get a segmentation fault, sometimes not.

    Does anyone know what may be going on here? Any help would be appreciated. Thank you very much.
  2. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX
    It sounds like sometimes your programs crash. When they crash the debugger is at the ready for you to get a stack trace, etc. When they don't you get the "ended normally" message. I believe XCode brings up a graphical debugging window when something bad happens, and you can then see where things went bad. If not you can use gdb at the console to help debug your code. You can look up GDB tutorials, but you can probably also choose debugger or something similar from the Window menu.

  3. gnasher729 macrumors P6


    Nov 25, 2005
    In XCode 3.2, start the program by pressing Command-Y instead of Command-R. (Command-Y starts it under the debugger). When your program would normally crash, you will end up in the debugger exactly at the point of the crash and can see what's going on.

Share This Page