Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [committed] store sp in alpha_push_dummy_call
@ 2003-06-01 18:13 Richard Henderson
  2003-06-01 18:24 ` Andrew Cagney
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Henderson @ 2003-06-01 18:13 UTC (permalink / raw)
  To: gdb-patches; +Cc: cagney

Apparently, push_dummy_call is expected to update the sp:

  /* NOTE: cagney/2003-03-23: Disable this code when there is a
     push_dummy_call() method.  Since that method will have already
     stored the stack pointer (as part of creating the fake call
     frame), and none of the code following that code adjusts the
     stack-pointer value, the below call is entirely redundant.  */
  if (DEPRECATED_DUMMY_WRITE_SP_P ())
    DEPRECATED_DUMMY_WRITE_SP (sp);

Andrew, you have the same problem in your mips push_dummy_call
routines, from which I was pattern matching.


r~


	* alpha-tdep.c (alpha_push_dummy_call): Store sp.  Tidy copies
	from arg_reg_buffer to regcache to avoid double conversion.

Index: alpha-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-tdep.c,v
retrieving revision 1.89
diff -c -p -d -r1.89 alpha-tdep.c
*** alpha-tdep.c	1 Jun 2003 16:02:50 -0000	1.89
--- alpha-tdep.c	1 Jun 2003 17:00:25 -0000
*************** alpha_push_dummy_call (struct gdbarch *g
*** 314,326 ****
    /* Load the argument registers.  */
    for (i = 0; i < required_arg_regs; i++)
      {
!       LONGEST val;
! 
!       val = extract_unsigned_integer (arg_reg_buffer + i*ALPHA_REGISTER_SIZE,
! 				      ALPHA_REGISTER_SIZE);
!       regcache_cooked_write_signed (regcache, ALPHA_A0_REGNUM + i, val);
!       regcache_cooked_write_signed (regcache, ALPHA_FPA0_REGNUM + i, val);
      }
  
    return sp;
  }
--- 314,327 ----
    /* Load the argument registers.  */
    for (i = 0; i < required_arg_regs; i++)
      {
!       regcache_cooked_write (regcache, ALPHA_A0_REGNUM + i,
! 			     arg_reg_buffer + i*ALPHA_REGISTER_SIZE);
!       regcache_cooked_write (regcache, ALPHA_FPA0_REGNUM + i,
! 			     arg_reg_buffer + i*ALPHA_REGISTER_SIZE);
      }
+ 
+   /* Finally, update the stack pointer.  */
+   regcache_cooked_write_signed (regcache, ALPHA_SP_REGNUM, sp);
  
    return sp;
  }


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [committed] store sp in alpha_push_dummy_call
  2003-06-01 18:13 [committed] store sp in alpha_push_dummy_call Richard Henderson
@ 2003-06-01 18:24 ` Andrew Cagney
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cagney @ 2003-06-01 18:24 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gdb-patches, cagney

> Apparently, push_dummy_call is expected to update the sp:
> 
>   /* NOTE: cagney/2003-03-23: Disable this code when there is a
>      push_dummy_call() method.  Since that method will have already
>      stored the stack pointer (as part of creating the fake call
>      frame), and none of the code following that code adjusts the
>      stack-pointer value, the below call is entirely redundant.  */
>   if (DEPRECATED_DUMMY_WRITE_SP_P ())
>     DEPRECATED_DUMMY_WRITE_SP (sp);

THe comment is out-of-date - the check was removed but the comment not 
updated.  MIPS still supplies write_sp and hence writes the SP that way :-(

> Andrew, you have the same problem in your mips push_dummy_call
> routines, from which I was pattern matching.

The d10v is a safer bet.

Andrew



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-06-01 18:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-01 18:13 [committed] store sp in alpha_push_dummy_call Richard Henderson
2003-06-01 18:24 ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox