Automatically fetching Build ID from remote libraries and resole them locally?

Norbert Lange
Fri Mar 27 14:20:21 GMT 2020


I am mostly remote debugging, and I often have mismatches from the
remote binaries and the local build environment (typically this makes
thing worse than having no debug info)
This can include the app themself, but most commonly its slightly
different builds of libraries.

Right now I can pick between setting up a sysroot path, or DL the
(stripped) libraries from the target. Neither is optimal.
If your sysroot is compromised of several builds, its also not
feasible to have all combinations of them around.

Build-Ids already solve those problems on a local gdb session. Would
it be possibly to use the benefits on remote sessions aswell?

ie. DL only some ELF headers or remotely inspect the Build-ID,
then lookup and resolve the matching library and debuginfo in the
debug-file-directory database.
Potentially transfer the whole library from the target if that fails.

Such a scheme would make connection to a remote target rather foolproof, and
allowing other stuff like manually loaded libraries (no valid
filename) to work aswell.


More information about the Gdb mailing list