Re: variable question?
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