This is the mail archive of the gdb-patches@sources.redhat.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]
Other format: [Raw text]

Re: [patch/rfa:rs6000] Don't use ->prev


On Apr 14, 12:52pm, Andrew Cagney wrote:

> The rs6000 has me puzzled. I think the ->frame contains the address of 
> the wrong end of the frame!  If ->frame pointed at the frame's start, 
> the code below wouldn't even be needed.  Anyway, I've changed it to use 
> frame_chain() (I don't see regressions on NetBSD/PPC.  The other 
> possability would be to risk a (recursive) get_prev_frame() call.
> 
> Anyway, is the rs6000 ok?
> 
[...]
> 	* rs6000-tdep.c (frame_get_saved_regs): Use rs6000_frame_chain()
> 	instead of ->prev.

I think that your patch is okay so long as you use FRAME_CHAIN()
instead of rs6000_frame_chain().  Note that FRAME_CHAIN() may be set
to something other than rs6000_frame_chain() depending upon the ABI / OS.

At the moment though, it doesn't really matter too much since the
case -- signal handler trampolines -- that calling FRAME_CHAIN gets
right is broken in frame_get_saved_regs() anyway.  The Linux/PPC
target works around this deficiency by interposing some code which
computes the correct saved register locations for signal handler
callers instead of calling the rs6000_* version which invokes
rs6000_get_saved_register().

Kevin


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