[RFA/hppa] Fix pb in inferior function call

Joel Brobecker brobecker@gnat.com
Wed Mar 31 18:47:00 GMT 2004


> > 2004-04-30  J. Brobecker  <brobecker@gnat.com>
> > 
> >         * hppa-tdep.c (hppa32_push_dummy_call): Set the Stack Pointer.
> >         (hppa64_push_dummy_call): Likewise.
> > 
> > The change has been tested on hppa32-hpux11.00, and it fixes roughly
> > 500 regressions (yay! :-). It also brings the duration of the testsuite
> > run from several hours down to about 45 mins.
> > 
> > I didn't test the change for hppa64, but it seems pretty obvious if
> > the hppa32 one is correct.
> > 
> > OK to apply?
> 
> OK.  You're right; push_dummy_call should update the stack pointer
> itself.

Thanks. Checked in.

Andrew asked:
> Joel, do you think a pull up of the hppa stuff onto the 6.1 branch would
> be useful?  (it can only break HP/UX so is "mostly harmless").

Yes, I think so. I tested and then committed the attached patch for the
branch (there was one minor edit to make).

2004-04-31  J. Brobecker  <brobecker@gnat.com>
  
        * hppa-tdep.c (hppa32_push_dummy_call): Set the Stack Pointer.
        (hppa64_push_dummy_call): Likewise.

Thanks,
-- 
Joel
-------------- next part --------------
Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.129.2.1
diff -u -p -r1.129.2.1 hppa-tdep.c
--- hppa-tdep.c	10 Mar 2004 20:06:08 -0000	1.129.2.1
+++ hppa-tdep.c	31 Mar 2004 18:41:17 -0000
@@ -2269,6 +2269,9 @@ hppa32_push_dummy_call (struct gdbarch *
   /* Set the return address.  */
   regcache_cooked_write_unsigned (regcache, RP_REGNUM, bp_addr);
 
+  /* Update the Stack Pointer.  */
+  regcache_cooked_write_unsigned (regcache, SP_REGNUM, param_end + 32);
+
   /* The stack will have 32 bytes of additional space for a frame marker.  */
   return param_end + 32;
 }
@@ -2392,6 +2395,9 @@ hppa64_push_dummy_call (struct gdbarch *
   
   /* Set the return address.  */
   regcache_cooked_write_unsigned (regcache, RP_REGNUM, bp_addr);
+
+  /* Update the Stack Pointer.  */
+  regcache_cooked_write_unsigned (regcache, SP_REGNUM, sp + 64);
 
   /* The stack will have 64 bytes of additional space for a frame
      marker.  */


More information about the Gdb-patches mailing list