Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dbx/cc troubles

0 views
Skip to first unread message

James

unread,
Feb 1, 2010, 9:01:29 PM2/1/10
to
I compile the following code with cc -g -xdebugformat=dwarf

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

James

unread,
Feb 2, 2010, 8:30:21 AM2/2/10
to

Additional version information:
OS: SunOS 5.10
Processor: UltraSparc IV, Arch. version: sparcV9

James

unread,
Feb 8, 2010, 8:28:38 AM2/8/10
to
0 new messages