From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24628 invoked by alias); 17 Oct 2010 11:54:08 -0000 Received: (qmail 24619 invoked by uid 22791); 17 Oct 2010 11:54:07 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 17 Oct 2010 11:54:03 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9HBs1f7023267 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 17 Oct 2010 07:54:01 -0400 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o9HBrxVX003529 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 17 Oct 2010 07:54:01 -0400 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o9HBrxou015253; Sun, 17 Oct 2010 13:53:59 +0200 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o9HBrwNA015251; Sun, 17 Oct 2010 13:53:58 +0200 Date: Sun, 17 Oct 2010 11:54:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org, Andreas Schwab Subject: [patch] varobj.c: Reset string_print [Re: [obv] varobj.c: Fix GCC false warning] Message-ID: <20101017115358.GA15234@host1.dyn.jankratochvil.net> References: <20101017084541.GA32723@host1.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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: 2010-10/txt/msg00273.txt.bz2 On Sun, 17 Oct 2010 12:02:08 +0200, Andreas Schwab wrote: > What happens if string_print is set but gdbpy_extract_lazy_string was > not called? I agree. BTW this is unrelated to the [obv] fix, in fact GCC warned on a falsely uninitialized value and GCC missed a real uninitialized value . I guess this patch should fix it. No regressions on {x86_64,x86_64-m32,i686}-fedora14snapshot-linux-gnu. Thanks, Jan gdb/ 2010-10-17 Jan Kratochvil * varobj.c (value_get_print_value): Reset STRING_PRINT if STR_ADDR is not set. --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -2557,9 +2557,14 @@ value_get_print_value (struct value *value, enum varobj_display_formats format, make_cleanup (xfree, thevalue); } else - gdbpy_print_stack (); + { + gdbpy_print_stack (); + string_print = 0; + } } } + else + string_print = 0; if (replacement) value = replacement; }