This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC/RFA] gdb.cp/classes.exp: Don't try to print local variable out of scope
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 9 Mar 2004 09:17:52 -0500
- Subject: Re: [RFC/RFA] gdb.cp/classes.exp: Don't try to print local variable out of scope
- References: <20040309125959.GD25204@cygbert.vinschen.de>
On Tue, Mar 09, 2004 at 01:59:59PM +0100, Corinna Vinschen wrote:
> * gdb.cp/misc.cc (enums1): Add a line to extend scope of
> local variable obj_with_enum.
>
> Index: gdb.cp/misc.cc
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/misc.cc,v
> retrieving revision 1.1
> diff -u -p -r1.1 misc.cc
> --- gdb.cp/misc.cc 23 Aug 2003 03:55:59 -0000 1.1
> +++ gdb.cp/misc.cc 8 Mar 2004 19:59:17 -0000
> @@ -433,6 +433,7 @@ void enums1 ()
> obj_with_enum.x = 0;
> enums2 ();
> obj_with_enum.priv_enum = ClassWithEnum::green;
> + obj_with_enum.priv_enum = ClassWithEnum::yellow;
> }
>
> class ClassParam {
>
Personally, I recommend using a different (new) variable; otherwise,
we'll be back here in a release when GCC decides to do a little bit
more dead code elimination at -O0.
Otherwise, I agree with your analysis and recommend this patch for
approval. I've been thinking that it would be nice to have a way to
view recently out-of-scope variables, but I couldn't work out either
the mechanism or the interface, so...
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer