From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26334 invoked by alias); 9 Mar 2004 15:20:42 -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 26324 invoked from network); 9 Mar 2004 15:20:41 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 9 Mar 2004 15:20:41 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1B0j25-00077C-4H; Tue, 09 Mar 2004 10:20:37 -0500 Date: Fri, 19 Mar 2004 00:09:00 -0000 From: Daniel Jacobowitz To: Michael Elizabeth Chastain Cc: carlton@kealia.com, vinschen@redhat.com, gdb-patches@sources.redhat.com Subject: Re: [RFC/RFA] gdb.cp/classes.exp: Don't try to print local variable out of scope Message-ID: <20040309152037.GA27279@nevyn.them.org> Mail-Followup-To: Michael Elizabeth Chastain , carlton@kealia.com, vinschen@redhat.com, gdb-patches@sources.redhat.com References: <20040309151111.DE3094B104@berman.michael-chastain.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040309151111.DE3094B104@berman.michael-chastain.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2004-03/txt/msg00193.txt.bz2 On Tue, Mar 09, 2004 at 10:11:11AM -0500, Michael Chastain wrote: > Right. > > I want to raise the question: is this really a bug in the gdb test suite, > or is it a bug in gcc? > > That is: is a local variable required to exist at the closing brace of a > function? > > I think your answer is "no, it's not required to exist, therefore the > gdb test suite should change". My answer is "reluctantly, no, > it's not required to exist"; I don't think the famous gcc -O0 > debug info clause covers this case. I'm curious what drow and > carlton and other people have to say. > > void foo () > { > int i; > i = 1; > bar (i); > } > > (gdb) break bar > (gdb) run > (gdb) finish > (gdb) print i > > Is it okay for gcc to emit debug info that "i" is out of scope here? I think so. It's unfortunate. > misc.cc is used by three *.exp files so I do not want to touch it > at all, so I am dis-approving your patch. I will write a patch to > remove the "gdb_test next" in test_enums instead. Duplicate the file, then, since we've decided this is a bad practice? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26334 invoked by alias); 9 Mar 2004 15:20:42 -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 26324 invoked from network); 9 Mar 2004 15:20:41 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 9 Mar 2004 15:20:41 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1B0j25-00077C-4H; Tue, 09 Mar 2004 10:20:37 -0500 Date: Tue, 09 Mar 2004 15:20:00 -0000 From: Daniel Jacobowitz To: Michael Elizabeth Chastain Cc: carlton@kealia.com, vinschen@redhat.com, gdb-patches@sources.redhat.com Subject: Re: [RFC/RFA] gdb.cp/classes.exp: Don't try to print local variable out of scope Message-ID: <20040309152037.GA27279@nevyn.them.org> Mail-Followup-To: Michael Elizabeth Chastain , carlton@kealia.com, vinschen@redhat.com, gdb-patches@sources.redhat.com References: <20040309151111.DE3094B104@berman.michael-chastain.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040309151111.DE3094B104@berman.michael-chastain.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2004-03.o/txt/msg00193.txt Message-ID: <20040309152000.ythIefHRBPpVRFegVThv4OoCZSuNzHQqBR70fSHkO_A@z> On Tue, Mar 09, 2004 at 10:11:11AM -0500, Michael Chastain wrote: > Right. > > I want to raise the question: is this really a bug in the gdb test suite, > or is it a bug in gcc? > > That is: is a local variable required to exist at the closing brace of a > function? > > I think your answer is "no, it's not required to exist, therefore the > gdb test suite should change". My answer is "reluctantly, no, > it's not required to exist"; I don't think the famous gcc -O0 > debug info clause covers this case. I'm curious what drow and > carlton and other people have to say. > > void foo () > { > int i; > i = 1; > bar (i); > } > > (gdb) break bar > (gdb) run > (gdb) finish > (gdb) print i > > Is it okay for gcc to emit debug info that "i" is out of scope here? I think so. It's unfortunate. > misc.cc is used by three *.exp files so I do not want to touch it > at all, so I am dis-approving your patch. I will write a patch to > remove the "gdb_test next" in test_enums instead. Duplicate the file, then, since we've decided this is a bad practice? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer