patch 3/3 debuginfod client interruptability
Fri Nov 15 18:14:00 GMT 2019
On 11/15/19 5:35 PM, Mark Wielaard wrote:
> IMHO it would be best to avoid any global state from the start. Since
> we haven't released this api yet we can make it so that it is easy to
> have state per request object.
> In the gdb thread
> https://sourceware.org/ml/gdb-patches/2019-11/msg00118.html Simon
> Marchi suggested something like:
> debuginfod_client *client = debuginfod_create_client ();
> debuginfod_set_progressfn (client, my_progress_cb);
> With debuginfod_client * being an opaque pointer. I think that is a
> good idea. It also matches what libelf (with Elf *) and libdw (with
> Dwarf *) do. It also makes it easy to add other kinds of state to
> client requests later.
We were discussing this on the #gdb channel on IRC, and I think
Simon's idea is the best one so far.
It reminded me of libabc,
which promotes that client pointer mechanism.
I recommend reading this:
Notably, the "Zero global state" part.
More information about the Elfutils-devel