From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 29C403857713 for ; Tue, 3 Oct 2023 21:29:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 29C403857713 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: by gnu.wildebeest.org (Postfix, from userid 1000) id EFBF430067D1; Tue, 3 Oct 2023 23:29:57 +0200 (CEST) Date: Tue, 3 Oct 2023 23:29:57 +0200 From: Mark Wielaard To: Omar Sandoval Cc: elfutils-devel@sourceware.org Subject: Re: [PATCH 05/14] libdw: Fix dwarf_macro_getsrcfiles for DWARF 5 Message-ID: <20231003212957.GG32765@gnu.wildebeest.org> References: 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-Spam-Status: No, score=-3028.4 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_NUMSUBJECT,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Omar, On Wed, Sep 27, 2023 at 11:20:54AM -0700, Omar Sandoval wrote: > Dwarf_Macro_Op_Table::is_64bit conflates the address size and the offset > size: for .debug_macinfo, it is initialized based on the compilation > unit's address size, but for .debug_macro, it is initialized based on > the macro unit's offset size. is_64bit is used to determine the address > size to pass to __libdw_getsrclines. For a 64-bit architecture using > DWARF 5 with 32-bit offsets (the common case), this fails because > read_srclines checks that the given address size matches the address > size from the line number program header. > > Fix it by splitting is_64bit into separate address_size and offset_size > members. Very nice catch. You are right that for DWARF5 the line table header already gives the address_size. It is slightly embarassing our sanity check here failed. Thanks for fixing. I had to think a bit on why we didn't need to set the address_size for the fake_cu. But that is only needed to read address class forms. Which aren't valid forms in macro data. Applied, Mark