From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30306 invoked by alias); 26 Jul 2010 18:41:14 -0000 Received: (qmail 30296 invoked by uid 22791); 26 Jul 2010 18:41:13 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate7.uk.ibm.com (HELO mtagate7.uk.ibm.com) (194.196.100.167) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Jul 2010 18:41:07 +0000 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id o6QIf4i4032535 for ; Mon, 26 Jul 2010 18:41:04 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o6QIf4ir872548 for ; Mon, 26 Jul 2010 19:41:04 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o6QIf489001630 for ; Mon, 26 Jul 2010 19:41:04 +0100 Received: from leonard.localnet (dyn-9-152-224-27.boeblingen.de.ibm.com [9.152.224.27]) by d06av02.portsmouth.uk.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id o6QIeHs3000970 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 26 Jul 2010 19:41:03 +0100 From: Ken Werner To: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [0/4] RFC: add DWARF index support Date: Mon, 26 Jul 2010 18:41:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.32-23-generic-pae; KDE/4.4.2; i686; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_RadTM0RHvthFFwr" Message-Id: <201007262040.17235.ken@linux.vnet.ibm.com> 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-07/txt/msg00397.txt.bz2 --Boundary-00=_RadTM0RHvthFFwr Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-length: 1030 On Saturday, July 24, 2010 12:12:03 am Tom Tromey wrote: > >>>>> "Tom" =3D=3D Tom Tromey writes: > Tom> Here is what I am testing. >=20 > Here is the variant I am checking it. It seems to work with all > combinations of .debug_types, .gdb_index, and -readnow. >=20 > Let me know if you hit any more problems. Hi Tom, It seems old GCCs do not recognize that the types_list_elements and types_l= ist=20 variables of dwarf2read.c:dwarf2_initialize_objfile are accessed under the= =20 same condition as they are initialized. GCC 4.1.2 (RHEL5) issues the follow= ing=20 warning: src/gdb/dwarf2read.c: In function =E2=80=98dwarf2_initialize_objfile=E2=80= =99: src/gdb/dwarf2read.c:1839: warning: =E2=80=98types_list_elements=E2=80=99 m= ay be used=20 uninitialized in this function src/gdb/dwarf2read.c:1838: warning: =E2=80=98types_list=E2=80=99 may be use= d uninitialized in=20 this function The attached patch initializes the two variables to prevent the warnings. OK to apply? Regards -ken --Boundary-00=_RadTM0RHvthFFwr Content-Type: text/x-patch; charset="UTF-8"; name="dwarf2read-warnings.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dwarf2read-warnings.patch" Content-length: 893 Changelog: 2010-07-06 Ken Werner * valops.c (dwarf2_read_index): Initialize the types_list and types_list_elements variables. Index: dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.425 diff -p -u -r1.425 dwarf2read.c --- dwarf2read.c 23 Jul 2010 22:15:13 -0000 1.425 +++ dwarf2read.c 26 Jul 2010 18:06:02 -0000 @@ -1835,8 +1835,10 @@ dwarf2_read_index (struct objfile *objfi char *addr; struct mapped_index *map; offset_type *metadata; - const gdb_byte *cu_list, *types_list; - offset_type version, cu_list_elements, types_list_elements; + const gdb_byte *cu_list; + const gdb_byte *types_list = NULL; + offset_type version, cu_list_elements; + offset_type types_list_elements = 0; int i; if (dwarf2_per_objfile->gdb_index.asection == NULL --Boundary-00=_RadTM0RHvthFFwr--