This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: ppc64 unwinding problem


On Sat, Jul 12, 2003 at 02:03:34AM +0200, Jakub Jelinek wrote:
> That does not change anything on the above problem though.
> If rs6000_emit_eh_toc_restore is kept (and unchanged), it would still
> segfault no matter whether it has unwind info or whether
> MD_FALLBACK_FRAME_STATE_FOR does the job.

True.

> ... at the end of CIE cfa program might do the job.

Actually, it won't.  DW_CFA_expression is defined to yield an address
(not a value), and thus DW_OP_reg2 doesn't give us what we want.

We could possibly solve this via magic code in uw_update_context.

/* If the current unwind info (FS) does not contain explicit info
   saving R2, then we have to do a minor amount of code reading to
   figure out if it was saved.  The big problem here is that the 
   code that does the save/restore is generated by the linker, so
   we have no good way to determine at compile time what to do.  */
#define MD_FROB_UPDATE_CONTEXT(CTX, FS)				\
  do {								\
    if (FS->regs.reg[2].how == REG_UNSAVED)			\
      {								\
	if (*(unsigned int *)context->ra == 0xE8410028)		\
	  _Unwind_SetGRPtr (CTX, 2, CTX->cfa + 16);		\
      }								\
  } while (0)

Which I guess may solve the binary compatibility problem.


r~


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