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: PowerPC64 skip_prologue patch


On Apr 23, 11:41pm, David Edelsohn wrote:

> 	What is the status of the PowerPC64 skip_prologue patch?  Without
> this patch, GDB does not recognize standard PowerPC64 prologue
> instructions which makes debugging very difficult.

I'm working on it.  Since we don't have a copyright assignment for
these changes, I've been told that I should pseudo-cleanroom it. 
Basically, what I'm going to do is look at the testsuite failures that
occur on PowerPC64 without the patch that you've posted, do my own
analysis, and create my own fixes.  I fully expect that the patches
that I come up with will look remarkably similar to the ones that
you've posted.  (Sigh.)

BTW, the patch you've just posted has more than just skip_prologue()
changes in it.  The following portions have already been dealt with:

> @@ -842,9 +878,6 @@
>  		       int nargs, struct value **args, struct type *type,
>  		       int gcc_p)
>  {
> -#define	TOC_ADDR_OFFSET		20
> -#define	TARGET_ADDR_OFFSET	28
> -
>    int ii;
>    CORE_ADDR target_addr;
>  

The above was taken care of by:

2002-04-08  Kevin Buettner  <kevinb@redhat.com>

	From Jimi X <jimix@watson.ibm.com>:
	* rs6000-tdep.c (rs6000_fix_call_dummy): Delete unused macro
	definitions for TOC_ADDR_OFFSET and TARGET_ADDR_OFFSET.


> @@ -975,7 +1008,8 @@
>  ran_out_of_registers_for_arguments:
>  
>    saved_sp = read_sp ();
> -#ifndef ELF_OBJECT_FORMAT
> +
> +#if !defined (ELF_OBJECT_FORMAT) || defined (ELF64_OBJECT_FORMAT)
>    /* location for 8 parameters are always reserved. */
>    sp -= wordsize * 8;
>  
> @@ -984,7 +1018,7 @@
>  
>    /* stack pointer must be quadword aligned */
>    sp &= -16;
> -#endif
> +#endif /* ! ELF_OBJECT_FORMAT || ELF64_OBJECT_FORMAT */
>  
>    /* if there are more arguments, allocate space for them in 
>       the stack, then push them starting from the ninth one. */

For the above patch, I decided that ELF_OBJECT_FORMAT was no
longer needed.  So I did:

2002-04-08  Kevin Buettner  <kevinb@redhat.com>

	* config/powerpc/tm-ppc-eabi.h (ELF_OBJECT_FORMAT): Delete.
	* rs6000-tdep.c (rs6000_push_arguments): Eliminate
	ELF_OBJECT_FORMAT ifdef.

> @@ -1284,6 +1318,16 @@
>        if (fi->next->signal_handler_caller)
>  	return read_memory_addr (fi->next->frame + SIG_FRAME_LR_OFFSET,
>  				 wordsize);
> +      else if (wordsize == 8)
> +	{
> +	  /* FIXME: If this is ever called, cause skip prologue should
> +	     get it right, then on a 64-bit target DEFAULT_LR_SAVE is
> +	     different (should be 16 not 8), if target is 32 bits then
> +	     we let the definition decide since it is ABI
> +	     dependent. */
> +	  return read_memory_addr (FRAME_CHAIN (fi) + 16,
> +				     wordsize);
> +	}
>        else
>  	return read_memory_addr (FRAME_CHAIN (fi) + DEFAULT_LR_SAVE,
>  				 wordsize);

I dealt with this differently too...

2002-04-12  Kevin Buettner  <kevinb@redhat.com>

	* ppc-tdep.h (struct gdbarch_tdep): Add new member ``lr_frame_offset''.
	* rs6000-tdep.c (rs6000_frame_saved_pc): Use ``lr_frame_offset''
	from tdep struct instead of DEFAULT_LR_SAVE.
	(rs6000_gdbarch_init): Initialize ``lr_frame_offset''.
	* config/powerpc/tm-ppc-eabi.h (DEFAULT_LR_SAVE): Delete.
	* config/rs6000/tm-rs6000.h (DEFAULT_LR_SAVE): Delete.


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