Xcode/gdb type confusion for floats
Xcode/gdb type confusion for floats
- Subject: Xcode/gdb type confusion for floats
- From: Kai-Mikael Jää-Aro <email@hidden>
- Date: Tue, 22 May 2007 14:56:02 +0200
I spent some time vainly debugging a piece of Objective-C code where
the variables apparently were getting random values, until I realised
the problem lay in the debugger.
To be precise, what happens is that all local variables in my method
that have the type float display incorrect values in the variable
view. When I changed the variables' types to double, they displayed
the correct values. One suspects that the compiler or debugger
treated the variables as doubles anyway, but then only displayed half
of the bits, or possibly vice versa - trying View Value As… makes no
difference for the display.
I attempted to make a sample program to demonstrate this, but have
not been able to reproduce the behaviour in shorter programs.
For the moment I can work around the problem by using only double
variables, but I'm worried about what the underlying problem might be
and if it is likely to bite me further down the line.
Has anybody noticed similar behaviour? I am using Xcode 2.4.1,
compiling with gcc 4.0 on a PowerBook G4 running OS X 10.4.9 with the
latest patches.
--
Kai-Mikael Jää-Aro <email@hidden>
Telestream AB Tel: +46 70 202 6494
Rådmansgatan 49 Skype: kaimikaeljaaaro
SE-113 60 Stockholm AIM: email@hidden
Sweden
_______________________________________________
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