I think gcore should stream also build-id and path: /lib/libthread_db.so.1. I see the following error message when opening a core file: warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available. And gdb should be able to load the specified file when loading a core file.
@Aaron: Is this something you're planning to take a look?
(In reply to Martin Liska from comment #1) > @Aaron: Is this something you're planning to take a look? I'm not seeing the "unable to find libthread_db" warning when opening a core file. Do you have a reproducer for this?
The message will be displayed if you debug a core file from a machine that has e.g. ancient version of glibc: gdb/linux-thread-db.c: /* Predicate which tests whether objfile OBJ refers to the library containing pthread related symbols. Historically, this library has been named in such a way that looking for "libpthread" in the name was sufficient to identify it. As of glibc-2.34, the C library (libc) contains the thread library symbols. Therefore we check that the name matches a possible thread library, but we also check that it contains at least one of the symbols (pthread_create) that we'd expect to find in the thread library. */ static bool libpthread_objfile_p (objfile *obj) { return (libpthread_name_p (objfile_name (obj)) && lookup_minimal_symbol ("pthread_create", NULL, obj).minsym != NULL); }