From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10563 invoked by alias); 3 Jan 2012 15:52:35 -0000 Received: (qmail 10405 invoked by uid 22791); 3 Jan 2012 15:52:32 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,TW_EG X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Jan 2012 15:52:18 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id AC3182BAFB7; Tue, 3 Jan 2012 10:52:17 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7-WdG0p9asfv; Tue, 3 Jan 2012 10:52:17 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 375A22BAF93; Tue, 3 Jan 2012 10:52:16 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id CDA2A145615; Tue, 3 Jan 2012 19:52:06 +0400 (RET) Date: Tue, 03 Jan 2012 15:52:00 -0000 From: Joel Brobecker To: Ulrich Weigand Cc: Jan Kratochvil , gdb-patches@sourceware.org Subject: Re: Regression on PowerPC (Re: [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #3) Message-ID: <20120103155206.GM2730@adacore.com> References: <20120102025758.GA20654@host2.jankratochvil.net> <201201031444.q03Eir77009359@d06av02.portsmouth.uk.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201031444.q03Eir77009359@d06av02.portsmouth.uk.ibm.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00096.txt.bz2 > > Checked in: > > http://sourceware.org/ml/gdb-cvs/2012-01/msg00013.html > > Checked in 7.4: > > http://sourceware.org/ml/gdb-cvs/2012-01/msg00014.html ARGH! Thanks for letting us know. > Switching to the ON_STACK method fixes this for me. But I'm not sure > if there are other platforms beside PowerPC that have the same problem ... > Maybe we ought to default to ON_STACK (at least on Linux?)? But this wouldn't prevent the same sort of problem on other platforms. I think we don't know enough to keep this change in as is. It seems to me, at this point, that indeed the best way to solve the original problem is to transition the GNU/Linux platforms to ON_STACK. We then no longer need the patch that causes the regression. > Note that it's a bit annoying that we need to provide a push_dummy_code > routine in order to be able to use ON_STACK. Maybe there should be a > default implementation based on gdbarch_inner_than/gdbarch_frame_align_p > and the breakpoint length? Agreed. We actually used to have such as routine, and deleted it a while ago, after the last caller got removed. I reposted it when I sent the patch series to add support for VxWorks. The removal: http://www.sourceware.org/ml/gdb-patches/2008-09/msg00320.html The code: > static CORE_ADDR > rs6000_vxworks_push_dummy_code (struct gdbarch *gdbarch, > CORE_ADDR sp, CORE_ADDR funaddr, > struct value **args, int nargs, > struct type *value_type, > CORE_ADDR *real_pc, CORE_ADDR *bp_addr, > struct regcache *regcache) > { > /* Something here to findout the size of a breakpoint and then > allocate space for it on the stack. */ > int bplen; > /* This code assumes frame align. */ > gdb_assert (gdbarch_frame_align_p (gdbarch)); > /* Force the stack's alignment. The intent is to ensure that the SP > is aligned to at least a breakpoint instruction's boundary. */ > sp = gdbarch_frame_align (gdbarch, sp); > /* Allocate space for, and then position the breakpoint on the stack. */ > if (gdbarch_inner_than (gdbarch, 1, 2)) > { > CORE_ADDR bppc = sp; > gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen); > sp = gdbarch_frame_align (gdbarch, sp - bplen); > (*bp_addr) = sp; > /* Should the breakpoint size/location be re-computed here? */ > } > else > { > (*bp_addr) = sp; > gdbarch_breakpoint_from_pc (gdbarch, bp_addr, &bplen); > sp = gdbarch_frame_align (gdbarch, sp + bplen); > } > /* Inferior resumes at the function entry point. */ > (*real_pc) = funaddr; > return sp; > } -- Joel