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.129.124]) by sourceware.org (Postfix) with ESMTPS id DF68C3858006 for ; Wed, 9 Feb 2022 02:30:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DF68C3858006 Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-453-nmVs6aUTP-SXv3JHy4RNYg-1; Tue, 08 Feb 2022 21:30:20 -0500 X-MC-Unique: nmVs6aUTP-SXv3JHy4RNYg-1 Received: by mail-qt1-f200.google.com with SMTP id s1-20020ac85ec1000000b002cf7c93d56dso660121qtx.21 for ; Tue, 08 Feb 2022 18:30:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=uPW48zlxOVMi567G8WZpRIW7DgQa1PhEgZIwCkSMLdk=; b=KpK4cKKW4+Jz0DVNla4yP+JkT+5nWdYNnm5P0Ery3GvvymSiNoGqrnap9dTLHAa5aa dil0MIMANKzDtKcVTkajQLIxPQzZTm0gQqLwqpIvTdcPV8eCQPonOGIwvyZB9WwGQTck GeBoCI0FqUhTzi6e9/40uHed6p6m7fiXgd1ugHKX2RygD8cdpTOCgnbpX7uqoU5OFWf6 bViLFy/+mCwgawi7W3Iotyse5MFkKqD5gf51Jmmu0h30TeJfq3dXChDWu35Tt0rWO02b BjFlqCdppvDeFOpaQnOWsC4PODsOemzTxr6ZU4ogy3yko9oyZpyFPWgY7juBayXsIog2 9ZsA== X-Gm-Message-State: AOAM533UBoKOoVfJ49x4prZUd6M8Ir0R+1hDvF0iTiR6QtnhzMiyKpkv OhnU7Zo2LbxS75lZGzvCz3Arx2R5n7PQI01MrObHaZqk9lg8XCODvJX0kKNJF3BvkdWIchxw4tn X5BOlJWcDa6ZEQyvV4qLG4EAPXmP3z+2RqTJZ X-Received: by 2002:a05:622a:407:: with SMTP id n7mr47802qtx.513.1644373819916; Tue, 08 Feb 2022 18:30:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2l62AObliwpS0Cj3r2OEpJwlxXaFlp05CbAkHSAOnt8ir5lYE8AGm4pt0+ffjPGZsojqt7m35ZKVQWFyuzI4= X-Received: by 2002:a05:622a:407:: with SMTP id n7mr47795qtx.513.1644373819625; Tue, 08 Feb 2022 18:30:19 -0800 (PST) MIME-Version: 1.0 References: <20211120004140.737744-1-amerey@redhat.com> In-Reply-To: From: Aaron Merey Date: Tue, 8 Feb 2022 21:30:06 -0500 Message-ID: Subject: Re: [PATCH] PR gdb/27876 - debuginfod-downloaded source files don't pass proper fullname across mi / (gdb)info source 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=-12.0 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_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Wed, 09 Feb 2022 02:30:23 -0000 Ping ** 2 Thanks, Aaron On Tue, Jan 25, 2022 at 8:43 PM Aaron Merey wrote: > > Ping > > Thanks, > Aaron > > On Fri, Nov 19, 2021 at 7:42 PM Aaron Merey wrote: > > > > Source files downloaded from debuginfod currently use their original DWARF > > filename as their "fullname". This causes a mismatch between the fullname > > and the actual location of the source file in the debuginfod client cache. > > > > MI consumers such as VSCode will fail to open debuginfod-downloaded > > source files due to this. Also 'info source' will fail to include the > > true paths of these files. > > > > To fix this, use the debuginfod cache path as the fullname for debuginfod- > > downloaded source files. > > --- > > gdb/debuginfod-support.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c > > index 2e1837da949..3f57b5d50cb 100644 > > --- a/gdb/debuginfod-support.c > > +++ b/gdb/debuginfod-support.c > > @@ -201,6 +201,7 @@ debuginfod_source_query (const unsigned char *build_id, > > if (c == nullptr) > > return scoped_fd (-ENOMEM); > > > > + char *dname = nullptr; > > user_data data ("source file", srcpath); > > > > debuginfod_set_user_data (c, &data); > > @@ -208,7 +209,7 @@ debuginfod_source_query (const unsigned char *build_id, > > build_id, > > build_id_len, > > srcpath, > > - nullptr)); > > + &dname)); > > debuginfod_set_user_data (c, nullptr); > > > > if (debuginfod_verbose > 0 && fd.get () < 0 && fd.get () != -ENOENT) > > @@ -217,7 +218,7 @@ debuginfod_source_query (const unsigned char *build_id, > > styled_string (file_name_style.style (), srcpath)); > > > > if (fd.get () >= 0) > > - *destname = make_unique_xstrdup (srcpath); > > + destname->reset (dname); > > > > return fd; > > } > > -- > > 2.33.1 > >