This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RFA: AIX 64-bit mega-patch


On Jun 13,  4:53pm, David Edelsohn wrote:

> 	There are a couple of problems with dummy frames:
> 
> 1) The call dummy instruction sequence (e.g., rs6000_call_dummy_words[])
> is not up to date.  AIX 3.1 used "cror 15,15,15", but AIX 3.2.4 changed
> this to "cror 31,31,31" which doesn't trample a saved condition register.
> In AIX 4.1 and above, the POWER architecture uses "cror 31,31,31" and the
> PowerPC architecture uses the new "nop" instruction (ori 0,0,0).
> 
> 2) The call dummy instruction sequence has never fixed up the TOC after
> returning from a call.  I guess that this never is used to call a function
> in a different module.  The "cror 15,15,15" , "cror 31,31,31" , or "nop"
> would be changed by the linker to restore the TOC which the call dummy
> sequence is storing in the stack frame.
> 
> 3) rs6000_fix_call_dummy() defines TOC_ADDR_OFFSET as 20, but the location
> to store the TOC in the stack frame depends on 32-bit versus 64-bit mode.
> In 64-bit mode, it is at an offset of 40.  See the comments above
> gcc/config/rs6000/rs6000.c:rs6000_stack_info() for details.

Whoa... (I should have read more of the patch.)

Rather than messing with call dummies, I would really prefer that we
use generic dummy frames (see "GENERIC DUMMY FRAMES" in blockframe.c
for more info.)  GNU/Linux/PPC already uses these as did the AIX 4.3
release for PowerPC that we did earlier this year.

Aside from the problems that David has noted above, I have found that
you can not always reliably write the dummy frames to the stack and
expect the caches to be synchronized.  The generic dummy frame
machinery avoids this problem and makes the implementation of calling
inferior functions much simpler.  (We'll even be able to get rid of
the "Come on, guys!  -- gnu@cygnus.com, Aug 92" comment.)

Kevin

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]