> You can force your writes to the stack to not be removed by making
> them use UNSPEC_VOLATILE.  You would write special define_insns for
> this.

Is there an architecture port that has done this already ?

> Not to miss the obvious, note that this will hurt optimization.
> However, if you need to have the argument values available for all
> backtraces, then I'm not sure what else to recommend.  In general gcc
> will discard argument values that are not needed.

I know. Personally, I have not been advocating this but for the
moment, we have been making a study at what would be needed and how
bad it would be.

However, I've been going through the first step : running GDB, setting
a break-point and doing a continue to see what I get and try to get
the information right for O3 too.

In O0, I get:
Breakpoint @@ 1, foo (a=4, b=3, c=2, d=1) at hello.c:10

In O3, I get:
Breakpoint @@ 1, foo (a=Variable "a" is not available.) at hello.c:11

Now, I've been able to tell GCC to save those arguments exactly at the
same address in O3 as it does in O0 (I hacked the varargs saving
arguments code so that it would do the same thing for all functions).

It seems that, in the O0 case, the Dwarf information is automatically
propagated to say "The input register is now here", but when I do it
in O3, I'm issuing the information in the same way.

What am I exactly missing? Any ideas why GDB would not have enough
information in this case?

Thanks,
Jean Christophe Beyler

Reply via email to