> If you type just "core-file COREFILE" (without
"file BINARY") it will
> find the binary according to its build-id.
This may be wrong in the rare case when binary name is somehow
misdetected, or the binary was replaced. But such cases are not typical,
so I do not want to worry about it just yet.
I'm not following you. Going purely by build ID is exactly what avoids
being wrong when files have changed on disk since the process ran.
One way to achieve it is to obtain the list of all build-ids
of all binaries/libraries loaded in crashed process' memory.
Then it is trivial to check existence of
/usr/lib/debug/.build-id/XX/XXX files.
Can we do it somehow? I imagine the last resort way to do it
is to read gdb source and extract the code which does that,
but maybe there is a simpler way?
eu-unstrip -n --core FILE
eu-unstrip -n -p PID
or the libdwfl calls that uses. Didn't we discuss this before on this list?
Thanks,
Roland