debuginfod vs

Florian Weimer
Wed Nov 30 18:46:14 GMT 2022

* Mark Wielaard:

> Hi Avi,
> On Thu, 2022-11-24 at 14:02 +0200, Avi Kivity via Gdb wrote:
>> (tangent: is it possible to express code as DWARF
>> expressions? if so it will be possible to get rid of,
>> by having libc encode accessors to thread information as some DWARF
>> expressions, and teaching gdb to use those expressions instead of
>> calling
> There used to be an effort to define a kind of extended DWARF
> expressions, infinity notes, to describe things like the
> code. Although the website can only be found in
> now, the code is still out there:
> Mailing list:, 
> Source code:, 

These days, I would recommend to teach GDB to poke at the internal
data structures to glean the necessary data.  The offsets vary a lot and
would have to come from DWARF, but the structures themselves are fairly
stable (relative to other changes in GDB that glibc updates impose—sorry
about that).

To enable experimentation with this approach, we have stopped removing
debuginfo from in our distributions.

I kind of want to ship a header-only library in glibc which provides
this capability across multiple glibc versions, while outsourcing the
DWARF parsing etc. to GDB.

libthread_db also had code to compensate for limitations in the original
Linux ptrace interface, but that isn't needed anymore.


More information about the Gdb mailing list