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

hajiman

macrumors newbie
Original poster
Feb 2, 2011
10
0
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)
 

Attachments

  • Screen capture - XCODE 4.jpg
    Screen capture - XCODE 4.jpg
    489.5 KB · Views: 603

szymczyk

macrumors regular
Mar 5, 2006
187
17
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.
 

hajiman

macrumors newbie
Original poster
Feb 2, 2011
10
0
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.