XCODE 4 & viewing global variables

Discussion in 'Mac Programming' started by hajiman, Jul 17, 2011.

  1. hajiman macrumors newbie

    Joined:
    Feb 2, 2011
    #1
    I am a little embarrassed that after several hours of searching I couldn't find the answer to such a simple task - how to view global variables in XCODE 4. I had no problems viewing globals in XCODE 3 but can't seem to find a way in XCODE 4.
    I am running a Console application and am developing in C/C++. I am enclosing a snapshot of my XCODE project and a sample file/globals I am trying to inspect.
    How do I display the contents of any of the globals shown in the serial_utils.cpp window? (e.g. GPS_COMM_PORT)
     

    Attached Files:

  2. szymczyk macrumors regular

    Joined:
    Mar 5, 2006
    #2
    Looking at your screenshot, you're not doing anything wrong. Selecting All from the menu at the top of the variables view should show the global variables. I tested using global variables in a command-line C++ project and they didn't show up for me with GDB. Switching to LLDB made the global variables appear in the variables view. Use the scheme editor to change the debugger. Choose Edit Scheme from the Scheme pop-up menu in the project window toolbar to open the scheme editor. Select the Run step in the scheme editor to change the debugger.

    If switching to LLDB doesn't work, ask your question on Apple's Xcode mailing list. If they don't have a solution, file a bug report with Apple.
     
  3. hajiman thread starter macrumors newbie

    Joined:
    Feb 2, 2011
    #3
    Thanks for the suggestion. I tried switching over to LLDB but still am not able to view global variables. I am glad I am not the only one experiencing this problem. I'll try the xcode mailing list.
     

Share This Page