On Tue, Jan 6, 2009 at 9:46 AM, Bernhard Walle
<bernhard.walle@gmx.de> wrote:
> Sorry it DOES work. When i step over the last assignment to the end of the
> function block, XCode doesn't update the value of ret in the debugging
> window. It still displays 0xdeadbeaf, even though the value has changed. So
> it did return a value. I wonder if this is intended. I can't think of a good
> reason why XCode it would work like that.
That could be an optimisation. Do you compile with -O0 (or without any
-O)?
I accidentally had it set to -Os, but changing it back to -O0 doesn't seem to make a difference in this case. You may be right about the optimization though, because if I put an extra dummy statement in like "ret = ret" it is also skipped by gdb.
Thijs