From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124270 invoked by alias); 22 Sep 2019 03:53:49 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 124242 invoked by uid 89); 22 Sep 2019 03:53:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.7 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,GIT_PATCH_1,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=aaron X-HELO: mail-ot1-f65.google.com Received: from mail-ot1-f65.google.com (HELO mail-ot1-f65.google.com) (209.85.210.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 22 Sep 2019 03:53:44 +0000 Received: by mail-ot1-f65.google.com with SMTP id f21so9356422otl.13 for ; Sat, 21 Sep 2019 20:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xAfB9ewWrQIgTyoaQuxiVuMz1QQSYrCt9bsD8o36Gwc=; b=bZDxhsdWWARa390Y43ZIyYHBI8H0T1VoLoVPOkIMj6Gq5xPVkP6Lv8Eme6zxm+ZGvV Udv9IjRxstDjHoV2XNbs5TfFTMB/xVy/gYr03CZj+EvPTASHRbUkY0BzZupftp+Gcx89 MMNADHdSZ4jF80upYD6zCSpkyAsQSGQr0oL3Dc4Dx4qfaT3U+EyFQYVdWO0QIuALhO4t MUuWoX0IYbLAd/4k40F0xw4rhXwKQZMSlOgrRSj2E+7YaA040uq9tnbQJ/yJESygO6Hk KQQWm8s0IvokhZz8FwHoCo7AWN22JpdTowrvr+dVNVGq916XadcGOrqDdW3O9+BziiLq RFsw== MIME-Version: 1.0 References: <20190820202809.25367-1-amerey@redhat.com> In-Reply-To: <20190820202809.25367-1-amerey@redhat.com> From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Sun, 22 Sep 2019 03:53:00 -0000 Message-ID: Subject: Re: [RFC PATCH] Support debuginfo and source file fetching via debuginfo server To: Aaron Merey Cc: gdb-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00440.txt.bz2 On Tue, Aug 20, 2019 at 4:28 PM Aaron Merey wrote: > Debuginfo server is a lightweight web service that indexes debuginfo > and source files by build-id and serves them over HTTP. Debuginfo server > is able to index unpackaged, locally-built software in addition to RPM > files. Debuginfo server is packaged with a shared library, libdbgserver, > that provides a small set of client functions for fetching files from > debuginfo server. This patch adds debuginfo server support to GDB. In > case a source file or separate debuginfo file cannot be found locally, > GDB can use libdbgserver to query debuginfo server for the file in > question, if enabled to do so. > [...] > @@ -1296,6 +1299,30 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) > symbol_file_add_separate (debug_bfd.get (), debugfile.c_str (), > symfile_flags, objfile); > } > +#if HAVE_LIBDBGSERVER > + else > + { > + const struct bfd_build_id *build_id; > + char *debugfile_path; > + > + build_id = build_id_bfd_get (objfile->obfd); > + int fd = dbgserver_find_debuginfo (build_id->data, > + build_id->size, > + &debugfile_path); > + > + if (fd >= 0) > + { > + /* debuginfo successfully retrieved from server, reopen > + the file as a bfd instead. */ > + gdb_bfd_ref_ptr debug_bfd (symfile_bfd_open (debugfile_path)); > + > + symbol_file_add_separate(debug_bfd.get (), debugfile_path, > + symfile_flags, objfile); > + close(fd); > + free(debugfile_path); > + } > + } > +#endif /* LIBDBGSERVER */ > } > } > You wrote that the debuginfo server will download symbols over HTTP. Does that mean that this call to dbgserver_find_debuginfo will block as it downloads the file? (will ctrl+c work as it does that?) If so, any way to do this download on a background thread? Christian