From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18170 invoked by alias); 8 Mar 2004 14:54:56 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 18162 invoked from network); 8 Mar 2004 14:54:55 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 8 Mar 2004 14:54:55 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1B0M9e-0004Fq-Lf for ; Mon, 08 Mar 2004 09:54:54 -0500 Date: Mon, 08 Mar 2004 14:54:00 -0000 From: Daniel Jacobowitz To: gdb@sources.redhat.com Subject: Re: What is gdb.base/structs2.exp actually testing? Message-ID: <20040308145454.GA16299@nevyn.them.org> Mail-Followup-To: gdb@sources.redhat.com References: <20040308144154.GE11141@cygbert.vinschen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040308144154.GE11141@cygbert.vinschen.de> User-Agent: Mutt/1.5.1i X-SW-Source: 2004-03/txt/msg00044.txt.bz2 On Mon, Mar 08, 2004 at 03:41:54PM +0100, Corinna Vinschen wrote: > Hi, > > the subject already contains the question. What is the structs2 test > good for? It's really not clear to me. There's a PR 13536 mentioned > in the first line of structs2.c but this is a PRMS number and searching > the gdb-patches archive didn't give me any useful hint. Is PRMS still > accessible somewhere? > > The problem with this test is that it is based on the assumption, that > GCC would not optimize away unused variables. The register arguments > to param_reg are not reallyused, instead they only get values assigned. > GCC is able to recognize this and to optimize away these assignments > entirely, even in the non-optimize case! This happens for example on > the SH target. > > The consequence of this fact is that the binary doesn't contain any > debug information for the given register variables, so GDB doesn't know > about them. In turn the testcase has two fails: > > FAIL: gdb.base/structs2.exp: structs2 continue1 (PRMS 13536) > FAIL: gdb.base/structs2.exp: structs2 continue2 (PRMS 13536) > > due to the fact that the arguments are not printed, when the breakpoint > is hit: > > Breakpoint 2, param_reg () at ... > > Are these tests really useful or shouldn't they either be dropped or > modified to accomodate the above case? Personally, that seems like a very dubious optimization for GCC to be making at -O0... we can't change the calling convention at -O0, so the arguments are there, so GCC ought to emit enough information for us to find them. You didn't mention what compiler version you're testing with... -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer