From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Cd6UCMP0q2AvZAAAWB0awg (envelope-from ) for ; Mon, 24 May 2021 14:47:31 -0400 Received: by simark.ca (Postfix, from userid 112) id 13E3C1F11C; Mon, 24 May 2021 14:47:31 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 5692C1E01F for ; Mon, 24 May 2021 14:47:30 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B6E5438930CF; Mon, 24 May 2021 18:47:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B6E5438930CF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1621882049; bh=LmX+z0cIh8HcvxRyJviM1Pt4K9WKZta9mS8GZshbd2I=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=oegoCY7XWAOPVaPvh3aqXf6Ojspal1TCvpO7eDFAcXU9WYjfzbL9mCkXcOwVQnXU8 DGSOhAQgKAYMmxEbWRu8su+6n2hsFAKmkemStPWrOa4pUUMvyLQ/kHeqs1OMoeXxgh 1VVlLB2YJ7bNU5/EXbFQ/ux1AbV7YYtYKv5Rqzvo= 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> 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-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: , From: Keith Seitz via Gdb-patches Reply-To: Keith Seitz Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" 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 {