I will try to add more details about my issue. Another way of putting this is :
For my architecture there is: - A certain number of input registers which allow calls without going on the stack - There is not automatically a frame pointer on the stack either What is needed, from the GCC side, to provide GDB with enough information to preserve the arguments that are passed and allow to see a backtrace and walk the stack. Do we need to change the ABI and store certain indispensable things on the stack for GDB ? I see very little documentation about this or questions, so I don't know exactly where to look to. Note: in O0 levels, the compiler does actually store the arguments on the stack and has a frame pointer, this gives GDB the possibility to do show the arguments passed to a function at a break point but not the backtrace. In O3, however, I don't even get the arguments correct. Thanks for any input, Jc On Tue, Nov 3, 2009 at 2:01 PM, Jean Christophe Beyler <jean.christophe.bey...@gmail.com> wrote: > 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 >