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 ESMTPS id 8DBE2384D15B for ; Fri, 26 Aug 2022 21:24:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8DBE2384D15B Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-172-ZLkmI9EkPqe6JslA6glMpA-1; Fri, 26 Aug 2022 17:24:32 -0400 X-MC-Unique: ZLkmI9EkPqe6JslA6glMpA-1 Received: by mail-qv1-f71.google.com with SMTP id lx4-20020a0562145f0400b00496ecf45ac4so1734619qvb.7 for ; Fri, 26 Aug 2022 14:24:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc; bh=mLYjDFOYmjzcX4ZNaJoqa6gWJv2unkp6Q8S3JVWtUdU=; b=q/0CAKEi61oyeqViDke/jeZonF9CsoyPsQs/4Kc23wb695WAupLx71QytkmULUO6uC jqQO+u8xlw1ilW7eXpHgwbvpfd0CfOarPTbiRZLeDqhW4FNtW7fDSM3HdEgnXLMegKsR 9YG0JdCD+s3AM1dXH9DdkdyQ2b6PsgcmDnES3ic8INlR0Y2cRIFFwPN1Xs6JhHRl8u0K W6VW8LevcM3FYJewvRqOEVOR3c+YRO4NycsIOj3A1u/KQA2UfIaJfPIcWRblXtJSaRgB /4L4U9dJAC1poox3yQsPN1jTjhGZ87pnMzAPpOGW1adRpTQsdrYVlo7Z7vbgBhJv/mqj ndrQ== X-Gm-Message-State: ACgBeo06XCX8wXqdDg3cJv1D/seNhV4ZmwjsKQDrrjUU36M0hRWdgQDp LiuiTkUOxZvZioGDafqXwAKZxmYxHlQmJX/Lw00i8uuUCjVYSTAAeQ68Oyb2k1hl9JsWI5M8OsE paKwdrCsInojHbRno4bvuFJ3jPzM/5sqVzFEX X-Received: by 2002:a05:6214:f27:b0:476:9d88:2597 with SMTP id iw7-20020a0562140f2700b004769d882597mr1249585qvb.45.1661549071669; Fri, 26 Aug 2022 14:24:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR6BCsAHA+EfKAsOpf31rE45loTqy1Co0Vl1jo1Q2tfTujEXEcLo4renFwZTYdRCFah4+1nQlj6eDOD9sAsn+s0= X-Received: by 2002:a05:6214:f27:b0:476:9d88:2597 with SMTP id iw7-20020a0562140f2700b004769d882597mr1249573qvb.45.1661549071455; Fri, 26 Aug 2022 14:24:31 -0700 (PDT) MIME-Version: 1.0 References: <20220401200751.242370-1-amerey@redhat.com> In-Reply-To: From: Aaron Merey Date: Fri, 26 Aug 2022 17:24:20 -0400 Message-ID: Subject: [PING][PATCH] gdb/elfread.c: Use bfd filename instead of objfile->original_name To: gdb-patches@sourceware.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Fri, 26 Aug 2022 21:24:37 -0000 Ping Thanks, Aaron On Tue, Jul 5, 2022 at 6:43 PM Aaron Merey wrote: > > Ping > > Thanks, > Aaron > > On Fri, Apr 1, 2022 at 4:08 PM Aaron Merey wrote: > > > > The call to debuginfod_debuginfo_query in elf_symfile_read is given > > objfile->original_name as the filename to print when downloading the > > objfile's debuginfo. > > > > In some cases original_name is prefixed with gdb's working directory > > even though the objfile is not located in the working directory. This > > causes debuginfod to display the wrong path of the objfile during a download. > > > > Fix this by using the objfile's bfd filename instead. > > --- > > gdb/elfread.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/gdb/elfread.c b/gdb/elfread.c > > index fb40032c505..3554e5d71a2 100644 > > --- a/gdb/elfread.c > > +++ b/gdb/elfread.c > > @@ -1286,13 +1286,14 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) > > { > > has_dwarf2 = false; > > const struct bfd_build_id *build_id = build_id_bfd_get (objfile->obfd); > > + const char *filename = bfd_get_filename (objfile->obfd); > > > > if (build_id != nullptr) > > { > > gdb::unique_xmalloc_ptr symfile_path; > > scoped_fd fd (debuginfod_debuginfo_query (build_id->data, > > build_id->size, > > - objfile->original_name, > > + filename, > > &symfile_path)); > > > > if (fd.get () >= 0) > > @@ -1302,7 +1303,7 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) > > > > if (debug_bfd == nullptr) > > warning (_("File \"%s\" from debuginfod cannot be opened as bfd"), > > - objfile->original_name); > > + filename); > > else if (build_id_verify (debug_bfd.get (), build_id->size, build_id->data)) > > { > > symbol_file_add_separate (debug_bfd.get (), symfile_path.get (), > > -- > > 2.35.1 > >