Dear all,

I've been working on handling the Debugging information for the use of
GDB on my port. Though I definitely know that, when compiling in -O3,
some information is lost and the debugger can't always have all the
information, I'd like to at least keep the values of the arguments
when doing a backtrace. Since my architecture uses register passing
for arguments, relatively quickly this is lost since it is not stored
on the stack.

Therefore, I would like to, when doing a backtrace, have the argument
information. I asked a few clarifications on the GDB mailing list and,
it seems, that I need to copy the arguments on the stack (like what is
done by default when using -O0). However, when compiling in -O3, the
compiler of course removes these stores on the stack and relies solely
(and justly so) on the input registers.

I've reread the GCC internals and have been looking at anything
regarding the stack but can't seem to figure this one out. How exactly
do I explain to the compiler that I want to keep those spills to the
stack for debugging purposes ?

Thanks for your help,
Jc

Reply via email to