From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25347 invoked by alias); 31 Mar 2004 04:35:07 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 25339 invoked from network); 31 Mar 2004 04:35:06 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 31 Mar 2004 04:35:06 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1B8XRR-0004jy-R4; Tue, 30 Mar 2004 23:35:05 -0500 Date: Wed, 31 Mar 2004 04:35:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA/hppa] Fix pb in inferior function call Message-ID: <20040331043505.GA18128@nevyn.them.org> Mail-Followup-To: Joel Brobecker , gdb-patches@sources.redhat.com References: <20040331041848.GO888@gnat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040331041848.GO888@gnat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2004-03/txt/msg00752.txt.bz2 On Tue, Mar 30, 2004 at 08:18:48PM -0800, Joel Brobecker wrote: > The assertion fails because we fail to locate the dummy_frame > in our dummy_frame_stack. The reason for the failure is that > the TOS stored in the dummy_frame we saved is different from > the stack_addr of the frame_id we built for the dummy_frame. > It's off by a few bytes. > > The stack_addr for the dummy frame is computed by reading the Stack > Pointer register. The TOS value is the value of SP after the dummy > frame has been pushed. > > If I understand correctly how this is all supposed to work, I think > we simply forgot to update the value of the SP register. Because the > function doesn't read its parameters from the stack (the struct is > passed via 2 registers), we don't see any noticeable effect on the > execution of the function we called. However, when we reach our > end-of-inferior-function-call, the value of the SP is back to the > original value, which doesn't match the saved TOS. > > 2004-04-30 J. Brobecker > > * 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. I think one of the previous dummy call mechanisms wasn't supposed to: if (DEPRECATED_DUMMY_WRITE_SP_P ()) DEPRECATED_DUMMY_WRITE_SP (sp); so it probably just got lost in a conversion. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer