From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 33C8E3857801 for ; Mon, 24 May 2021 18:47:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 33C8E3857801 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-110-PoLOG1ZUMSq0SNWP_Qqhcw-1; Mon, 24 May 2021 14:47:22 -0400 X-MC-Unique: PoLOG1ZUMSq0SNWP_Qqhcw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1E79681840C; Mon, 24 May 2021 18:47:22 +0000 (UTC) Received: from [10.3.112.40] (ovpn-112-40.phx2.redhat.com [10.3.112.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DCA6060C05; Mon, 24 May 2021 18:47:21 +0000 (UTC) Subject: Re: [PATCH] Fix macro info lookup for binaries containing DWARFv5 line table To: "Tomar, Sourabh Singh" , "gdb-patches@sourceware.org" References: <20210512171655.9463-1-SourabhSingh.Tomar@amd.com> <22ab603a-35e1-4048-3ccc-6738a13889df@redhat.com> From: Keith Seitz Message-ID: Date: Mon, 24 May 2021 11:47:21 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2021 18:47:28 -0000 On 5/24/21 4:36 AM, Tomar, Sourabh Singh wrote: > [AMD Public Use] > > Hello Keith, > > Could you please share your plan WRT to this patch. > Do you want to take it forward ? or you want me to take this forward. > I can pursue this... In that vein, does anyone (maintainers?) have an input on my "counterpatch" (reposted below) that removes this IS_ABSOLUTE_PREFIX stuff and copies the symtab's filename? I haven't officially submitted this as a patch because I'm curious whether my reading of this is correct/complete. Maybe the documentation/comments are incorrect or no longer valid? FWIW, I've tested that patch on native x86_64 Fedora 34 with no regressions. Keith Patch under discussion: gdb/ChangeLog * dwarf2/line-header.c (line_header::file_file_name): Copy the symtab's filename. diff --git a/gdb/dwarf2/line-header.c b/gdb/dwarf2/line-header.c index 7575297f966..117c5a42cc5 100644 --- a/gdb/dwarf2/line-header.c +++ b/gdb/dwarf2/line-header.c @@ -69,15 +69,10 @@ line_header::file_file_name (int file) const { const file_entry *fe = file_name_at (file); - if (!IS_ABSOLUTE_PATH (fe->name)) - { - const char *dir = fe->include_dir (this); - if (dir != NULL) - return gdb::unique_xmalloc_ptr (concat (dir, SLASH_STRING, - fe->name, - (char *) NULL)); - } - return make_unique_xstrdup (fe->name); + /* macro_source_file requires: "This filename is relative to the + compilation directory, it exactly matches the symtab->filename + content." */ + return make_unique_xstrdup (fe->symtab->filename); } else {