Re: [RFC PATCH] Support debuginfo and source file fetching via debuginfo server

Simon Marchi
2019-11-05T05:27:27Z

On 2019-11-04 8:59 p.m., Aaron Merey wrote:
> On Mon, Nov 4, 2019 at 11:26 AM Frank Ch. Eigler <fche@redhat.com> wrote:
>>
>> Hi -
>>
>>> I haven't followed this thread closely, so it might be an obvious "no", but
>>> I was wondering if the library could offer to install a callback that is call
>>> relatively often, allowing GDB to interrupt the operation [...]
>>
>> That could also work, at the cost of extending the API. Will play with it.
>>
>> - FChE
>
> Attached is the updated debuginfo and source lookup code, using the
> callback idea that Simon suggested. Downloads are now cancelled upon
> SIGINT and the callback can be modified with code that prints progress
> messages (the a and b parameters in the callback represent the
> numerator and denominator of the download's completion fraction).

Cool, thanks!

Maybe a user_data void pointer would be useful, to be able to get some
context in the callback?

I am noticing that debuginfod calls don't have any "context" or "handle"
parameters, which could suggest that the state of the library (if there
is any) is kept as global variables. Is it safe to use the library to
do lookups in parallel, from different threads? It is possible that
GDB or another program will want to do that some day.

Simon