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

Simon Marchi
2019-11-04T15:46:58Z

On 2019-11-04 10:03 a.m., Frank Ch. Eigler wrote:
> fche@redhat.com (Frank Ch. Eigler) writes:
>
>> Actually we can probably do even better: trap the SIGINT ourselves in
>> libdebuginfod, but upon return to gdb with an -EINTR, the caller can
>> call set_quit_flag(). Then the rest of gdb can react the normal way.
>
> Actually2, prototyped a solution whereby the library temporarily hijacks
> SIGINT to interrupt its ongoing transfers, then raises a SIGINT back to
> gdb or other caller upon return. If this works, then no changes at all
> are required to the gdb/libdebuginfod interface code.
>
> - FChe
>

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 if it returns a
certain value. GDB would check its quit_flag in there. I would find that
cleaner and easier to understand than having the main program and libraries
competing for the same signal handler.

At the same time, that callback would be used to report progress, and GDB
could display a nice progress bar!

Simon