public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "Frank Ch. Eigler" <fche@redhat.com>
To: Milian Wolff <mail@milianw.de>
Cc: elfutils-devel@sourceware.org
Subject: Re: Questions regarding debuginfod.h API
Date: Fri, 8 Apr 2022 09:44:32 -0400	[thread overview]
Message-ID: <20220408134432.GA23295@redhat.com> (raw)
In-Reply-To: <5817622.lOV4Wx5bFT@agathemoarbauer>

Hi -

> now that archlinux is supporting debuginfod, I have finally tried it
> out. It's such a game changer, many thanks for everyone involved in
> working on this!

Our pleasure!

> Now to my question: In applications using elfutils, we will now
> automatically download debug information when DEBUGINFOD_URLS is
> defined. But doing that can take a very long time. 

(See also the DEBUGINFOD_MAXTIME and DEBUGINFOD_MAXSIZE env vars
that can limit this.)

> I would like to give the user feedback about this situation and
> ideally provide a means to cancel the download.

OK.

> Looking at `debuginfod.h` I `debuginfod_set_progressfn` which looks
> ideal. But how do I access the default `debuginfod_client *` which
> seems to exist without me ever calling `debuginfod_begin` anywhere?
> Or do I need to create a new client here via `debuginfod_begin`?

You do need to create a new client object.  You can reuse it.

> Then, how would I cancel an ongoing download job? GDB seems to do
> that when I press `CTRL+C`, but I do not see any API I could use for
> that purpose?

See [man debuginfod_set_progressfn].  The return code from that
progressfn callback is the ticket.


> Finally, what is the recommended way to check whether debuginfod is
> available?  Should one rely on the build system to discover the
> `debuginfod.h` header file, or is some other compile time check
> suggested to detect it?  [...]

To decide whether or not to compile in support, you'd need a
compile-time check such as for the debuginfod.h header.  (Alternately,
you could opt not to compile in support at all, and instead call out
to the debuginfod-find(1) program.)  To decide at run time whether or
not to use it, you could just use the *_find APIs and get back an
error code if things are not set up.  Or you can check the
DEBUGINFOD_URLS for being set/unset before you call in.


- FChE


  reply	other threads:[~2022-04-08 13:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08 12:44 Milian Wolff
2022-04-08 13:44 ` Frank Ch. Eigler [this message]
2022-04-08 19:09   ` Milian Wolff
2022-04-08 19:44     ` Frank Ch. Eigler
2022-04-08 19:50       ` Milian Wolff
2022-04-09 13:44         ` Expanding control over debuginfod usage from dwfl [was: Re: Questions regarding debuginfod.h API] Milian Wolff
2022-07-06 18:28           ` Milian Wolff
2022-07-06 18:40             ` Frank Ch. Eigler
2022-07-06 19:37               ` Milian Wolff
2022-07-06 19:41                 ` Frank Ch. Eigler
2022-07-06 19:44                   ` Milian Wolff
2022-07-06 19:54                     ` Frank Ch. Eigler
2022-04-16 15:03         ` Questions regarding debuginfod.h API Frank Ch. Eigler

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=20220408134432.GA23295@redhat.com \
    --to=fche@redhat.com \
    --cc=elfutils-devel@sourceware.org \
    --cc=mail@milianw.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).