Hi, On Fri, 2008-01-11 at 10:57 -0500, Daniel Jacobowitz wrote: > On Fri, Jan 11, 2008 at 01:55:20PM -0200, Luis Machado wrote: > > > How about an extra flag inside the gdbarch_tdep structure that > > > you'll be using inside the push dummy call? It would be a shame > > > duplicate this function when most of it is common. > > > > Yes. This would work, but putting linux specific code inside the > > ppc-sysv-tdep.c file doesn't look quite right. But if there isn't a > > better way of doing this, should be OK. > > For practical reasons, this is how it is usually done. Actually, we won't need to go through the flag. I've checked and the PPC/Linux ABI conforms with the PPC/SysV ABI regarding Calling Sequences and the Stack layout. Considering we have a function with a great number of float parameters, exceeding the number of available FP registers, we need to store those parameters in the stack space, and then there's a problem with the ABI/GDB. The SysV ABI says we should promote exceeding float parameters (the ones that should go to the stack) to double, and store then with 8 bytes alignment in the stack. Trying to call a function like that, from within GDB, made it clear that some parameters were getting trashed, and this is due to the fact that GCC (XLC as well) doesn't promote floats to doubles and does not align them to 8 bytes in the stack. Actually, it just aligns the prototyped float parameters to 4 bytes in the stack. This is something that needs to be improved in the ABI text. I've attached a note next to the portion of code responsible for handling float parameters. The patch follows, with a minor change in the ABI handling for PPC32 and a testcase Thiago wrote to verify the problem. Comments? Regards, -- Luis Machado Software Engineer IBM Linux Technology Center