Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Christian Biesinger via gdb-patches" <gdb-patches@sourceware.org>
To: Aaron Merey <amerey@redhat.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFC PATCH] Support debuginfo and source file fetching via debuginfo server
Date: Sun, 22 Sep 2019 03:53:00 -0000	[thread overview]
Message-ID: <CAPTJ0XEyOeZHUDr2zFovuSjMDxZ-XB1Wq1rftFE39Uiz9QFCmQ@mail.gmail.com> (raw)
In-Reply-To: <20190820202809.25367-1-amerey@redhat.com>

On Tue, Aug 20, 2019 at 4:28 PM Aaron Merey <amerey@redhat.com> 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


  parent reply	other threads:[~2019-09-22  3:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 20:28 Aaron Merey
2019-09-13 21:03 ` Tom Tromey
2019-09-22  3:53 ` Christian Biesinger via gdb-patches [this message]
2019-10-09 14:55   ` Tom Tromey
2019-10-28 20:34     ` Aaron Merey
2019-11-01 19:31       ` Tom Tromey
2019-11-01 21:03         ` Aaron Merey
2019-11-02 14:05           ` Frank Ch. Eigler
2019-11-04 15:03             ` Frank Ch. Eigler
2019-11-04 15:46               ` Simon Marchi
2019-11-04 16:26                 ` Frank Ch. Eigler
2019-11-05  1:59                   ` Aaron Merey
2019-11-05  5:27                     ` Simon Marchi
2019-11-05 10:25                       ` Frank Ch. Eigler
2019-11-05 15:19                         ` Simon Marchi
2019-11-05 15:50                           ` Frank Ch. Eigler
2019-11-05  5:35                     ` Simon Marchi
2019-11-07 23:24                     ` Aaron Merey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPTJ0XEyOeZHUDr2zFovuSjMDxZ-XB1Wq1rftFE39Uiz9QFCmQ@mail.gmail.com \
    --to=gdb-patches@sourceware.org \
    --cc=amerey@redhat.com \
    --cc=cbiesinger@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox