From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48594 invoked by alias); 22 Feb 2017 11:47:05 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 48549 invoked by uid 89); 22 Feb 2017 11:47:04 -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=whilst 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 11:47:03 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 B255C1555C; Wed, 22 Feb 2017 11:47:03 +0000 (UTC) Received: from [10.36.117.33] (ovpn-117-33.ams2.redhat.com [10.36.117.33]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1MBl1qW012566 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 Feb 2017 06:47:02 -0500 Subject: Re: [PATCH 3/6] DWARF-5 basic functionality To: Jan Kratochvil , binutils@sourceware.org References: <148719947800.19826.950569475344047705.stgit@host1.jankratochvil.net> <148719949682.19826.2070422036617207800.stgit@host1.jankratochvil.net> Cc: Victor Leschuk From: Nick Clifton Message-ID: <95456ac5-4750-092a-0fe7-eee1cc2a9a35@redhat.com> Date: Wed, 22 Feb 2017 11:47:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <148719949682.19826.2070422036617207800.stgit@host1.jankratochvil.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00242.txt.bz2 Hi Jan, Oops - I forgot - I found a bug in this patch whilst running your testcase: > +static void > +display_loclists_list (struct dwarf_section *section, > + unsigned char **start_ptr, > + unsigned int debug_info_entry, > + unsigned long offset, > + unsigned long base_address, > + int has_frame_base) > +{ > + case DW_LLE_base_address: > + SAFE_BYTE_GET_AND_INC (base_address, start, pointer_size, > + section_end); > + print_dwarf_vma (base_address, pointer_size); > + printf (_("(base address)\n")); > + break; The SAFE_BYTE_GET_AND_INC macro will trigger a runtime abort if this code is compiled for a 32-bit host (where sizeof base_address == 4) and run on DWARF5 information created for a 64-bit target (where pointer_size == 8). I used a local patch which read the new base address into a bfd_vma variable and then assigned it to the real base_address afterwards, but it occurred to me afterwards that this was wrong and that really the base_address parameter should be a bfd_vma. Probably offset should be one too. Cheers Nick