static double foo(double bar)
{
bar++;
return bar;
}
int main()
{
foo(0.0);
return 0;
}
When I load the binary into dbx, set a breakpoint at the line
containing "return bar;" and print bar; dbx gives me "bar = 0.0"
If I compile with CC, I get "bar = 1.0".
The dwarf debug info generated by CC sets the DW_AT_location for bar
to the correct stack frame offset. This is not the case for cc.
I am using sun studio 12. Both compilers are version 5.9.
Is there a cc command line option to correct the dwarf debug info?
Thanks,
James
Additional version information:
OS: SunOS 5.10
Processor: UltraSparc IV, Arch. version: sparcV9
This bug is fixed by the following patch:
http://sunsolve.sun.com/search/document.do?assetkey=1-21-124867-12-1