• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: variable question?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: variable question?


  • Subject: Re: variable question?
  • From: Jim Ingham <email@hidden>
  • Date: Mon, 31 Jan 2005 10:19:43 -0800

Markian,

Normally, the combination "-g -O0" would cause the compiler to make space for "e" regardless of whether you use it or not. And, in fact, if you use just "-O0" there will actually be stack space set aside for "e". However, "-g" is not quite as simple a flag as it seems. What "-g" means is "use the default debug info generation that the maintainers of gcc for this platform think is advisable." On Mac OS X at present, "-g" generates stabs format debug information using the "used" optimization. This is a way of compacting debug information that Apple introduced a couple of years ago (and has since been adopted by the FSF community) where you ONLY dump debug info for types and variables that are actually used. Since "e" is not actually used, it doesn't get any debug info, and so the debugger can't find it.

I actually filed a bug a while ago that the "used" optimization only be applied to types, not to variables. But because most cases where it comes into affect are pretty artificial, the bug hasn't risen very high up on the gcc folks queue.

If it is really important that you force gcc to generate debug info for "e", you can use the "-gfull" flag instead, which turns off the "used" optimization. It will in most cases make the debug info bigger, however.

Hope this helps,

Jim

On Jan 30, 2005, at 8:15 PM, Markian Hlynka wrote:

shouldn't compiling with -g force e to exist?
Markian
On Jan 30, 2005, at 12:23, Chris Espinosa wrote:
On Jan 30, 2005, at 11:16 AM, Michael de Haan wrote:
The reason I am unable to view "e" in the debugger is because it has only been declared and not initialized?
Or is there a setting I am missing.
'e' doesn't exist. Since it's never assigned nor used, the compiler hasn't even allocated space for it to be stored. There's no information in your compiled code about where 'e' should be, so the debugger cannot show it.
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >variable question? (From: Michael de Haan <email@hidden>)
 >Re: variable question? (From: Chris Espinosa <email@hidden>)
 >Re: variable question? (From: Markian Hlynka <email@hidden>)

  • Prev by Date: re: Altivec 'bug' or limitation?
  • Next by Date: minimal install for supporting distributed builds?
  • Previous by thread: Re: variable question?
  • Next by thread: Re: variable question?
  • Index(es):
    • Date
    • Thread