From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14046 invoked by alias); 18 Jun 2009 14:06:34 -0000 Received: (qmail 14032 invoked by uid 22791); 18 Jun 2009 14:06:30 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Jun 2009 14:06:21 +0000 Received: from spaceape24.eur.corp.google.com (spaceape24.eur.corp.google.com [172.28.16.76]) by smtp-out.google.com with ESMTP id n5IE6HZi021298 for ; Thu, 18 Jun 2009 15:06:17 +0100 Received: from qyk15 (qyk15.prod.google.com [10.241.83.143]) by spaceape24.eur.corp.google.com with ESMTP id n5IE67BZ022951 for ; Thu, 18 Jun 2009 07:06:15 -0700 Received: by qyk15 with SMTP id 15so1450600qyk.14 for ; Thu, 18 Jun 2009 07:06:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.86.131 with SMTP id s3mr292518qcl.8.1245333975106; Thu, 18 Jun 2009 07:06:15 -0700 (PDT) In-Reply-To: <200906180919.n5I9Jh9H004739@d06av01.portsmouth.uk.ibm.com> References: <20090527001157.934BD76BC0@localhost> <8ac60eac0905280956v79d9a84apad9a4370212283b9@mail.gmail.com> <8ac60eac0906101839t4d3978fyc1c6d3b3e2eccb6e@mail.gmail.com> <8ac60eac0906101842y2d2fc9fco331cb4336d9508d0@mail.gmail.com> <8ac60eac0906161342m67c30151lc7f685e0eb36e41f@mail.gmail.com> <8ac60eac0906161407s6498913cu5e50e930d599be77@mail.gmail.com> <200906180919.n5I9Jh9H004739@d06av01.portsmouth.uk.ibm.com> Date: Thu, 18 Jun 2009 14:06:00 -0000 Message-ID: <8ac60eac0906180706g13d0c7c8q5c9434664de9d664@mail.gmail.com> Subject: Re: [patch] Use mmap instead of obstack_alloc for dwarf debug sections. From: Paul Pluzhnikov To: Ken Werner Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-System-Of-Record: true 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: 2009-06/txt/msg00468.txt.bz2 On Thu, Jun 18, 2009 at 2:19 AM, Ken Werner wrote: > I noticed gdb/dwarf2-frame.c:1922 (and :1950) calls dwarf2_get_section_info > with unsigned long* (5th argument). The function expects a bfd_size_type * > (a pointer to an unsigned long long on my machine). Thus the compiler issues > a warning and the gdb build fails because of -Werror. Is it sufficient to > just cast to (bfd_size_type *) or am I missing something? I think the cast would be wrong, as dwarf2_get_section_info would really write 'unsigned long long' and corrupt your stack. I've checked in the patch below under the obvious rule. -- Paul Pluzhnikov 2009-06-18 Paul Pluzhnikov * dwarf2-frame.c (struct comp_unit): Use bfd_size_type for dwarf_frame_size. Index: dwarf2-frame.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v retrieving revision 1.88 diff -u -p -u -r1.88 dwarf2-frame.c --- dwarf2-frame.c 16 Jun 2009 21:06:40 -0000 1.88 +++ dwarf2-frame.c 18 Jun 2009 13:57:58 -0000 @@ -130,7 +130,7 @@ struct comp_unit gdb_byte *dwarf_frame_buffer; /* Length of the loaded .debug_frame section. */ - unsigned long dwarf_frame_size; + bfd_size_type dwarf_frame_size; /* Pointer to the .debug_frame section. */ asection *dwarf_frame_section;