Xcode debugger and C++ global/file scope variables.

Member
Posts: 321
Joined: 2004.10
Post: #1
Probably stupid question, but here goes. I've got variables defined at the
top of a file before the main() function. So these variables are are at global
(or is it file?) scope. (Btw, what exactly is the difference between global and
file scope?). They are definitly definitions. Like:

MyClass mine;
Unit *unit = 0;

When I go into the debugger, the variable listing shows "Arguments" "Locals"
"File Statics" and "Globals". Clicking on globals opens up a browser window
which a subwindow of Libraries. Nothing of mine is in here.

I step thru main, but I still don't see anything. I do see the variables in
defined in main but I would have thought the debugger would start displaying
the variables defined outside of main(). Is there something I have to do
explicitly?

thanks.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
One of the "libraries" should be your own app, you should be able to find your globals in there, then explicitly add them to the list.

If you make it work, let me know... it seems spotty at best.
Quote this message in a reply
Member
Posts: 321
Joined: 2004.10
Post: #3
Worked great. Just selected Project name (minus the ugly extension) or
is it the application name? and up came a window with all the global variables.
Each variable had its own "view" box. I checked the ones I wanted and
they instantly came up. For what it's worth, I did store this window in the dock
rather than killing it with the red stop light.

This has been one of those little nagging things that has been bothering me
for months, but I always put in on the back burner. Until now.

THANKS!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Incorrect Environment Variables? bmantzey 4 4,849 May 11, 2012 09:45 PM
Last Post: OneSadCookie
  Xcode4: Debugger - how do you view class members? SparkyNZ 4 7,310 Jul 4, 2011 03:08 PM
Last Post: bdsowers
  XCode combining debugger and console?? Toontingy 2 5,407 Feb 16, 2010 07:55 PM
Last Post: Toontingy
  iPhone application always opens with the debugger! frogameleon 0 2,550 Mar 6, 2009 10:02 AM
Last Post: frogameleon
  using the xcode debugger NSDuo 8 5,699 Jan 14, 2009 04:52 PM
Last Post: NSDuo