From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101422 invoked by alias); 22 Feb 2017 14:29:03 -0000 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 Received: (qmail 101405 invoked by uid 89); 22 Feb 2017 14:29:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=bg, BG, $b!g, $B!G X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Feb 2017 14:29:01 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 01C2D3D956; Wed, 22 Feb 2017 14:29:02 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-221.ams2.redhat.com [10.36.116.221]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1MESwXj013998 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 22 Feb 2017 09:29:01 -0500 Date: Wed, 22 Feb 2017 14:29:00 -0000 From: Jan Kratochvil To: Andreas Arnez Cc: gdb-patches@sourceware.org, Victor Leschuk Subject: Re: [PATCH v2 4/8] DWARF-5 basic functionality Message-ID: <20170222142857.GA25383@host1.jankratochvil.net> References: <148753968011.4016.6818202131640662529.stgit@host1.jankratochvil.net> <148753970532.4016.14210350935498491454.stgit@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00590.txt.bz2 On Tue, 21 Feb 2017 20:18:36 +0100, Andreas Arnez wrote: > When I compile with "-O3", GCC now yields warnings for the two changed > lines above: > > [...] warning: ‘header.comp_unit_head::type_offset_in_tu.cu_offset::cu_off’ > may be used uninitialized in this function [-Wmaybe-uninitialized] What compiler/version/options do you use? I have tried now gcc-4.8.5-11.el7.x86_64 CFLAGS=-O3 CXXFLAGS=-O3 ./configure;make While I get some warnings/errors none of them is in dwarf2read.c. I do not want to patch it without reproducibility of the warnings. > I *think* GCC is wrong. From what I understand, we can only get here if > header.unit_type == DW_UT_type, and then these fields should have been > initialized in read_comp_unit_head before (right?). Yes, I hope so. > But then I wonder > about the effect of the call to create_debug_type_hash_table in > create_all_type_units: > > create_debug_type_hash_table (NULL, &dwarf2_per_objfile->info, types_htab, > rcuh_kind::COMPILE); > > Is that needed? Yes. Otherwise GDB would not read definitions of classes during -gdwarf-5 -fdebug-types-section as then DW_UT_type are located inside .debug_info. > When doing so (see untested patch below), No, that breaks: -gdwarf-5 -fdebug-types-section Jan